Posts
A post by id or shortcode, its comments and its likers. Page every list until has_more is false; for a complete comment export use sort=recent, since the default sort=relevant is a ranked subset.
/posts/{id} accepts either the numeric media pk or the shortcode.
The two are interconvertible, so there is no separate by-code or by-URL
endpoint — pull the code out of an instagram.com/p/<code>/ URL and pass it
straight in.
GET /posts/2168384974851429640 # pk
GET /posts/B4XpqViUFUI # shortcode — same postThe post
One call returns the whole object, which is more than it looks. Instagram packs into it what other providers split across extra endpoints:
| Looking for | It is already in /posts/{id} |
|---|---|
| Media file URLs | image_versions2, video_versions |
| Carousel children | carousel_media |
| Reel audio / music | clips_metadata |
| Tagged accounts (photos) | usertags |
| Collaborators | coauthor_producers |
| Like and comment counts | like_count, comment_count |
| Location | location |
So there is no download, clips-metadata, usertags or comment-count endpoint: fetching the post gives you all of it for one call.
On video posts, usertags comes back empty — Instagram does not populate
it for clips. Collaborators still surface in coauthor_producers, and caption
mentions are in the caption text. If you need a clean tagged-users list for
videos, tell us.
Path Parameters
curl -X GET "https://example.com/posts/string"{
"status": "success",
"data": {}
}{}What comes back in data
Instagram's media object, roughly 240 top-level fields. Abridged:
{
"pk": "2168384974851429640",
"id": "2168384974851429640_25025320",
"code": "B4XpqViUFUI",
"taken_at": 1699999999,
"media_type": 8,
"product_type": "carousel_container",
"caption": { "text": "A caption", "created_at": 1699999999,
"user": { "pk": "25025320", "username": "instagram" } },
"like_count": 120345,
"comment_count": 892,
"play_count": null,
"user": { "pk": "25025320", "username": "instagram", "is_verified": true },
"image_versions2": { "candidates": [{ "width": 1080, "height": 1350, "url": "..." }] },
"video_versions": [],
"carousel_media": [{ "pk": "...", "media_type": 1, "image_versions2": {} }],
"usertags": { "in": [] },
"coauthor_producers": [],
"location": { "pk": "213385402", "name": "New York, New York", "lat": 40.7, "lng": -74.0 },
"clips_metadata": null
}| Field | Note |
|---|---|
media_type | 1 photo, 2 video, 8 carousel. |
product_type | feed, clips (a reel), or carousel_container. |
caption | An object, not a string. The text is caption.text, and it is null for an uncaptioned post. |
image_versions2.candidates | Sized variants, largest first. |
video_versions | Present on videos and reels; empty on photos. |
carousel_media | Child items, each with its own versions. Only on carousels. |
clips_metadata | Reel audio and music. null unless product_type is clips. |
URLs in image_versions2 and video_versions are signed and expire within
hours. Download promptly rather than storing the URL.
Counts
GET /posts/counts?ids=2168384974851429640,2168384974851429641Comment, like and play counts for up to 20 posts in one call — one billed
request. Ids are comma-separated and may be shortcodes, bare pks or composite
<pk>_<owner> pks. This is basic info only; fetch /posts/{id}
for the full media object.
Query Parameters
Up to 20 post ids (shortcode, bare or composite pk), comma-separated
curl -X GET "https://example.com/posts/counts?ids=string"{
"status": "success",
"data": {}
}{}What comes back in data
{
"items": [
{
"pk": "2168384974851429640",
"id": "2168384974851429640_25025320",
"code": "B4XpqViUFUI",
"media_type": 1,
"taken_at": 1699999999,
"comment_count": 42,
"like_count": 1200,
"play_count": null
}
]
}play_count is null on photos. More than 20 ids returns
invalid_parameter.
Comments
Pass only the post id (shortcode, bare or composite pk):
GET /posts/2168384974851429640/commentsA deleted or unavailable post returns
not_found here — the same 404 as
/posts/{id}, not a billed empty page.
This endpoint keeps Instagram's own comment-stream shape rather than the standard list shape, because its paging token is structural to the response:
{
"comments": [],
"has_more": true,
"next_min_id": "...",
"media_pk": "2168384974851429640_25025320",
"...": "..."
}Page by passing next_min_id back as min_id, and stop only when has_more
is false — never on a short page. A 404 comes only from the first page; a
later page Instagram fails to serve is retried for you and, if it still fails,
answered with a retryable 503 upstream_unavailable. Instagram sometimes returns a page of a few
comments mid-walk, and a client that stops there misses the rest. Treat
next_min_id as opaque — pass back exactly what you were given.
Order the comments with sort: relevant (Instagram's default ranking,
"For you"), recent (chronological, newest first), or meta_verified. The
first request (the one without min_id) picks the order, and the cursor carries
it for the rest of the walk. Sending sort again on later requests is harmless —
the cursor's order wins, so a walk cannot switch order midway.
For a complete top-level export use sort=recent — it pages chronologically
(newest first) with no repeats. The default sort=relevant is Instagram's
ranked view: a bounded subset that can serve the same comment on more than one
page, so dedupe by pk if you walk it. If a page brings only comments the walk
has already returned, the walk ends there with has_more: false. An empty
last page is retried on other sessions before the walk ends. Either way
the declared comment_count
is inflated — it counts deleted, hidden and spam-filtered comments Instagram now
serves to no one — so expect only ~20–25% of it to be retrievable (the same
ceiling every provider hits). comment_count also counts replies, which come
from /comments/{id}/replies.
Instagram's own has_more_comments appears in this response and does not
mean what it says: it tracks the inline preview strip, so it reads false on a
post with thousands of comments. Branch on has_more above.
Replies are not included here — fetch them per comment through
/comments/{id}/replies, which now walks the full reply thread
rather than the short inline preview (minus any replies Instagram filters out).
For a carousel, carousel_media_id and carousel_index scope comments to one
child.
Path Parameters
Query Parameters
next_min_id from the previous page
Walk toward older comments
Comment order: relevant (default ranked), recent (chronological, newest first), or meta_verified. Fixed for the walk — the cursor carries it.
0curl -X GET "https://example.com/posts/string/comments"{
"status": "success",
"data": {}
}{}What comes back in data
{
"comments": [
{
"pk": "18012345678901234",
"text": "Great shot",
"created_at": 1699999999,
"comment_like_count": 12,
"child_comment_count": 2,
"is_liked_by_media_owner": false,
"user_id": "51065942432",
"user": { "pk": "51065942432", "username": "example" }
}
],
"next_min_id": "eyJzZXJ2ZXJfY3Vyc29yIjo...",
"media_pk": "2168384974851429640_25025320",
"has_more": true,
"has_more_comments": true
}child_comment_count is how many replies a comment has — fetch the full thread
with /comments/{pk}/replies, passing the post id as
media_id. Instagram omits deleted and hidden replies, so the thread can come
back shorter than child_comment_count.
Likers
Keyed by the post id alone, like comments.
GET /posts/2168384974851429640/likersThe ranked likers Instagram surfaces for a post — a single page of ~100,
has_more always false. For the complete list, use
/posts/{id}/likers/all.
Path Parameters
curl -X GET "https://example.com/posts/string/likers"{
"status": "success",
"data": {}
}{}What comes back in data
The standard list shape, with compact user objects identical to followers.
All likers
GET /posts/2168384974851429640/likers/allEvery account that liked the post — the full chronological list in a single call, not the ranked ~100 above. Returns up to ~1,000–2,000: Instagram sets the ceiling itself on very high-engagement posts (there is no cursor to page past it), and below that ceiling the list is complete. Same flat price as any other call.
Path Parameters
curl -X GET "https://example.com/posts/string/likers/all"{
"status": "success",
"data": {}
}{}What comes back in data
The same list shape as likers above — compact user objects — just many more of them.
Insights
GET /posts/3752130627736173135/insightsA post's insight object: its like and comment counts, media type, creation
time, and ad_media for a post that has run as a boosted ad. Accepts the same
ids as the post.
Path Parameters
curl -X GET "https://example.com/posts/string/insights"{
"status": "success",
"data": {}
}{}What comes back in data
| Field | Meaning |
|---|---|
instagram_media_id | The post's media pk. |
organic_instagram_media_id | The pk of the organic post. |
instagram_media_type | The media type, such as CAROUSEL_V2. |
creation_time | Unix seconds. |
like_count, comment_count | The post's counts. like_count can be null. |
ad_media | Set when the post has run as a boosted ad, null otherwise. |
display_url, image | Preview image URL and its size. |
save_count, inline_insights_node and the shopping click counts are visible
only to the post's owner, so they are always null.
Errors
| Code | When |
|---|---|
not_found | Deleted, or no such pk or shortcode. |
private_account | The owner is private. |
invalid_parameter | The id is neither a valid pk nor a valid shortcode. |
unprocessable_entity | A query parameter has the wrong type, such as a non-integer carousel_index. |
upstream_error | Transient. Retry. |