Skip to content

Structured Facebook data: send urls. Cursor-paginated, 2 credits per successful call.

GET · POST2 credits / successful callCursor-paginated
GEThttps://api.scrapier.io/api/v2/facebook-ad-library-leads/Open in Playground

Call GET /api/v2/facebook-ad-library-leads/ with urls. The results are in data.advertisers; send data.next_cursor back as cursor to get the next page. 9 optional parameters refine the call (see Parameters).

Terminal window
curl -G "https://api.scrapier.io/api/v2/facebook-ad-library-leads/" \
-H "X-API-Key: YOUR_API_KEY" \
--data-urlencode "urls=https://www.facebook.com/ads/library/?active_status=active&ad_type=all&country=US&q=plumber&search_type=keyword_unordered" \
--max-time 210
NameTypeRequiredDefaultDescription
X-API-Key headerstringyes—Your API key from the dashboard.
urlsstringyese.g. https://www.facebook.com/ads/library/?active_status=active&ad_type=all&country=US&q=plumber&search_type=keyword_unorderedAd Library search URL or public Page URL. Required first call.
locked in cursor
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.
countrystringnoALL
locked in cursor
active_statusstringnoactive
activeinactiveall
locked in cursor
periodstringno—
locked in cursor
max_landing_pages_per_advertiserintegerno3
locked in cursor
max_concurrent_sourcesintegerno3No description in the catalog yet.
max_concurrent_advertisersintegerno5No description in the catalog yet.
max_concurrent_crawlsintegerno10No description in the catalog yet.
cookie_overridestringno—No description in the catalog yet.
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/ads/library/?active_status=active&ad_type=all&country=US&q=plumber&search_type=keyword_unordered",
"page": null,
"page_size": 10,
"remaining_advertisers": 14,
"advertisers": [
{
"input_urls": [
"https://www.facebook.com/ads/library/?active_status=active&ad_type=all&country=US&q=plumber&search_type=keyword_unordered"
],
"success": true,
"error": null,
"pageId": "102938475610293",
"pageName": "Acme Plumbing Co",
"facebookPageUrl": "https://www.facebook.com/102938475610293",
"adLibraryUrl": "https://www.facebook.com/ads/library/?view_all_page_id=102938475610293",
"adsScanned": 12,
"activeAdsScanned": 9,
"uniqueLandingPagesResolved": 2,
"emails": [
],
"phones": [
"+15125550142"
],
"whatsapp": [],
"messenger": [],
"socialLinks": {
"instagram": [
"acmeplumbing"
]
},
"websites": [
"acmeplumbing.com"
],
"sampleAdLibraryUrl": "https://www.facebook.com/ads/library/?id=1234567890",
"leadSources": [],
"notes": null,
"scraped_at": "2026-09-26T11:24:46.215Z"
}
],
"next_cursor": "eyJpIjoiaHR0cHM6Ly93d3cuZmFjZWJvb2suY29tL2Fkcy9saWJyYXJ5Lyx1IjoyfQ"
}
}

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

FieldTypeExampleDescription
urlsstringhttps://www.facebook.com/ads/library/?active_…—
pagenullnull—
page_sizeinteger10—
remaining_advertisersinteger14—
advertisersarray[1 item]The results.
next_cursorstringeyJpIjoiaHR0cHM6Ly93d3cuZmFjZWJvb2suY29tL2Fkc…Pass back as cursor for the next page. null on the last page.
advertisers[].input_urlsarray[1 item]—
advertisers[].successbooleantrue—
advertisers[].errornullnull—
advertisers[].pageIdstring102938475610293—
advertisers[].pageNamestringAcme Plumbing Co—
advertisers[].facebookPageUrlstringhttps://www.facebook.com/102938475610293—
advertisers[].adLibraryUrlstringhttps://www.facebook.com/ads/library/?view_al…—
advertisers[].adsScannedinteger12—
advertisers[].activeAdsScannedinteger9—
advertisers[].uniqueLandingPagesResolvedinteger2—
advertisers[].emailsarray[1 item]—
advertisers[].phonesarray[1 item]—
advertisers[].whatsapparray[]—
advertisers[].messengerarray[]—
advertisers[].socialLinksobject{…}—
advertisers[].websitesarray[1 item]—
advertisers[].sampleAdLibraryUrlstringhttps://www.facebook.com/ads/library/?id=1234…—
advertisers[].leadSourcesarray[]—
advertisers[].notesnullnull—
advertisers[].scraped_atstring2026-09-26T11:24:46.215Z—

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-ad-library-leads/";
let params = { urls: "https://www.facebook.com/ads/library/?active_status=active&ad_type=all&country=US&q=plumber&search_type=keyword_unordered" };
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.advertisers ?? []));
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
  • Locked into the cursor: urls, country, active_status, period, max_landing_pages_per_advertiser. Set them on the first call; later pages reuse them.