Instagram profile post count API
The profile with stats.posts filled in, for when profile returns it null.
- Cost
- 1 credit
- Cached repeats
- 0 creditssend max_age_days, results kept 30 days
- Failed requests
- 0 credits
- Status
- Betashape may still gain fields
Read from the profile's embed page, which carries the exact count even above 10,000 posts (extra.is_estimated false); only if that page is unavailable does it fall back to the profile page, which abbreviates.
You send handle.
Request
Send your key in the x-api-key header.
curl -G "https://api.socialscrape.io/v1/instagram/profile/post-count" \
-H "x-api-key: $SOCIALSCRAPE_API_KEY" \
--data-urlencode 'handle=nasa'import os
import requests
params = {
"handle": "nasa",
}
res = requests.get(
"https://api.socialscrape.io/v1/instagram/profile/post-count",
headers={"x-api-key": os.environ["SOCIALSCRAPE_API_KEY"]},
params=params,
timeout=60,
)
body = res.json()
if body["ok"]:
print(body["data"])
else:
print(body["error"]["code"], body["error"]["message"])const url = new URL("https://api.socialscrape.io/v1/instagram/profile/post-count");
url.search = new URLSearchParams({
handle: "nasa",
}).toString();
const res = await fetch(url, {
headers: { "x-api-key": process.env.SOCIALSCRAPE_API_KEY! },
});
const body = await res.json();
if (body.ok) {
console.log(body.data);
} else {
console.error(body.error.code, body.error.message);
}{
"nodes": [
{
"name": "SocialScrape Instagram profile post count",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
0,
0
],
"parameters": {
"method": "GET",
"url": "https://api.socialscrape.io/v1/instagram/profile/post-count",
"sendQuery": true,
"queryParameters": {
"parameters": [
{
"name": "handle",
"value": "nasa"
}
]
},
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "x-api-key",
"value": "={{ $env.SOCIALSCRAPE_API_KEY }}"
}
]
}
}
}
],
"connections": {}
}Parameters
| Name | Type | Required | Description |
|---|---|---|---|
handle | string | yes | Username, with or without the leading @. Also accepted as username. |
allow_estimated | boolean | Return a scaled estimate when Instagram abbreviates the count (profiles over 10,000 posts). Without it such a profile answers an unbilled error. |
Every request also accepts trim, raw and max_age_days.
Response
Sample from a recorded response, shortened. Values are public data, not yours.
{
"ok": true,
"credits_charged": 1,
"credits_remaining": 4999,
"cached": false,
"cached_at": null,
"request_id": "req_502ede6e6db1859cc1019de0",
"data": {
"object": "profile",
"platform": "instagram",
"id": "528817151",
"handle": "nasa",
"name": "NASA",
"headline": null,
"url": "https://www.instagram.com/nasa/",
"kind": "unknown",
"bio": "Making the seemingly impossible, possible. ✨",
"avatar_url": "https://scontent-ord5-2.cdninstagram.com/v/t51.2885-19/29090066_159271188110124_1152068159029641216_n.jpg?stp=dst-jpg_s150x150_tt6&_nc_cat=1&ccb=7-5&_nc_sid=...",
"banner_url": null,
"verified": true,
"is_private": false,
"external_url": "https://www.nasa.gov",
"links": [
{
"title": "NASA.gov Homepage",
"url": "https://www.nasa.gov"
},
{
"title": "MAX POWER",
"url": "https://www.nasa.gov/maxpower"
},
{
"title": "Roman Space Telescope Blog",
"url": "https://science.nasa.gov/blogs/roman/"
}
],
"location": null,
"category": null,
"created_at": null,
"stats": {
"followers": 104360745,
"following": 90,
"posts": 4984,
"likes": null,
"views": null
},
"extra": {
"has_reels": true,
"is_estimated": false,
"is_memorialized": false,
"is_unpublished": false,
"latest_story_at": "2026-10-29T20:36:47Z",
"post_count_source": "embed"
}
},
"cursor": null,
"has_more": null
}Fields
One Profile in data.
A field the platform does not give is null, never made up. Extra platform details are in extra.
| Field | Type | Always | Notes |
|---|---|---|---|
object | "profile" | ||
platform | Platform | yes | |
id | string or null | ||
handle | string or null | ||
name | string or null | ||
headline | string or null | a short tagline apart from the bio (LinkedIn's headline) | |
url | string or null | ||
kind | "person" or "creator" or "channel" or "page" or "company" or "artist" or "organization" or "shop" or "unknown" | ||
bio | string or null | ||
avatar_url | string or null | ||
banner_url | string or null | ||
verified | boolean or null | ||
is_private | boolean or null | ||
external_url | string or null |
Show the other 6 fields
| Field | Type | Always | Notes |
|---|---|---|---|
links | Link[] or null | ||
location | string or null | ||
category | string or null | ||
created_at | string (ISO 8601 date-time) or null | ||
stats | ProfileStats | ||
extra | object or null |
Full field list in the reference for this endpoint and the data models. Errors are listed under Errors.
Questions
Which errors can it return?
invalid_params (do not retry), not_found (do not retry). Account and platform errors from the errors list can also happen. A failure always costs 0 credits.
Is there an SDK call for it?
The preview Python client has client.instagram.profile_post_count(...) and the TypeScript client client.instagram.profilePostCount(). Both return the same envelope as the HTTP API. The packages are not published yet; plain HTTP works today in any language.
Can an AI agent call it?
Yes. The MCP server reaches every built endpoint, with the same prices.