Options for posting via the API to Instagram
Post images or videos directly to Instagram.
Instagram has the following requirements and restrictions:
- Only 25 Instagram posts are allowed over a 24 hour period - around 750 posts a month. See below for
posttext may contain up to 30 hashtags (e.g. #wildtimes) and 3 username mentions (e.g. @natgeo).
- @mention Instagram users will receive a notification.
- Maximum 2,200 post characters.
- Multi-image posts are supported via a carousel. Multiple videos are not supported.
- Delete not supported using the /delete endpoint.
- If your video doesn't end in a known video extension such as mp4, please use the
isVideoparameter. See the /post endpoint for details.
Note: The aspect ratio of images & videos and the duration of video are very important to successfully post to Instagram. If they do not meet the requirements, the post will be rejected.
Please see the Instagram section of Image and Video Guidelines:
JSON for a basic post with an image and hashtags to Instagram:
"post": "The best IG ever #best #aweome https://www.instagram.com",
Hashtags are clickable in Instagram posts, but links are not.
Your Instagram account must be a Business Account and connected with a Facebook Page. The setup is free and easy.
See here for detailed instructions:
You can post multiple images to Instagram as a carousel; up to 10 images may be use in a carousel. Just add your additional images to the
mediaUrlsarray and the carousel will automatically be created. Videos are not supported in carousel.
"mediaUrls": ["https://url1.com", "https://url2.com" ...]; // Max 10 images
You can post a video to Instagram Reels API with the following
"post": "The description of the video",
reels: set to
trueto post the video to Reels.
shareReelsFeed: set to
trueto share the reel in both the Feed and Reels tabs or
falseto only appear in the Reels tab. Neither value determines whether the reel actually appears in the Reels tab because the reel may not meet eligibility requirements or may not be selected by Instagram's algorithm.
You may select a frame in the video or reel as the thumbnail image. Instagram does not support uploaded images for thumbnails.
"thumbNailOffset": 30000 // milliseconds
The offset is the location in milliseconds of the thumbnail frame. Default value is
0, which is the first frame of the video or reel.
The Instagram user will be notified when you use their username in a post. Please be cautious to not spam users or post with their username repeatedly. If you do, Instagram will suspend or deactivate your account.
An image can be tagged with Instagram users and images/videos can be tagged with a location, for a given Facebook Page Id, using the
A location is specified by a
locationId,which is a Facebook Page ID or Facebook Page name. For example, Facebook page Id of the Guggenheim Museum is
7640348500or Facebook page name
"@guggenheimmuseum". Pages must be associated with a physical location.
// Using the Facebook Page Id - must be associated with a location
"locationId": 7640348500 // Guggenheim Museum Page Id
// Using the Facebook Page name - must be associated with a location
"locationId": "@guggenheimmuseum" // Guggenheim Museum Page name. Must begin with @
Users are specified by a
userTagscontaining an Array of objects with an Instagram username and x/y coordinates on the image. Only available for images.
- Usernames must be public Instagram accounts.
yvalues must be
floatnumbers that originate from the top-left of the image, with a range of
"username": "ayrshare", // Instagram username
"x": 0.5, // Float value, originates from the top-left of the image
"y": 1.0 // Float value, originates from the top-left of the image
Mention another Instagram handle by adding @handle in the post text. For example:
"post": "The best social media API @Ayrshare ever!",
Enterprise Plans required.
Images are automatically resized to 1080 x 1080 px to work with Instagram with the autoResize parameter. Please note, this will resize the image for all included platforms, so we recommend making one call for Instagram and a different /post call for additional platforms.
"post": "Let it go!",
"autoResize": true, // Enterprise Plans only
Mention other Instagram handles by simply including the handle beginning with the @ symbol in the
posttext. For example:
"post": "Love the @ayrshare social media api"
The Instagram response will include the current
usedQuotafor the number of Instagram posts done over a rolling 24-hours period. Only 25 Instagram posts are permitted by Instagram in a 24-rolling-hour period.
"post": "Luckily for Alice, the little magic bottle had now had its full effect."
If the quota has been reached, an error message will be returned.
Available for Business Plans.
By default only Instagram business accounts are allowed to link. You may allow your users to connect a creator account, but Instagram restricts publishing post to only business accounts.
Instagram does not yet support publishing stories via their partner API integration.
Rich text, such as bold or italic lettering, can be added to a Instagram post with a few html elements.
Instagram Stories posting is not yet supported by Facebook's official API integration. However Facebook Reels and Instagram Reels can be posted via Ayrshare's API.