Getting an Instagram account's posts through the API
GET /<IG_ID>/media returns an Instagram professional account's posts as IG Media objects, up to its 10,000 most recently created. Ask for fields such as id, media_type, media_url, permalink, thumbnail_url and timestamp, and read a carousel's items through children. Responses carry before and after cursors for paging, and since and until limit them by date. With Instagram Login the call goes to graph.instagram.com.
easyCoexistence lists a connected Instagram account's posts with list_social_posts, 1 to 100 at a time, from Claude, ChatGPT or your own code, through Meta's official API with the token added.
Most recently created media the media edge returns at most, per Meta's IG User Media reference.
The media edge's time-based pagination parameters, taking Unix timestamps or strtotime values.
Where Stories are read: the media edge does not return Story media.
The media type that returns thumbnail_url, the URL of the media's thumbnail image.
How Meta says to treat media_url, which it omits for some video; fall back to permalink or thumbnail_url.
How do you get an account's posts?
With a GET on the account's media edge, naming the fields to return; without fields, Meta's sample returns only each post's id. With Instagram Login the request goes to graph.instagram.com with an Instagram User access token that holds instagram_business_basic, and the response lists the posts in data, with a paging object for the next page.
GET https://graph.instagram.com/<IG_ID>/media
?fields=id,media_type,media_url,permalink,thumbnail_url,timestamp
&limit=25
&access_token=<ACCESS_TOKEN>
{
"data": [
{
"id": "<IG_MEDIA_ID>",
"media_type": "IMAGE",
"media_url": "<CDN_URL>",
"permalink": "https://www.instagram.com/p/<SHORTCODE>/",
"timestamp": "2026-10-30T14:02:11+0000"
}
],
"paging": {
"cursors": { "before": "<CURSOR>", "after": "<CURSOR>" },
"next": "<NEXT_PAGE_URL>"
}
}Which fields can each post return?
Those of the IG Media object, listed in Meta's reference; ask only for the ones you use. Two rows in that reference, caption and media_product_type, end with the note Available for Instagram API with Facebook Login only, so check them against your setup before relying on them:
How does paging work?
With cursors. The paging object carries before and after cursors and, while more results remain, a next URL; Meta's Graph API guide says to stop when next no longer appears, since a page can hold fewer items than limit asks for. The media edge also pages by time: since and until take Unix timestamps or strtotime values and keep the results to that range.
How do you read a carousel's photos and videos?
Through the children edge. A post whose media_type is CAROUSEL_ALBUM lists its items with GET /<IG_MEDIA_ID>/children, using the same token and permission as the media edge, and each item is an IG Media object with its own id, media_type and media_url. Meta notes that some fields, permalink among them, cannot be used on the photos inside an album.
GET https://graph.instagram.com/<IG_MEDIA_ID>/children
?fields=id,media_type,media_url
&access_token=<ACCESS_TOKEN>Why is media_url missing on some posts?
Meta leaves it out of video media that contains copyrighted or licensed audio, including tracks from Instagram's audio library, and of media flagged for a copyright violation, on the account's own posts as well. Its reference says to treat media_url as optional and fall back to permalink or thumbnail_url. A Live video can be read only while it is being broadcast.
How do you show the posts on a website?
From your server, with the account's long-lived token, which lasts 60 days and has to be refreshed before it expires. Link each tile to its permalink, and refresh the list on a schedule: Meta serves media through privacy-aware CDN URLs that stop returning a file once the content has been deleted or has expired. To show a post as Instagram draws it, pass its permalink to the oEmbed endpoint instead.
How do you list posts through easyCoexistence?
With list_social_posts, which takes the account_id and a limit from 1 to 100, 25 by default, and returns the account's recent posts with their IDs, media types, media URLs, thumbnails, permalinks, timestamps and like and comment counts. It reads the most recent posts, up to 100, and has no cursor for further pages or other fields.
Common mistakes
- Looking for Stories in the media edge. Meta leaves them out; GET /<IG_ID>/stories returns them during the 24 hours they last.
- Building a feed on media_url alone. Meta omits it for some videos, so keep permalink or thumbnail_url as the fallback.
- Requesting permalink on carousel items. Meta does not return it for photos inside an album, so link to the parent post.
- Treating a short page as the last one. A page can hold fewer items than limit; stop only when paging has no next.
US$ 9 to US$ 0.75 per connection per month, falling as you add connections, with the first 3 days free.
easyCoexistence is a multichannel API and MCP server that connects AI agents such as Claude and ChatGPT to WhatsApp, Instagram, TikTok, Facebook and more. On WhatsApp it uses Coexistence: the business keeps using its number in the WhatsApp Business app while the AI works through Meta's official API.
Frequently asked questions
How many posts can the Instagram API return?
Up to the 10,000 most recently created, a page at a time from the media edge. Stories come from the separate stories edge while they last.
Does the media edge include Reels?
Yes. A Reel is an IG Media object like a photo, reported with media_type VIDEO; Stories are what the media edge leaves out.
Can I get another account's posts?
Not from the media edge, which reads the account behind the token. Business Discovery returns another business or creator account's posts, with Facebook Login or Unified Login.
Why did an old media_url stop working?
Meta's CDN URLs are privacy-aware: they stop returning media once the content is deleted or has expired, so request current URLs when you need them.
Keep reading
Connect your first channel in two minutes.
No platform reviews to wait for. Connect WhatsApp, Instagram, TikTok or another channel, then ask your AI to post, reply or report, and watch it work.
- 3 days free
- Cancel any time
- Official APIs only
- Monitored 24/7
Verified on