Tutorial ยท Python
How to scrape Instagram profiles with Python (2026)
A Python walkthrough for GET /v2/instagram/profiles/{profile}. Copy the snippet, run it, then read the JSON.
GET /v2/instagram/profiles/{profile} ยท 1 credit
In this tutorial
You'll pull a public Instagram profile and see the fields you get back.
Typical job: filling in a CRM. Check that each public handle exists, store its follower counts (data.profile.metrics) and verification, then fetch posts (/profiles/{profile}/media) only for the accounts you still care about. Check lookupStatus: private and not_found are normal answers, not errors.
Step 1
Get ready
Create a Social Fetch API key and get Python ready. New accounts include 100 free credits.

API key. Create a Social Fetch account, open API Keys and create a key. New accounts include 100 free credits.
Python setup. Python 3 with requests installed (pip install requests). Set SOCIALFETCH_API_KEY to your key.
When you're done, SOCIALFETCH_API_KEY is set in your shell.
Step 2
Make the request
Copy the Python sample and run it. It calls GET /v2/instagram/profiles/{profile} with your key in the x-api-key header, using this example: /v2/instagram/profiles/natgeo.
It prints the response as a Python dict with data and meta. An error status stops the script at raise_for_status() instead.
Step 3
Read the response
The response is JSON with two parts: data holds the profiles and meta holds creditsCharged and requestId. The sample below is a trimmed copy of a real response; the endpoint page lists every field. Credits are charged on completed lookups, not on failed requests.

Check data.lookupStatus first when the response has one. Keep meta.requestId in case a row looks wrong.
Watch out
this returns the profile only; posts and reels are separate calls, or add include=recentMedia for 1 more credit. private and not_found mean different things. The route takes a handle or a numeric user id.
Step 4
You finished
The Playground, the docs and your code all call the same endpoint at the same price. Pick a next step below.
FAQ
Common questions
Do I need an official Instagram developer account?
No. Social Fetch authenticates with your Social Fetch API key. You call GET /v2/instagram/profiles/{profile} and we handle the lookup. You still need to follow each platform's terms for how you use public data.
What does the Instagram profiles endpoint return?
JSON with two parts: data holds the profiles and meta holds creditsCharged and requestId. The endpoint page and the API docs describe every field.
Does the Instagram profile endpoint return posts or reels?
Not by default. For recent posts use GET /v2/instagram/profiles/{profile}/media, or add include=recentMedia to the profile call for 1 more credit. For reels use the media route with tab=reels.
What is the difference between private and not_found on Instagram profiles?
not_found means no account has that handle. private means the account is private, so you only get what Instagram shows publicly; don't treat it as a full profile. Check lookupStatus before you write CRM rows.
How much does a successful request cost?
1 credit. +1 credit for recentMedia. +1 credit for about. Max 3 credits. You're only charged for what's returned.
Is this okay for production?
Yes. It's the same API the Playground and the docs use: typed errors, a requestId on every response, and credits charged only on completed lookups. New accounts get 100 free credits.
Any Python-specific tips for this request?
Yes. Call response.raise_for_status() before response.json(), set a timeout on requests.get, and keep response.json()["meta"]["requestId"] when a row looks wrong.
Related