Instagram profile embed HTML API
The profile's embed document (what Instagram serves at /<handle>/embed/).
- Cost
- 1 credit
- Cached repeats
- 0 creditssend max_age_days, results kept 30 days
- Failed requests
- 0 credits
- Status
- Betashape may still gain fields
HTML in html, with the follower and post counts it carries in extra.
You send handle.
Request
Send your key in the x-api-key header.
curl -G "https://api.socialscrape.io/v1/instagram/profile/embed" \
-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/embed",
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/embed");
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 embed HTML",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
0,
0
],
"parameters": {
"method": "GET",
"url": "https://api.socialscrape.io/v1/instagram/profile/embed",
"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 | yes | Username, with or without the leading @. Also accepted as username. |
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_9319d3b216eab5563feebe05",
"data": {
"object": "embed",
"platform": "instagram",
"url": "https://www.instagram.com/nasa/",
"html": "<!DOCTYPE html>\n<html lang=\"en\" id=\"facebook\" class=\"no_js\">\n<head><meta charset=\"utf-8\" /><meta name=\"referrer\" content=\"origin-when-crossorigin\" id=\"meta_r...",
"extra": {
"embed_url": "https://www.instagram.com/nasa/embed/",
"followers": 104361175,
"full_name": "NASA",
"kind": "profile",
"posts": 4984,
"verified": true
}
},
"cursor": null,
"has_more": null
}Fields
One Embed in data.
A field the platform does not give is null, never made up. Extra platform details are in extra.
| Field | Type | Always | Notes |
|---|---|---|---|
object | "embed" | ||
platform | Platform | yes | |
url | string or null | ||
html | string | yes | |
extra | object or null |
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.
Is there an SDK call for it?
The preview Python client has client.instagram.profile_embed(...) and the TypeScript client client.instagram.profileEmbed(). 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.