- Cost
- 1 credit
- Cached repeats
- 0 creditssend max_age_days, results kept 30 days
- Failed requests
- 0 credits
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 lookup.
You send one of handle or id.
Part of the Instagram Scraper API: 16 Instagram endpoints on one key.
Request
Send your key in the x-api-key header.
1curl -G "https://api.socialscrape.dev/v1/instagram/profile/posts" \2 -H "x-api-key: $SOCIALSCRAPE_API_KEY" \3 --data-urlencode 'handle=nasa'1import os2import requests34params = {5 "handle": "nasa",6}7res = requests.get(8 "https://api.socialscrape.dev/v1/instagram/profile/posts",9 headers={"x-api-key": os.environ["SOCIALSCRAPE_API_KEY"]},10 params=params,11 timeout=60,12)13body = res.json()1415if body["ok"]:16 print(body["data"])17else:18 print(body["error"]["code"], body["error"]["message"])1const url = new URL("https://api.socialscrape.dev/v1/instagram/profile/posts");2url.search = new URLSearchParams({3 handle: "nasa",4}).toString();5const res = await fetch(url, {6 headers: { "x-api-key": process.env.SOCIALSCRAPE_API_KEY! },7});8const body = await res.json();910if (body.ok) {11 console.log(body.data);12} else {13 console.error(body.error.code, body.error.message);14}1{2 "nodes": [3 {4 "name": "SocialScrape Instagram profile posts",5 "type": "n8n-nodes-base.httpRequest",6 "typeVersion": 4.2,7 "position": [8 0,9 010 ],11 "parameters": {12 "method": "GET",13 "url": "https://api.socialscrape.dev/v1/instagram/profile/posts",14 "sendQuery": true,15 "queryParameters": {16 "parameters": [17 {18 "name": "handle",19 "value": "nasa"20 }21 ]22 },23 "sendHeaders": true,24 "headerParameters": {25 "parameters": [26 {27 "name": "x-api-key",28 "value": "={{ $env.SOCIALSCRAPE_API_KEY }}"29 }30 ]31 }32 }33 }34 ],35 "connections": {}36}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 examples, not your data.
1{2 "ok": true,3 "credits_charged": 1,4 "credits_remaining": 4999,5 "cached": false,6 "cached_at": null,7 "request_id": "req_08be081d82ddded9dcc72c57",8 "data": {9 "object": "list",10 "items": [11 {12 "object": "post",13 "platform": "instagram",14 "id": "DeTUk4sDSp-",15 "url": "https://www.instagram.com/reel/DeTUk4sDSp-/",16 "type": "reel",17 "author": {18 "id": "17841401474538262",19 "handle": "nasa",20 "name": null,21 "url": "https://www.instagram.com/nasa/",22 "avatar_url": null,23 "verified": null24 },25 "title": null,26 "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...",27 "published_at": "2026-10-10T05:21:53Z",28 "duration_seconds": null,29 "language": null,30 "hashtags": [31 "nasa",32 "artemisii",33 "artemis"34 ],35 "mentions": [],36 "stats": {37 "views": null,38 "likes": null,39 "comments": null,40 "shares": null,41 "saves": null,42 "dislikes": null43 },44 "media": {45 "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-...",46 "video_url": null,47 "audio_url": null,48 "image_urls": null,49 "width": null,50 "height": null51 },52 "song": null,53 "location": null,54 "is_pinned": null,55 "is_sponsored": null,56 "extra": {57 "accessibility_caption": "Video by NASA on October 10, 2026. May be an image of planet, eclipse and text.",58 "media_id": "4004634989362489982",59 "product_type": "clips",60 "published_from": "pk"61 }62 },63 {64 "object": "post",65 "platform": "instagram",66 "id": "DeJ28eTxo4s",67 "url": "https://www.instagram.com/p/DeJ28eTxo4s/",68 "type": "image",69 "author": {70 "id": "17841400054248583",71 "handle": "nasawebb",72 "name": null,73 "url": "https://www.instagram.com/nasawebb/",74 "avatar_url": null,75 "verified": null76 },77 "title": null,78 "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 ...",79 "published_at": "2026-10-06T13:09:48Z",80 "duration_seconds": null,81 "language": null,82 "hashtags": [],83 "mentions": [84 "nasawebb"85 ],86 "stats": {87 "views": null,88 "likes": null,89 "comments": null,90 "shares": null,91 "saves": null,92 "dislikes": null93 },94 "media": {95 "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-...",96 "video_url": null,97 "audio_url": null,98 "image_urls": [99 "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-..."100 ],101 "width": null,102 "height": null103 },104 "song": null,105 "location": null,106 "is_pinned": null,107 "is_sponsored": null,108 "extra": {109 "accessibility_caption": "Photo by NASA Webb Telescope on October 06, 2026. May be an image of text.",110 "media_id": "4001971394119634476",111 "product_type": "feed",112 "published_from": "pk"113 }114 }115 ],116 "cursor": "cAQHTcSYO1xRktCrtftb2yvKTK0sBOyPCYp_9YcUXtgxilIpq7-ZmhYDWz9C7K2aHIec0htjJWPF9_NPTtDgG7_BRdw",117 "has_more": true,118 "parent": {119 "object": "profile",120 "platform": "instagram",121 "id": "528817151",122 "handle": "nasa",123 "name": null,124 "headline": null,125 "url": "https://www.instagram.com/nasa/",126 "kind": "unknown",127 "bio": null,128 "avatar_url": null,129 "banner_url": null,130 "verified": null,131 "is_private": null,132 "external_url": null,133 "links": null,134 "location": null,135 "category": null,136 "created_at": null,137 "stats": {138 "followers": null,139 "following": null,140 "posts": null,141 "likes": null,142 "views": null143 },144 "extra": null145 }146 },147 "cursor": "cAQHTcSYO1xRktCrtftb2yvKTK0sBOyPCYp_9YcUXtgxilIpq7-ZmhYDWz9C7K2aHIec0htjJWPF9_NPTtDgG7_BRdw",148 "has_more": true149}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 Python client has client.instagram.profile_posts(...) and the TypeScript client client.instagram.profilePosts(). Both return the same envelope as the HTTP API. Install them from PyPI (socialscrape-sdk) or npm (socialscrape); plain HTTP works in any language.
Can an AI agent call it?
Yes. The MCP server, which you run on your own machine, reaches every built endpoint, with the same prices.