Docs menu

Instagram profile post count

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

GET /v1/instagram/profile/post-count

The profile with stats.posts filled in, for when profile returns it null. 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.

  • Cost: 1 credit
  • Status: Beta. Built and tested against recorded responses; the shape may still gain fields.
  • Cache: Results are kept up to 30 days; send max_age_days to reuse them for free.
  • Timeout: A request still running after about 25 seconds answers 202 with a job to poll (Batch and jobs).

Parameters#

NameTypeRequiredDescription
handlestringyesUsername, with or without the leading @. Also accepted as username.
allow_estimatedbooleannoReturn a scaled estimate when Instagram abbreviates the count (profiles over 10,000 posts). Without it such a profile answers an unbilled error. Default false.

Every request also accepts:

  • trim: true for a smaller response without null fields and extra.
  • raw: true to also get the platform's original object as raw.
  • max_age_days: accept a cached result up to this many days old, for 0 credits (Caching).

Example request#

Set your key in the environment first (see Authentication).

curl
curl -G "https://api.socialscrape.io/v1/instagram/profile/post-count" \
  -H "x-api-key: $SOCIALSCRAPE_API_KEY" \
  --data-urlencode "handle=nasa"
Python
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,
)
body = res.json()

if body["ok"]:
    print(body["data"])
else:
    print(body["error"]["code"], body["error"]["message"])
TypeScript
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);
}
n8n
{
  "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": {}
}

Example response#

This is a sample from a recorded response, lists and long text are shortened. Status 200.

{
  "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=f7ccc5&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLnd3dy4xMDgwLkMzIn0%3D&_nc_ohc=Ca3wE...",
    "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",
      "relay_id": "17841401474538262"
    }
  },
  "cursor": null,
  "has_more": null
}

Response#

A Profile object in data.

See Data models for every field. The envelope around data is described in Responses.

Errors#

Failures are free: credits_charged is 0. Branch on error.code, never on the message.

CodeHTTPRetryMeaning
invalid_params400noA parameter is missing, unknown or has the wrong type.
not_found404noThe platform says this profile, post or item does not exist.

Every request can also fail with the account and platform errors listed on the Errors page.