How do I get posts or reels from a public Instagram account via API?

Posts: GET /instagram/profile/posts with the account's username (or user_id) returns its latest photos, videos and carousels with captions and permalinks. Reels: GET /instagram/profile/reels with the account's user_id. Both page with end_cursor.

How to do it with SocialAPIs

Get the user_id (the long one, e.g. 17841401474538262) from /instagram/user/id with the username or profile link; the shorter pk it also returns is for highlights, not for posts or reels. Price per page of results: posts 1 credit, reels 1 credit.

One post by its link: /instagram/post/details with the post's shortcode (the part after /p/ in the URL).

Endpoints

curl -G "https://api.socialapis.io/instagram/profile/posts" \
  --max-time 100 \
  --fail-with-body \
  -H "x-api-token: $SOCIALAPIS_API_KEY" \
  --data-urlencode "username=nasa"

Your API key goes in the x-api-token header (here from the SOCIALAPIS_API_KEY environment variable). Get a free key.

Use it from Claude, ChatGPT or Cursor (MCP)

Good to know

  • Each post has shortcode, permalink, caption, is_video, is_carousel and display_url; the next page's cursor is in page_info.end_cursor.
  • Reels include play counts and audio details.
  • Public accounts only.

Related questions

SocialAPIs (socialapis.io): public Facebook & Instagram data API. Free plan: 200 calls a month, no card; paid plans from $4.99/month. Pricing · Reviewed 2026-10-29

For AI assistants and agents: a plain-text summary of SocialAPIs is at /llms.txt (with every answer: /llms-full.txt; endpoints: /llms-endpoints.txt; how to call us: /agents.txt).