Use Social Fetch to collect public Instagram profile counts and posts, then add comments or a video's spoken text when your report needs them. This tutorial uses National Geographic's public brand account and a Duolingo Reel. You will save a small JSON dataset rather than download an account's entire history.
You need a Social Fetch account, credits and an API key. The code examples need Node.js 20 or later. You do not need to sign in to Instagram. An API key authenticates your request to Social Fetch; it does not grant access to private Instagram content.
Four ways to scrape Instagram data
There are four realistic ways to get public Instagram data out of Instagram. Pick by how much data you need and how much upkeep you can take on.
| Method | Good for | Catch |
|---|---|---|
| Instagram's official API | Your own Business or Creator accounts | Needs a Meta app and account authorisation. It doesn't look up arbitrary public profiles, their posts or their comments. |
| A DIY scraper (Python, browser automation or Instagram's internal GraphQL endpoints) | Learning, or very small one-off jobs | Login walls, rate limits and blocks. The GraphQL doc_id values and response shapes change without notice, so the scraper needs regular fixes. |
| A scraper API (this guide) | Datasets, monitoring and apps | Costs credits per request. You don't run browsers, proxies or accounts. |
| Free no-code tools | Checking one profile or Reel | One lookup at a time, no export of whole lists. |
For a single lookup you don't need code: the free Instagram profile viewer shows a public profile and its recent posts, the Instagram Reel transcript tool turns a Reel into text, and the engagement rate calculator scores an account. The comparison with Meta's API is covered in more depth in Instagram Graph API vs Social Fetch.
The rest of this guide uses the Instagram scraper API route: the same lookups as a DIY scraper, without maintaining one.
Try a profile in the Playground
- Open the Playground.
- Under Instagram, choose Profile (
/v2/instagram/profiles/{profile}). - In profile, enter
natgeo. The include options should remain unchecked for this basic lookup. - Click Send.
- Open Response and check
data.lookupStatusbefore reading the profile.

For a found profile, counts are in data.profile.metrics.followers, following and posts. Public details can include a bio, category and profile URL. Fields that are not reported remain null.
A private profile can return lookupStatus: "private" with some public profile details. It does not expose private posts. For not_found, data.profile is null. Always check both the status and the object before reading nested fields.
Make your first API request
- Open API Keys, enter a name and click Create key. Store the secret safely when Save your API key appears; do not put it in source control.
- Set an environment variable in your terminal. In Bash:
In PowerShell:
- In Bash, send the same profile request with curl:
The response has data and meta. meta.creditsCharged is the actual charge, and meta.requestId identifies this lookup when you contact support. See the Quickstart for more setup options.
These examples use v2 throughout. Older v1 examples have different routes and response paths: for example, v1 profile metrics are data.metrics, while v2 uses data.profile.metrics. Do not mix them.
Save two pages of posts
A profile's media list is a separate request. tab=posts is the default; use tab=reels for Reels or tab=tagged for posts that tag the account.
- In the Playground, choose Profile media.
- Set profile to
natgeo. The tab value should beposts. - Click Send.
- In Response, find
data.page. - If
hasMoreistrue, copynextCursorinto cursor. - Click Send to get the next page. Keep the profile and tab the same.

For a repeatable export, install the SDK:
Save the following as instagram-posts.mjs. The .mjs extension makes it an ES module, so Node can run its imports and top-level await without a package setting. The script deliberately stops after two pages to keep spending bounded.
Run it in the same terminal where you set the key:
A cursor is an opaque continuation token: do not edit, decode or manufacture it. Stop when hasMore is false or nextCursor is null. Do not use the profile's post count as a loop limit. A changing public feed is not a fixed historical archive, so store post IDs and deduplicate when combining exports.
Read comments and transcripts
Comments and transcripts are separate datasets. Fetch them only for posts you need to analyse.
For top-level comments on a post from the saved National Geographic response:
Read data.comments. Each comment has an id, text, nullable author, likeCount and replyCount. The real example returned a page of 15 top-level comments. It did not return every comment. Follow data.page.nextCursor as cursor with the same media and sort; newest is the other sort option. Fetch replies separately using a returned comment ID and the replies endpoint.
An empty comments array can mean no comments, comments switched off or the end of the list. lookupStatus: "not_found" also covers deleted or private media, so it does not prove the post never existed.
For spoken text, this public Duolingo Reel has a real transcript example:
Read data.transcript.text. The saved response begins "You can now learn chess on Duolingo." It reports durationSec: 21.354, with language and segments both null. Do not assume language metadata or word timings are present. This is spoken text, not a promise to extract all text visible on screen.
A transcribed video with no speech can have lookupStatus: "found" and transcript.text: null. Private, missing or non-video media returns not_found and transcript: null. See the transcript reference.
Choose dataset fields

Keep the post ID, URL, publication time, format, caption and counts needed for your report. Save the lookup time and request ID alongside them so you know when the snapshot was taken. Preserve null values: a missing save count is not zero saves, and a hidden like count is not zero engagement.
Profile follower counts describe the account's audience size. They do not identify followers or provide their ages, gender, location, interests or income. Do not invent those metrics from a profile or comment list. Handle commenter identities and text with care when sharing exports.
For a single post's full details, use Get Instagram media and read data.media. Image and video URLs can expire. Request hosted files only when you need them and check their expiresAt values.
Costs and unavailable data
A basic profile lookup or profile media page costs 1 credit per completed request, including unavailable outcomes; a comments page costs 3 credits. The two-page SDK example therefore costs up to 2 credits. Check meta.creditsCharged rather than assuming all requests cost the same.
Profile extras include=recentMedia and include=about each add 1 credit when served. They are null when not requested or unavailable; unavailable extras are not charged.
The transcript request shown costs 5 credits and includes AI transcription of videos up to two minutes. Opting into allowLongTranscription=true changes pricing even for short clips: add 10 credits per started minute of transcribed video, billed up to 60 minutes, plus the base 5 credits. Leave that option off for this example.
Media detail costs 1 credit without hosted files. include=files adds 10 credits per started 16 MB actually hosted, capped at 60 extra credits per request. It is not a fixed 11-credit request. See Credits for preflight requirements and failures.

Common questions
Do I need an Instagram account?
These examples use a Social Fetch key and publicly available data. They do not require Instagram sign-in or account authorisation. They cannot unlock private posts, direct messages or account-owner insights.
Why is the response empty?
Check lookupStatus first, then the nullable object or list and page.hasMore. A successful HTTP request can describe unavailable content. If a found object has null fields, that view did not report them. Do not silently fill them with guesses.
What if a request fails?
bad_request means you should check the parameter names and values against the API reference. V1 query parameters do not necessarily exist in v2. For temporarily_unavailable, follow Retry-After when present and keep retries bounded. See Errors; send the request ID when you contact support.
Should I build a browser scraper instead?
A browser workflow also needs to deal with sign-in walls, changing page structure and unavailable content. See Social Fetch vs DIY scraping for the maintenance trade-offs. This guide teaches the Social Fetch API workflow; check the terms and permissions that apply to your own use of collected data.