Skip to content
scrapeatlas.Dashboard

Social networks

Instagram API

Retrieve public Instagram profiles, posts and reels feeds, single posts and reels, first-page comments, highlight albums and exact post counts as Instagram's own web client receives them, without an account.

8 endpointsx-api-key

Retrieve Instagram profiles, post counts, posts, reels, comments and story highlight albums, with optional compact records.

API availability: Coming soon

Base URL · local workerhttp://localhost:3037Public API: https://api.scrapeatlas.com.
Authenticationx-api-keyCustomer key from your account. See Authentication.

Endpoints

GET/v1/instagram/profile

Get an Instagram profile

Retrieve a public Instagram profile by handle or numeric user ID, including identity, bio, links, follower and following counts, verification, business category and profile pictures. Use trim for a compact projection.

Reference
GET/v1/instagram/basic-profile

Get an Instagram basic profile

Retrieve a public Instagram profile by numeric user ID, with the user fields at the top level.

Reference
GET/v1/instagram/profile/post-count

Get an Instagram profile post count

Read the post count displayed on an Instagram profile. Set allow_estimated=true to accept abbreviated counts scaled to numbers.

Reference
GET/v1/instagram/user/posts

List Instagram user posts

List public Instagram photos, videos, carousels and reels shared to a profile grid, with creation timestamps, canonical URLs and the profile header. Pass next_max_id for the next page; trim selects compact records.

Reference
GET/v1/instagram/user/reels

List Instagram user reels

List public Instagram reels with identifiers, play, like and comment counts, thumbnails and co-authors. Pass max_id for the next page; trim selects compact records.

Reference
GET/v1/instagram/post

Get an Instagram post or reel

Retrieve a public Instagram post or reel with media URLs, caption, author, timestamps, engagement, comments, carousel items, audio, location and co-authors. Use trim for a compact projection and include_comments to select comment enrichment.

Reference
GET/v1/instagram/post/comments

List Instagram post comments

Read a public Instagram post or reel comment page with text, authors, timestamps, like counts and reply counts.

Reference
GET/v1/instagram/user/highlights

List Instagram user highlights

List Instagram story highlight albums with identifiers, titles, cover thumbnails and owners.

Reference

Quick start

Create an API key on your account page, then call the public API. Values below are placeholders.

Terminal
curl "https://api.scrapeatlas.com/v1/instagram/profile?handle=example" \
  -H "x-api-key: YOUR_API_KEY"

Coverage & limits

  • Independent worker on port 3037, INSTAGRAM_API_KEY in x-api-key. No Instagram account, login, storage, media download or product dependency; one anonymous session per operation with a browser TLS fingerprint. The only memory kept between operations is a bounded map of handle to numeric user id (identifiers only, 15 minutes, 10,000 entries) so that repeat reads of an account skip its profile page.
  • Four concurrent operations, 45-second deadline, at most four upstream requests per operation: profile = one document (plus the page load the first time a handle is seen); basic-profile = one document; post-count = page; posts = page plus document the first time a handle is seen, otherwise the profile document, the 35 KB session probe and the posts document; reels = document (plus the page when identified by handle); post = document plus page (the document alone with include_comments=false on photos and videos); comments = page; highlights = page (plus a document when identified by user id); each with one shared transient retry for network failures or HTTP 5xx. Challenges, rate limits and 4xx answers are never retried.
  • Decoded response budget per operation (about twice the largest read observed): 1 MiB basic-profile, 2 MiB profile, post-count, comments and highlights, 3 MiB posts, reels and post; 600,000 JSON nodes, 64 levels, 50 items per page (12 per source page), 50 comments and 100 highlights.
  • Pagination is caller-carried: posts return next_max_id, reels return paging_info.max_id (top-level max_id with trim). Comments return the first page (comments_first_page_only marks further pages, also inside the single-post layout; include_comments=false leaves them out of the single post as comments_omitted); highlight albums list with their covers. Private accounts answer with empty lists and a private_account warning or restricted_page.
  • Document ids are pinned to the documents the web client uses; when Instagram retires one, the operation fails operation_unavailable instead of guessing.
  • Handles are 1–30 letters, digits, periods and underscores (leading @ accepted), user ids are numeric, post URLs are instagram.com /p/, /reel/, /reels/ or /tv/ permalinks (query strings and fragments ignored). Identity is verified against the request; mismatches fail unsupported_page.
  • Optional INSTAGRAM_PROXY_URL (falling back to TWITCH_PROXY_URL, then REDDIT_PROXY_URL) routes every operation through a fresh residential proxy session for hosts that need one.
Error codes
16
HTTPfailure.codeMeaning
400invalid_requestMissing, duplicate, malformed or unsupported parameters, handles, ids, cursors or URLs.
401unauthorizedInvalid API key.
404not_foundUnknown handle, user id or post.
403restricted_pageThe page or document is private or gated (private account, gated media, login redirect).
422count_estimated_onlyInstagram abbreviates this post count and allow_estimated was not set.
429upstream_rate_limitedInstagram rate limited the page load or the GraphQL read.
502upstream_challengedInstagram refused the request with its error shell (status challenged).
502operation_unavailableInstagram no longer serves the pinned document for this operation.
502unsafe_redirectInstagram redirected the request somewhere other than the login form.
502unsupported_pageThe page or GraphQL result is missing, mismatched or structurally unsupported.
502response_too_largeThe decoded responses exceeded the operation's byte budget (1–3 MiB).
502payload_too_complexThe response exceeded the JSON depth or node limits.
502request_limitThe upstream request budget was exhausted.
502upstream_errorNetwork failure or HTTP 5xx after the single retry.
503busyAll retrieval slots are busy.
504timeoutThe 45-second deadline elapsed.