Instagram profile posts API
A paged feed of public posts: photos, videos, carousels and reels, 12 a page.
- Cost
- 1 credit
- Cached repeats
- 0 creditssend max_age_days, results kept 30 days
- Failed requests
- 0 credits
- Status
- Betashape may still gain fields
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.
You send one of handle or id.
Request
Send your key in the x-api-key header.
curl -G "https://api.socialscrape.io/v1/instagram/profile/posts" \
-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/posts",
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/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);
}{
"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": {}
}Parameters
| Name | Type | Required | Description |
|---|---|---|---|
handle | string | one of | Username, with or without the leading @. Also accepted as username. |
id | string | one of | Numeric Instagram user id. Also accepted as user_id, userId. |
require_play_counts | boolean | Add 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). | |
cursor | string | Opaque cursor from the previous page; pass it back unchanged. Also accepted as continuationToken, continuation_token, next_max_id, max_id, max_cursor, min_time, after, page_token, pageToken, paginationToken, next_page_id, page. |
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_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. C...",
"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-...",
"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 ...",
"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-...",
"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-..."
],
"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
}Fields
A page of results. Each entry in items is a Post. cursor and has_more page through the rest.
A field the platform does not give is null, never made up. Extra platform details are in extra.
| Field | Type | Always | Notes |
|---|---|---|---|
object | "post" | ||
platform | Platform | yes | |
id | string | yes | |
url | string or null | ||
type | "video" or "short" or "reel" or "image" or "carousel" or "story" or "live" or "clip" or "text" or "link" or "tweet" or "pin" or "community_post" or "episode" or "unknown" | ||
author | Author or null | ||
title | string or null | ||
text | string or null | ||
published_at | string (ISO 8601 date-time) or null | ||
duration_seconds | number or null | ||
language | string or null | ||
hashtags | string[] or null | ||
mentions | string[] or null | ||
stats | Stats |
Show the other 6 fields
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.
How do I get more than one page?
Send the same request with cursor set to the cursor you received, until has_more is false. Each page costs its own price. See pagination.
Is there an SDK call for it?
The preview Python client has client.instagram.profile_posts(...) and the TypeScript client client.instagram.profilePosts(). 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.