Skip to content

Structured Facebook data: send urls. Cursor-paginated, 1 credit per successful call.

GET · POST1 credit / successful callCursor-paginated
GEThttps://api.scrapier.io/api/v2/facebook-photos/Open in Playground

Call GET /api/v2/facebook-photos/ with urls. The results are in data.photos; send data.next_cursor back as cursor to get the next page. 1 optional parameter refines the call (see Parameters).

Terminal window
curl -G "https://api.scrapier.io/api/v2/facebook-photos/" \
-H "X-API-Key: YOUR_API_KEY" \
--data-urlencode "urls=IamSRK" \
--max-time 210
NameTypeRequiredDefaultDescription
X-API-Key headerstringyes—Your API key from the dashboard.
urlsstringyese.g. IamSRKFacebook page/profile URL. Required first call.
cursorstringno—Pagination cursor returned in the previous response's next_cursor. Pass it back unchanged to fetch the next page. When next_cursor is null, you have reached the last page.
Advanced
NameTypeDefaultDescription
use_proxybooleantrueRoute the request through Scrapier's residential proxy pool. Default: true. Leave as is unless support tells you otherwise.
raw_databooleanfalseWhen true, the response carries the full raw upstream payload(s) the scraper received (GraphQL / JSON API bodies, HTML, embedded JSON-LD -- exactly as the platform returned them) under raw_responses, in place of the formatted items. When false (default) you get the formatted output. Pagination (cursor / next_cursor) works the same in both modes.
{
"success": true,
"data": {
"urls": "https://www.facebook.com/IamSRK",
"page": 1,
"page_size": 24,
"photos": [
{
"facebookUrl": "https://www.facebook.com/IamSRK",
"id": "YXBwX2l0ZW06MTAwMDQ0MTg1NDI4MjYxOjIzMDUyNzI3MzI6NTo6MTY2ODcxNDQyMTI3ODA1Ng==",
"image": "https://scontent.fdac8-1.fna.fbcdn.net/v/t39.30808-6/847385355_n.jpg",
"url": "https://www.facebook.com/photo/?fbid=1668714421278056&set=a.271269304355915",
"dataType": "photo",
"ocrText": "May be an image of one or more people, beard, fire and text",
"facebookId": "YXBwX2NvbGxlY3Rpb246cGZiaWQwNjhpYWhmcFBwU3VTSmVkdnM0OGlkZVFDa3dON1NiaEQx",
"pageAdLibrary": {
"is_business_page_active": false,
"id": "197997523559852"
},
"inputUrl": "https://www.facebook.com/IamSRK",
"photoId": "1668714421278056",
"postId": "1668714507944714",
"postUrl": "https://www.facebook.com/IamSRK/posts/pfbid0zzS22EiuY1yoBrRfqUhQaPcr3RMx6nXp3yWaYkw7nLf57i16C1k2NmuZ9ZGqPyNvl",
"caption": "A new chapter. A new perspective.",
"timestamp": "2026-10-13T07:12:08+00:00",
"createdTime": 1791875528,
"width": 1638,
"height": 2048,
"ownerId": "100044185428261",
"ownerName": "Shah Rukh Khan",
"reactionsCount": 10000,
"albumId": "271269304355915",
"scraped_at": "2026-10-13T09:00:00Z",
"position": 1
}
],
"next_cursor": "eyJ1IjoiaHR0cHM6Ly93d3cuZmFjZWJvb2suY29tL0lhbVNSSy9waG90b3MiLCJwIjoxfQ"
}
}

Sample from the live catalog; arrays trimmed to 3 items. Results are in data.photos.

FieldTypeExampleDescription
urlsstringhttps://www.facebook.com/IamSRK—
pageinteger1—
page_sizeinteger24—
photosarray[1 item]The results.
next_cursorstringeyJ1IjoiaHR0cHM6Ly93d3cuZmFjZWJvb2suY29tL0lhb…Pass back as cursor for the next page. null on the last page.
photos[].facebookUrlstringhttps://www.facebook.com/IamSRK—
photos[].idstringYXBwX2l0ZW06MTAwMDQ0MTg1NDI4MjYxOjIzMDUyNzI3M…—
photos[].imagestringhttps://scontent.fdac8-1.fna.fbcdn.net/v/t39.…—
photos[].urlstringhttps://www.facebook.com/photo/?fbid=16687144…—
photos[].dataTypestringphoto—
photos[].ocrTextstringMay be an image of one or more people, beard,…—
photos[].facebookIdstringYXBwX2NvbGxlY3Rpb246cGZiaWQwNjhpYWhmcFBwU3VTS…—
photos[].pageAdLibraryobject{…}—
photos[].inputUrlstringhttps://www.facebook.com/IamSRK—
photos[].photoIdstring1668714421278056—
photos[].postIdstring1668714507944714—
photos[].postUrlstringhttps://www.facebook.com/IamSRK/posts/pfbid0z…—
photos[].captionstringA new chapter. A new perspective.—
photos[].timestampstring2026-10-13T07:12:08+00:00—
photos[].createdTimeinteger1791875528—
photos[].widthinteger1638—
photos[].heightinteger2048—
photos[].ownerIdstring100044185428261—
photos[].ownerNamestringShah Rukh Khan—
photos[].reactionsCountinteger10000—
photos[].albumIdstring271269304355915—
photos[].scraped_atstring2026-10-13T09:00:00Z—
photos[].positioninteger1—

Pass data.next_cursor back as cursor until it is null. Required inputs are ignored once a cursor is sent. Each page is one billed call. More in Pagination.

const url = "https://api.scrapier.io/api/v2/facebook-photos/";
let params = { urls: "IamSRK" };
const items = [];
for (let page = 0; page < 10; page++) { // each page is one billed call
const res = await fetch(`${url}?${new URLSearchParams(params)}`, {
headers: { "X-API-Key": "YOUR_API_KEY" },
signal: AbortSignal.timeout(210_000),
});
const body = await res.json();
if (!res.ok) throw new Error(body.error ?? body.detail ?? `HTTP ${res.status}`);
const data = body.data;
items.push(...(data.photos ?? []));
if (!data.next_cursor) break; // null = last page
params = { cursor: data.next_cursor };
}

Failed calls are free. Branch on the HTTP status and read the message from error (or detail). Full details in Errors.

StatusMeaningRetry?Charged?
400Bad or missing input.No — fix the paramsNo
401 / 403Missing, invalid or revoked API key.No — fix the keyNo
402Out of credits (body has balance).No — top upNo
404Unknown endpoint slug.No — check the slugNo
429 / 503Busy or throttled.Yes — after Retry-AfterNo
5xxTarget site or upstream failure, or timeout.Yes — with backoffNo
  • Nothing special: send the inputs, read the result.