Docs menu

Instagram story highlights

Beta GET /v1/instagram/profile/highlights

GET /v1/instagram/profile/highlights

The profile's highlight albums: id, title, cover and owner. 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.

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/highlights" \
  -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/highlights",
    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/highlights");
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 story highlights",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        0,
        0
      ],
      "parameters": {
        "method": "GET",
        "url": "https://api.socialscrape.io/v1/instagram/profile/highlights",
        "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_ac815d6b509220e2077170db",
  "data": {
    "object": "list",
    "items": [
      {
        "object": "collection",
        "platform": "instagram",
        "id": "18195781759377100",
        "url": "https://www.instagram.com/stories/highlights/18195781759377100/",
        "kind": "highlight",
        "title": "Roman",
        "description": null,
        "owner": {
          "id": "528817151",
          "handle": "nasa",
          "name": "NASA",
          "url": "https://www.instagram.com/nasa/",
          "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...",
          "verified": true
        },
        "item_count": null,
        "cover_url": "https://scontent-ord5-2.cdninstagram.com/v/t51.71878-15/785745361_1537318174532484_931463605431094788_n.jpg?stp=dst-jpg_s150x150_tt6&_nc_cat=110&ccb=7-5&_nc_sid=acbce5&_nc_ohc=PCbozJYubZ8Q7kNvwHBts6v&_nc_oc=Adq5fnBwqBGqFIJrXGiw7QY2WVkeTUl_i...",
        "updated_at": null,
        "extra": null
      },
      {
        "object": "collection",
        "platform": "instagram",
        "id": "18123023338592759",
        "url": "https://www.instagram.com/stories/highlights/18123023338592759/",
        "kind": "highlight",
        "title": "Wallpapers",
        "description": null,
        "owner": {
          "id": "528817151",
          "handle": "nasa",
          "name": "NASA",
          "url": "https://www.instagram.com/nasa/",
          "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...",
          "verified": true
        },
        "item_count": null,
        "cover_url": "https://scontent-ord5-2.cdninstagram.com/v/t51.71878-15/658392542_1443405937523344_3996096698761393443_n.jpg?stp=dst-jpg_s150x150_tt6&_nc_cat=102&ccb=7-5&_nc_sid=acbce5&_nc_ohc=CEj2IGrdBRsQ7kNvwHJUIyY&_nc_oc=AdqCmoGMLcAK2M9yrSLtdRVW5TJzpy1S...",
        "updated_at": null,
        "extra": null
      }
    ],
    "cursor": null,
    "has_more": false,
    "parent": {
      "object": "profile",
      "platform": "instagram",
      "id": "528817151",
      "handle": "nasa",
      "name": "NASA",
      "headline": null,
      "url": "https://www.instagram.com/nasa/",
      "kind": "unknown",
      "bio": null,
      "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": null,
      "links": null,
      "location": null,
      "category": null,
      "created_at": null,
      "stats": {
        "followers": null,
        "following": null,
        "posts": null,
        "likes": null,
        "views": null
      },
      "extra": null
    }
  },
  "cursor": null,
  "has_more": false
}

Response#

A list of Collection 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.

Also served at#

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