Get Instagram User Posts by Username or ID

View all Instagram Data API endpoints →

Fetch the recent post feed of a public Instagram account. Pass username_or_id; leave pagination_token empty on the first request and pass the returned top-level pagination_token to continue. The live-verified response contains data.count, data.items[] and a data.user summary of the author (id, username, full_name, is_verified, is_private, profile_pic_url). Each item exposes id, code (the shortcode), taken_at (Unix seconds), caption.text with extracted hashtags and mentions, media_type (1=photo, 2=video, 8=carousel), like_count, comment_count, play_count on videos, plus image_versions2 / video_versions media URLs and carousel_media for albums. A call for instagram returned 12 recent posts, all owned by the account, with current timestamps. Treat page size as observed behavior rather than a contract, and deduplicate by media id when merging pages.

API Features

Complete post records Items include media id, shortcode, Unix timestamp, caption text, media type and engagement counts.
Author summary included data.user confirms the owning account so items cannot be misattributed in mixed pipelines.
Token pagination Continue with the top-level pagination_token until none is returned; deduplicate by media id.
Media URLs per item Image, video and carousel renditions arrive in image_versions2, video_versions and carousel_media.

Live API Demo

GET /api/project/instagram/user-posts

API Response (JSON)

{}
curl -X GET 'https://api.opendata-api.com/api/project/instagram/user-posts?key=<API_KEY>&username_or_id=instagram'
📢
Need Help?
If you encounter API issues or need other API requirements, please contact us.
Contact Us

Use Cases

Frequently asked questions

How do I fetch an Instagram user's posts in Python and page through them?

Pass only username_or_id on the first request, then send back the top-level pagination_token from each response unchanged until the response no longer returns a token. A simple requests loop is enough — dedupe by media id.

How do I deduplicate when Instagram post pagination returns repeats?

Deduplicate on each post's numeric media id. Overlap between adjacent collection windows is expected, so do not judge duplicates by timestamp or caption text.

Related operations

Guides

View Subscription Plans →