Instagram Stories API
Returns the stories a user has live right now, each with its id, image or video URLs, thumbnail, duration, capture time, and the author.
GET /v1/instagram/storiesLast updated November 2026Maintained by the SocialCrawl team
When to use the Instagram Stories API
Use it to check an account's current story tray; an account with nothing live returns an empty list rather than an error.
From the API reference
Returns the active stories currently in a user's story tray. Each story includes its id, media URLs (image or video), thumbnail, duration, capture time, and the author. Pass either handle or user_id. Passing user_id is faster because no username lookup is needed. A public account with no active stories returns an empty list at no charge, not an error; a private account returns 404. Stories carry no public caption and no public like, comment, or view count: Instagram shows story engagement only to the account owner, and it is never fabricated here.
Searching 69 platforms in parallel
What can you do with the Stories API?
The Stories endpoint gives you structured Instagram data with computed fields in a single request. No scraping infrastructure to build or maintain.
Example Request
# GET /v1/instagram/stories: 5 credits per call. Cache hits are free and failed calls are refunded.
# Check the price first for 0 credits: add dry_run=1 to the query. Nothing is fetched or charged.
# --max-time 10: this endpoint's measured p99 latency x 1.5.
# --retry 3: retries timeouts, 429 and 5xx, honoring Retry-After.
# -o response.json keeps only the final attempt's body.
# One Idempotency-Key per request, reused on every retry, so a retried call is never charged twice.
IDEMPOTENCY_KEY=$(od -An -N16 -tx1 /dev/urandom | tr -d ' \n')
curl -sS --max-time 10 --retry 3 -o response.json \
-H "x-api-key: YOUR_API_KEY" \
-H "Idempotency-Key: $IDEMPOTENCY_KEY" \
"https://www.socialcrawl.dev/v1/instagram/stories?handle=instagram" && cat response.json# GET /v1/instagram/stories: 5 credits per call. Cache hits are free and failed calls are refunded.
# Check the price first for 0 credits: add dry_run=1 to the query. Nothing is fetched or charged.
import os
import random
import time
import uuid
import requests
API_KEY = os.environ.get("SOCIALCRAWL_API_KEY", "YOUR_API_KEY")
TIMEOUT_S = 10 # this endpoint's measured p99 latency x 1.5.
MAX_RETRIES = 3
URL = "https://www.socialcrawl.dev/v1/instagram/stories"
def backoff(attempt):
# Exponential backoff with jitter: about 1 s, 2 s, then 4 s.
return 2 ** attempt * (0.5 + random.random() / 2)
def socialcrawl(params):
# One Idempotency-Key per request, reused on every retry, so a retried call is never charged twice.
idempotency_key = str(uuid.uuid4())
for attempt in range(MAX_RETRIES + 1):
try:
res = requests.get(
URL,
params=params,
headers={"x-api-key": API_KEY, "Idempotency-Key": idempotency_key},
timeout=TIMEOUT_S,
)
body = res.json()
except (requests.RequestException, ValueError):
# A timeout, a dropped connection or a non-JSON gateway page: retry with the same key.
if attempt == MAX_RETRIES:
raise
time.sleep(backoff(attempt))
continue
if body["success"]:
return body
error = body["error"]
# Branch on error["type"], never on the message text.
if error["type"] == "RESOURCE_NOT_FOUND":
return None # refunded: nothing to read
retry_after = res.headers.get("Retry-After")
# SERVICE_UNAVAILABLE without Retry-After is a withdrawn endpoint: permanent.
permanent = error["type"] == "SERVICE_UNAVAILABLE" and retry_after is None
if not error.get("retryable") or permanent or attempt == MAX_RETRIES:
raise RuntimeError(f"{error['type']}: {error['message']} (request_id {body['request_id']})")
# Retry-After (seconds) wins; otherwise back off.
time.sleep(float(retry_after) if retry_after else backoff(attempt))
params = {
"handle": "instagram",
}
body = socialcrawl(params)
if body is not None:
print(body["data"])// GET /v1/instagram/stories: 5 credits per call. Cache hits are free and failed calls are refunded.
// Check the price first for 0 credits: add dry_run=1 to the query. Nothing is fetched or charged.
const API_KEY = process.env.SOCIALCRAWL_API_KEY ?? "YOUR_API_KEY";
const TIMEOUT_MS = 10_000; // this endpoint's measured p99 latency x 1.5.
const MAX_RETRIES = 3;
type Page = { next_cursor: string | null; has_more: boolean };
type SocialCrawlResponse =
| { success: true; data: any; pagination?: Page; credits_used: number; request_id: string }
| { success: false; error: { type: string; message: string; retryable: boolean }; request_id: string };
const sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));
// Exponential backoff with jitter: about 1 s, 2 s, then 4 s.
const backoffMs = (attempt: number) => 2 ** attempt * 1000 * (0.5 + Math.random() / 2);
async function socialcrawl(url: URL) {
// One Idempotency-Key per request, reused on every retry, so a retried call is never charged twice.
const idempotencyKey = crypto.randomUUID();
for (let attempt = 0; ; attempt++) {
let res: Response;
let body: SocialCrawlResponse;
try {
res = await fetch(url, {
headers: {
"x-api-key": API_KEY,
"Idempotency-Key": idempotencyKey,
},
signal: AbortSignal.timeout(TIMEOUT_MS),
});
body = (await res.json()) as SocialCrawlResponse;
} catch (error) {
// A timeout, a dropped connection or a non-JSON gateway page: retry with the same key.
if (attempt >= MAX_RETRIES) throw error;
await sleep(backoffMs(attempt));
continue;
}
if (body.success) return body;
// Branch on error.type, never on the message text.
if (body.error.type === "RESOURCE_NOT_FOUND") return null; // refunded: nothing to read
const retryAfter = res.headers.get("Retry-After");
// SERVICE_UNAVAILABLE without Retry-After is a withdrawn endpoint: permanent.
const permanent = body.error.type === "SERVICE_UNAVAILABLE" && retryAfter === null;
if (!body.error.retryable || permanent || attempt >= MAX_RETRIES) {
throw new Error(`${body.error.type}: ${body.error.message} (request_id ${body.request_id})`);
}
// Retry-After (seconds) wins; otherwise back off.
await sleep(retryAfter ? Number(retryAfter) * 1000 : backoffMs(attempt));
}
}
const url = new URL("https://www.socialcrawl.dev/v1/instagram/stories");
url.searchParams.set("handle", "instagram");
const body = await socialcrawl(url);
if (body) console.log(body.data);Parameters
| Parameter | Required | Description |
|---|---|---|
| handle | No | Instagram username without the @ symbol. |
| user_id | No | Instagram numeric user ID. Use this for faster responses. |
| safe_url | No | Optional and usually ignored: most responses carry ordinary media URLs whether or not you send it. Same price either way. |
| since | No | Only rows published on or after this date: YYYY-MM-DD (midnight UTC) or an ISO 8601 timestamp. Rows older than it are left off each page. This list is not in date order, so the walk does not stop at the date: keep following `next_cursor`, and each page costs what a page costs even when every row on it is filtered out. A row with no date is kept. `published_after`, `start_date`, `from_date`, `publish_time` (`yesterday`, `this-week`, `this-month`, `last-3-months`, `last-6-months`) and `max_age_days` are accepted and applied as `since`. |
| until | No | Only rows published on or before this date: YYYY-MM-DD (that whole UTC day is included) or an ISO 8601 timestamp. Newer rows are left off each page and the walk does not stop, so older pages follow. A row with no date is kept. `published_before`, `end_date` and `to_date` are accepted and applied as `until`. |
What does the Instagram Stories API return?
Every response follows one unified schema. Here is a real, unmodified response body, so you can see the exact fields you get back before spending a credit.
Example response
{
"success": true,
"platform": "instagram",
"endpoint": "/v1/instagram/stories",
"data": {
"items": [
{
"post": {
"id": "3998435105545705197",
"url": "https://www.instagram.com/reel/Dd9S4s7gNbt/",
"content": {
"text": null,
"media_urls": "https://scontent-iad3-1.cdninstagram.com/user_2352da/v/t2/f2/m78/AQOtHdIvDsqOW9v7UGl5HGWG7FSY-gi2cGglrt5m_5ZCuCVaUpu_scjuGOhhtWwDyU4nUncGq28MbxDksOoAGZQGGu5o9r6gzcrbn78.mp4?_nc_cat=104&_nc_sid=5e9851&_nc_ht=scontent-iad3-1.cdninstagram.com&_nc_ohc=QlEfUkcWJTEQ7kNvwH2T6tD&efg=eyJ2ZW5jb2RlX3RhZyI6Inhwdl9wcm9ncmVzc2l2ZS5JTlNUQUdSQU0uU1RPUlkuQzMuNzIwLmRhc2hfYmFzZWxpbmVfMV92MSIsInhwdl9hc3NldF9pZCI6MTg3OTg5NjUzNzcwMDEzMjEsImFzc2V0X2FnZV9kYXlzIjowLCJ2aV91c2VjYXNlX2lkIjoxMDgyNiwiZHVyYXRpb25fcyI6MTYsIndhdGNoX3RpbWVfcyI6MjczNTY1MDYsInVybGdlbl9zb3VyY2UiOiJ3d3cifQ%3D%3D&ccb=17-1&vs=ba7de382da825823&_nc_vs=HBksFQIYUWlnX3hwdl9wbGFjZW1lbnRfcGVybWFuZW50X3YyLzQ0QUUzNERDMjhFNzQzMzk4NzkwRjREMkNEMDQ5QkZEX3ZpZGVvX2Rhc2hpbml0Lm1wNBUAAsgBEgAVAhhRaWdfeHB2X3BsYWNlbWVudF9wZXJtYW5lbnRfdjIvNTIyMEQyNERFRUM1NDRCN0E0NjdGMDIyQUZCNjY2RDJfYXVkaW9fZGFzaGluaXQubXA0FQICyAESACgAGAAbAogHdXNlX29pbAExEnByb2dyZXNzaXZlX3JlY2lwZQExFQAAJtKdh9fm4-RCFQIoAkMzLBdAMLul41P3zxgSZGFzaF9iYXNlbGluZV8xX3YxEQB16AdllKkBAA&_nc_gid=8bKhF703SFckB3MqUWlE9Q&_nc_ss=733ba&_nc_zt=28&oh=00_AQPFuFW9F3vRoYBYD6jkiO2d3qXJaHx1Xnw7sfct3hibVw&oe=6AC1A361",
"thumbnail_url": "https://scontent-iad3-1.cdninstagram.com/user_4c9448/t51.71878-15/832678838_4380746102187889_2225297799503381246_n.jpg?stp=dst-jpg_e15_tt6&_nc_cat=1&ig_cache_key=Mzk5ODQzNTEwNTU0NTcwNTE5Nw%3D%3D.3-ccb7-5&ccb=7-5&_nc_sid=58cdad&efg=eyJ2ZW5jb2RlX3RhZyI6IlNUT1JZLnhwaWRzLjY0MC5zZHIudmlkZW9fZmlyc3RfZnJhbWVfdGh1bWJuYWlsLkMzIn0%3D&_nc_ohc=IpVpvaMLcdEQ7kNvwE-pZ2g&_nc_oc=AdphR8fIN8y3oSr1H6I9-1L5k761xH9hQ3CF1foZ4aRUgztJeyj5-dNz2d24wQ2_3GM&_nc_ad=z-m&_nc_cid=0&_nc_zt=23&_nc_ht=scontent-iad3-1.cdninstagram.com&_nc_gid=8bKhF703SFckB3MqUWlE9Q&_nc_ss=733ba&oh=00_AQPduOjKkdMnDRbPB1ciY_ipXaLL-q--rUXr3lCHm26VaA&oe=6AC58F24",
"duration_seconds": 16.766
},
"author": {
"username": "instagram",
"display_name": "user_bad57e",
"avatar_url": "https://example.com/avatars/user_01351d.png",
"verified": true
},
"engagement": {
"views": null,
"likes": null,
"comments": null,
"shares": null,
"saves": null
},
"flags": {
"nsfw": null,
"spoiler": null,
"pinned": null,
"deleted": false
},
"published_at": "2026-10-01T16:03:44.000Z",
"ext": {
"media_type": "video",
"published_at_epoch": 1790870624,
"coauthors": []
}
},
"computed": {
"engagement_rate": null,
"language": null,
"content_category": null,
"estimated_reach": null
}
}
],
"total": null,
"dropped": 0
},
"credits_used": 5,
"request_id": "req_example000000",
"cached": false,
"pagination": {
"next_cursor": null,
"has_more": false,
"page_size": 1
},
"credits_remaining": 9999,
"source": "captured",
"captured_at": "2026-10-02T13:08:57.437Z",
"redacted": true
}Live sample illustrating the unified response shape. Field values reflect the record you query.
How does the Instagram Stories API work?
Send a GET request with your API key and get back clean, structured JSON in our unified schema. Supported computed fields are populated when the source provides the required inputs.
Method
GET
Response
JSON
How do you scrape social media data in seconds?
The fastest social media scraping API for developers. Scrape profiles, posts, comments, and analytics from 69 platforms covering 10B+ monthly active users.
One schema, every platform
Query 69 platforms with identical response structures. Write your integration once.
Computed fields, not just scraped
When an endpoint supports these metrics and the source provides the required inputs, the normalized record includes engagement_rate, estimated_reach, content_category, and language. Ready to use.
See your data before you code
Visual Data Explorer. Paste any URL, get rich result cards, sortable tables, CSV export.
import requests
response = requests.get(
'https://www.socialcrawl.dev/v1/tiktok/profile',
params={'handle': 'charlidamelio'},
headers={'x-api-key': 'sc_YOUR_API_KEY'}
)
data = response.json(){
"success": true,
"platform": "tiktok",
"data": {
"author": {
"username": "charlidamelio",
"followers": 152400000
},
"engagement": {
"likes": 12400000000,
"engagement_rate": 0.087
},
"metadata": {
"language": "en",
"content_category": "lifestyle"
}
}
}Have a question? We got answers
Find answers to frequently asked questions about SocialCrawl's API, pricing, and capabilities.
Contact usHow do I get a user's active Instagram stories with an API?
Should I pass handle or user_id to the stories endpoint?
What happens if the user has no active stories?
How much does the Instagram Stories API cost per call?
Can I get CDN-safe media URLs for the stories?
Ask AI about SocialCrawl
Ready to scrape Instagram Stories data?
Get your API key and start pulling Instagram data in under 60 seconds.
