Skip to main content

All Posts

POST 

/instagram/page/getPosts

This endpoint allows you to see all the posts in your Instagram page (posts that were created by the API or directly on Instagram).

Settings:

SettingValue
URLhttps://api.99digital.co.il/instagram/page/getPosts
MethodJSON via POST
HeaderYour API key for the service (the apiKey header)

Body:

ParameterDescription / ExampleMandatoryExample
fromThe ID you received for the connectionyes463745743546345
limitHow many posts to get (limit pagination), between 1 and 100. Default if not provided: 25no25
typeTwo options: media - all posts, reels, videos, carousels. stories - live stories. Default if not provided: medianomedia
mediaIdIf you prefer to get information on one post and not all of them, here is where you put the mediaId. The response then holds that one post in "post" (not a "posts" list, and without "type", "count" and "paging"), and "type", "limit" and "after" are ignored (a "limit" that is not between 1 and 100 still returns reason 8)no5634634_634634563
afterIf you are using limit paging, you can provide the "after" value from the previous response to load the next batchnoU56WDF34FA4TER3DA.....

Response:

{
"status": "OK",
"from": "463745743546345",
"type": "media",
"count": 25,
"posts": [{
"id": "119324881085321_122093459712345",
"caption": "Hello fans!",
"media_type": "CAROUSEL_ALBUM",
"media_product_type": "FEED",
"media_url": "https://www.scontent.com/...",
"permalink": "https://instagram.com/p/...",
"created_time": 1783596120,
"children": { "data": [
{ "id": "17998877665544332", "media_type": "IMAGE", "media_url": "https://www.scontent.com/..." },
{ "id": "17998877665544333", "media_type": "VIDEO", "media_url": "https://www.scontent.com/...", "thumbnail_url": "https://www.scontent.com/..." }
] },
"like_count": 10,
"comments_count": 3,
"is_comment_enabled": true
}],
"paging": { "after": "QVFIU...", "hasNext": true },
"reason": 1
}

Response-Explain:

ParameterDescription
statusOK or FAIL
typeThe type you asked for: media or stories
countTotal posts in this batch
fromYour ID for the service

posts and paging:

ValueInformation
idThis is the postId (the mediaId of the post)
captionThe body of the post
media_typeIMAGE / VIDEO / CAROUSEL_ALBUM
media_product_typeFEED / REELS / STORY
media_urlLink to the media
permalinkLink directly to the post
thumbnail_urlThumbnail image link (only for videos)
created_timeThe post create time. UNIX UTC timestamp (int seconds)
like_countThe total likes of the post
comments_countThe total amount of comments this post has (int). For getting the actual comments, use the All Comments (getComments) API endpoint
is_comment_enabledtrue or false: whether comments are enabled on the post
childrenList of media URLs for carousel items (media_type = CAROUSEL_ALBUM): each item in "data" has its id, media_type, media_url, and thumbnail_url for a video
pagingKey that contains two values: "after", which represents the parameter to send if you wish to get the next batch, and "hasNext", which is true if you have more data to load, or false if this is the last data

reason:

ValueInformation
1Not FAIL. The status is OK
2Your "from" account does not exist (for example, its onboarding is not finished yet) or is missing, or JSON syntax error
3Wrong apiKey (the apiKey header is missing or wrong)
4The mediaId you sent is not a valid media ID
6Wrong connection type. Your keys/ID are correct, but you are using the wrong endpoint (for example: your onboarding was for Facebook Messenger, but you are using this Instagram endpoint)
7The connection is not active (it was disabled)
8"limit" is not a number between 1 and 100, or "type" is not media or stories
10You must do the onboarding again, the connection has expired
11A permission is missing: the connection does not have Meta's permission for this action
12Rate limit error. Too many requests. Please wait a few minutes and try again
13The postId (mediaId) is invalid or wrong: the post was not found, or it is not accessible
15The content you posted was rejected by Meta, or bad media / format / size, or an invalid parameter. It could also indicate a policy violation inside the content
18General error, try again

Stories​

For the "stories" type from the table above, only those will return in the response: id, media_type, media_url, permalink and created_time.

Remarks:

  • A field without a value is left out of the post: for example caption on a post without a caption, thumbnail_url on anything but a video, and children on anything but a carousel.

Request​

Responses​

The request was processed. Both a successful and a failed request answer with HTTP 200 — check status, and reason when it is FAIL.