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:
| Setting | Value |
|---|---|
| URL | https://api.99digital.co.il/instagram/page/getPosts |
| Method | JSON via POST |
| Header | Your API key for the service (the apiKey header) |
Body:
| Parameter | Description / Example | Mandatory | Example |
|---|---|---|---|
| from | The ID you received for the connection | yes | 463745743546345 |
| limit | How many posts to get (limit pagination), between 1 and 100. Default if not provided: 25 | no | 25 |
| type | Two options: media - all posts, reels, videos, carousels. stories - live stories. Default if not provided: media | no | media |
| mediaId | If 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) | no | 5634634_634634563 |
| after | If you are using limit paging, you can provide the "after" value from the previous response to load the next batch | no | U56WDF34FA4TER3DA..... |
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:
| Parameter | Description |
|---|---|
| status | OK or FAIL |
| type | The type you asked for: media or stories |
| count | Total posts in this batch |
| from | Your ID for the service |
posts and paging:
| Value | Information |
|---|---|
| id | This is the postId (the mediaId of the post) |
| caption | The body of the post |
| media_type | IMAGE / VIDEO / CAROUSEL_ALBUM |
| media_product_type | FEED / REELS / STORY |
| media_url | Link to the media |
| permalink | Link directly to the post |
| thumbnail_url | Thumbnail image link (only for videos) |
| created_time | The post create time. UNIX UTC timestamp (int seconds) |
| like_count | The total likes of the post |
| comments_count | The total amount of comments this post has (int). For getting the actual comments, use the All Comments (getComments) API endpoint |
| is_comment_enabled | true or false: whether comments are enabled on the post |
| children | List 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 |
| paging | Key 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:
| Value | Information |
|---|---|
| 1 | Not FAIL. The status is OK |
| 2 | Your "from" account does not exist (for example, its onboarding is not finished yet) or is missing, or JSON syntax error |
| 3 | Wrong apiKey (the apiKey header is missing or wrong) |
| 4 | The mediaId you sent is not a valid media ID |
| 6 | Wrong 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) |
| 7 | The connection is not active (it was disabled) |
| 8 | "limit" is not a number between 1 and 100, or "type" is not media or stories |
| 10 | You must do the onboarding again, the connection has expired |
| 11 | A permission is missing: the connection does not have Meta's permission for this action |
| 12 | Rate limit error. Too many requests. Please wait a few minutes and try again |
| 13 | The postId (mediaId) is invalid or wrong: the post was not found, or it is not accessible |
| 15 | The 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 |
| 18 | General 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
captionon a post without a caption,thumbnail_urlon anything but a video, andchildrenon anything but a carousel.
Request
Responses
- 200
The request was processed. Both a successful and a failed request answer with HTTP 200 — check status, and reason when it is FAIL.