Docs menu

Instagram profile posts

Beta GET /v1/instagram/profile/posts

GET /v1/instagram/profile/posts

A paged feed of public posts: photos, videos, carousels and reels, 12 a page. Instagram's feed query carries no counts, so rows have captions, times and media URLs and every count in stats null; require_play_counts=true adds the likes, comments and (for videos) views of every post from its embed page, which is slower. Look a profile up by handle; a numeric id has no logged-out lookup.

  • 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
handlestringone ofUsername, with or without the leading @. Also accepted as username.
idstringone ofNumeric Instagram user id. Also accepted as user_id, userId.
require_play_countsbooleannoAdd likes, comments and video views to every row (one extra page per post), and fail rather than return a video post whose play count is missing (a real 0 is fine). Default false.

Send at least one of handle, id. If you send several, the first listed is used and the rest are ignored.

Every request also accepts:

  • cursor: the cursor from the previous page (Pagination).
  • 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/posts" \
  -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/posts",
    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/posts");
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 posts",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        0,
        0
      ],
      "parameters": {
        "method": "GET",
        "url": "https://api.socialscrape.io/v1/instagram/profile/posts",
        "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_08be081d82ddded9dcc72c57",
  "data": {
    "object": "list",
    "items": [
      {
        "object": "post",
        "platform": "instagram",
        "id": "DeTUk4sDSp-",
        "url": "https://www.instagram.com/reel/DeTUk4sDSp-/",
        "type": "reel",
        "author": {
          "id": "17841401474538262",
          "handle": "nasa",
          "name": null,
          "url": "https://www.instagram.com/nasa/",
          "avatar_url": null,
          "verified": null
        },
        "title": null,
        "text": "POV: you're watching the Earth set\n\nWe just released hundreds of new images and hours of new audio from our Artemis II mission around the Moon this spring. Check out our link in bio for the Artemis II Preliminary Lunar Science Report.\n\n#NAS...",
        "published_at": "2026-10-10T05:21:53Z",
        "duration_seconds": null,
        "language": null,
        "hashtags": [
          "nasa",
          "artemisii",
          "artemis"
        ],
        "mentions": [],
        "stats": {
          "views": null,
          "likes": null,
          "comments": null,
          "shares": null,
          "saves": null,
          "dislikes": null
        },
        "media": {
          "thumbnail_url": "https://scontent-ord5-1.cdninstagram.com/v/t51.82787-15/842191580_18656578867049152_4200499629839780998_n.jpg?stp=dst-jpg_e35_s640x640_tt6&_nc_cat=111&ccb=7-5&_nc_sid=18de74&efg=eyJlZmdfdGFnIjoiQ0xJUFMuYmVzdF9pbWFnZV91cmxnZW4uQzMifQ%3D%3D&_...",
          "video_url": null,
          "audio_url": null,
          "image_urls": null,
          "width": null,
          "height": null
        },
        "song": null,
        "location": null,
        "is_pinned": null,
        "is_sponsored": null,
        "extra": {
          "accessibility_caption": "Video by NASA on October 10, 2026. May be an image of planet, eclipse and text.",
          "media_id": "4004634989362489982",
          "product_type": "clips",
          "published_from": "pk"
        }
      },
      {
        "object": "post",
        "platform": "instagram",
        "id": "DeJ28eTxo4s",
        "url": "https://www.instagram.com/p/DeJ28eTxo4s/",
        "type": "image",
        "author": {
          "id": "17841400054248583",
          "handle": "nasawebb",
          "name": null,
          "url": "https://www.instagram.com/nasawebb/",
          "avatar_url": null,
          "verified": null
        },
        "title": null,
        "text": "Brewing up new stars 🪄\n \n@NASAWebb’s unique view of the stellar nursery known as NGC 7129 reveals numerous stars formerly hidden in this cosmic cauldron. \n \nStars begin their life in cold, dense regions of dust and gas, hiding from view of...",
        "published_at": "2026-10-06T13:09:48Z",
        "duration_seconds": null,
        "language": null,
        "hashtags": [],
        "mentions": [
          "nasawebb"
        ],
        "stats": {
          "views": null,
          "likes": null,
          "comments": null,
          "shares": null,
          "saves": null,
          "dislikes": null
        },
        "media": {
          "thumbnail_url": "https://scontent-ord5-1.cdninstagram.com/v/t51.82787-15/838879752_18633093571001809_7013098794556155636_n.jpg?stp=dst-jpg_e35_s640x640_tt6&_nc_cat=109&ccb=7-5&_nc_sid=18de74&efg=eyJlZmdfdGFnIjoiRkVFRC5iZXN0X2ltYWdlX3VybGdlbi5DMyJ9&_nc_ohc=-...",
          "video_url": null,
          "audio_url": null,
          "image_urls": [
            "https://scontent-ord5-1.cdninstagram.com/v/t51.82787-15/838879752_18633093571001809_7013098794556155636_n.jpg?stp=dst-jpg_e35_s640x640_tt6&_nc_cat=109&ccb=7-5&_nc_sid=18de74&efg=eyJlZmdfdGFnIjoiRkVFRC5iZXN0X2ltYWdlX3VybGdlbi5DMyJ9&_nc_ohc=-..."
          ],
          "width": null,
          "height": null
        },
        "song": null,
        "location": null,
        "is_pinned": null,
        "is_sponsored": null,
        "extra": {
          "accessibility_caption": "Photo by NASA Webb Telescope on October 06, 2026. May be an image of text.",
          "media_id": "4001971394119634476",
          "product_type": "feed",
          "published_from": "pk"
        }
      }
    ],
    "cursor": "cAQHTcSYO1xRktCrtftb2yvKTK0sBOyPCYp_9YcUXtgxilIpq7-ZmhYDWz9C7K2aHIec0htjJWPF9_NPTtDgG7_BRdw",
    "has_more": true,
    "parent": {
      "object": "profile",
      "platform": "instagram",
      "id": "528817151",
      "handle": "nasa",
      "name": null,
      "headline": null,
      "url": "https://www.instagram.com/nasa/",
      "kind": "unknown",
      "bio": null,
      "avatar_url": null,
      "banner_url": null,
      "verified": null,
      "is_private": null,
      "external_url": null,
      "links": null,
      "location": null,
      "category": null,
      "created_at": null,
      "stats": {
        "followers": null,
        "following": null,
        "posts": null,
        "likes": null,
        "views": null
      },
      "extra": null
    }
  },
  "cursor": "cAQHTcSYO1xRktCrtftb2yvKTK0sBOyPCYp_9YcUXtgxilIpq7-ZmhYDWz9C7K2aHIec0htjJWPF9_NPTtDgG7_BRdw",
  "has_more": true
}

Response#

A list of Post objects in data.items, with data.cursor and data.has_more.

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.

Example error:

{
  "ok": false,
  "error": {
    "code": "not_found",
    "message": "The platform says this profile, post or item does not exist.",
    "retryable": false
  },
  "credits_charged": 0,
  "request_id": "req_a36fd18615c9b7b3dfb4f048"
}

Also served at#

These paths answer the same request, so code written for other APIs keeps working: /v2/instagram/user/posts. See Switching from ScrapeCreators.