Facebook Ad Library ads by page API
The ads a company runs, by Ad Library page id or by company name.
- Cost
- 1 credit
- Cached repeats
- 0 creditssend max_age_days, results kept 30 days
- Failed requests
- 0 credits
- Status
- Betashape may still gain fields
Also available as POST with a JSON body.
You send one of id or company_name.
Request
Send your key in the x-api-key header.
curl -G "https://api.socialscrape.io/v1/facebook/ad-library/company/ads" \
-H "x-api-key: $SOCIALSCRAPE_API_KEY" \
--data-urlencode 'id=15087023444' \
--data-urlencode 'region=US'import os
import requests
params = {
"id": "15087023444",
"region": "US",
}
res = requests.get(
"https://api.socialscrape.io/v1/facebook/ad-library/company/ads",
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/facebook/ad-library/company/ads");
url.search = new URLSearchParams({
id: "15087023444",
region: "US",
}).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 Facebook Ad Library ads by page",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
0,
0
],
"parameters": {
"method": "GET",
"url": "https://api.socialscrape.io/v1/facebook/ad-library/company/ads",
"sendQuery": true,
"queryParameters": {
"parameters": [
{
"name": "id",
"value": "15087023444"
},
{
"name": "region",
"value": "US"
}
]
},
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "x-api-key",
"value": "={{ $env.SOCIALSCRAPE_API_KEY }}"
}
]
}
}
}
],
"connections": {}
}Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | one of | Ad Library page id of the advertiser (from advertiser search). Also accepted as pageId, page_id. |
company_name | string | one of | Advertiser name (resolved to a page id). Also accepted as companyName. |
status | string | Ad status. Also accepted as active_status. | |
media_type | string | Creative type. `meme` is Meta's word for text on an image. | |
language | string | Only ads in this language, a 2-letter code (EN, ES, FR). Also accepted as lang. | |
sort | string | Order of results: `impressions` is most impressions first, `newest` is most recent. Changing it restarts the cursor chain. Also accepted as sort_by, sortBy, order. | |
start_date | string | Impressions window start, YYYY-MM-DD. | |
end_date | string | Impressions window end, YYYY-MM-DD. | |
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. | |
region | string | Two-letter country code (ISO 3166-1) for results that vary by country. Also accepted as country, geo. |
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_cc9a8398781187ace05db907",
"data": {
"object": "list",
"items": [
{
"object": "ad",
"platform": "facebook",
"id": "1741150940324450",
"url": "https://www.facebook.com/ads/library/?id=1741150940324450",
"advertiser": {
"object": "advertiser",
"platform": "facebook",
"id": "15087023444",
"name": "Nike",
"url": "https://facebook.com/nike",
"page_id": "15087023444",
"country": null,
"verified": null,
"ad_count": null,
"extra": {
"categories": [
"Sportswear"
],
"image_url": "https://scontent-iad3-2.xx.fbcdn.net/v/t39.35426-6/864869509_1653296926256147_3156543285094651318_n.jpg?stp=dst-jpg_s60x60_tt6&_nc_cat=111&ccb=1-7&_nc_sid=c5...",
"likes": 39491776
}
},
"status": "active",
"started_at": "2026-10-27T07:00:00Z",
"ended_at": null,
"title": "NikeSKIMS Outerwear",
"body": "Performance-driven details meet elevated silhouettes in NikeSKIMS first-ever outerwear collection. Shop now.",
"cta_text": "Shop now",
"landing_url": "https://www.nike.com/w/nikeskims-jackets-5sac5zb2asd",
"format": "dynamic_creative",
"media": {
"thumbnail_url": "https://scontent-iad3-2.xx.fbcdn.net/v/t39.35426-6/863381536_1629878175452111_2186856551102654395_n.jpg?_nc_cat=103&ccb=1-7&_nc_sid=c53f8f&_nc_ohc=10fUTWw10R...",
"video_url": "https://video-iad3-1.xx.fbcdn.net/o1/v/t2/f2/m366/AQMThINznE2v6zjJUHiLUEsAe6tLCKgcJ6MocHt0gU-p-AsaNYsNictX5PBle5ainsTB4qblkbM2UlLyO4AZlQHUEa7f1zxKj_ESTcWbqYC...",
"audio_url": null,
"image_urls": null,
"width": null,
"height": null
},
"regions": null,
"publisher_platforms": [
"instagram"
],
"impressions": null,
"spend": null,
"extra": {
"caption": "nike.com",
"cards": [
{
"cta_text": "Shop Now",
"link_url": "https://www.nike.com/w/nikeskims-jackets-5sac5zb2asd",
"title": "NikeSKIMS Outerwear",
"video_url": "https://video-iad3-1.xx.fbcdn.net/o1/v/t2/f2/m366/AQMThINznE2v6zjJUHiLUEsAe6tLCKgcJ6MocHt0gU-p-AsaNYsNictX5PBle5ainsTB4qblkbM2UlLyO4AZlQHUEa7f1zxKj_ESTcWbqYC..."
},
{
"body": "Performance-driven details meet elevated silhouettes in NikeSKIMS first-ever outerwear collection. Shop now.",
"cta_text": "Shop Now",
"link_url": "https://www.nike.com/w/nikeskims-jackets-5sac5zb2asd",
"title": "NikeSKIMS Outerwear",
"video_url": "https://video-iad6-1.xx.fbcdn.net/o1/v/t2/f2/m366/AQM0-S81Xgb6hqjKs_uFBvJvkit7yKus5AsUFSvpArSC4we5KxlUwn_Bvp_DONqWPcoJWFz34jGtAMa3asLcUTSo-SZcEf1zMAw-b7NE2pz..."
}
],
"categories": [
"UNKNOWN"
],
"collation_count": 2,
"collation_id": "965683042768272",
"contains_digital_created_media": false
}
},
{
"object": "ad",
"platform": "facebook",
"id": "863054156866007",
"url": "https://www.facebook.com/ads/library/?id=863054156866007",
"advertiser": {
"object": "advertiser",
"platform": "facebook",
"id": "15087023444",
"name": "Nike",
"url": "https://facebook.com/nike",
"page_id": "15087023444",
"country": null,
"verified": null,
"ad_count": null,
"extra": {
"categories": [
"Sportswear"
],
"image_url": "https://scontent-iad6-1.xx.fbcdn.net/v/t39.35426-6/855927589_1456995689655689_7861179406546544120_n.jpg?stp=dst-jpg_s60x60_tt6&_nc_cat=100&ccb=1-7&_nc_sid=c5...",
"likes": 39491776
}
},
"status": "active",
"started_at": "2026-10-27T07:00:00Z",
"ended_at": null,
"title": "NikeSKIMS Outerwear",
"body": "Performance-driven details meet elevated silhouettes in NikeSKIMS first-ever outerwear collection. Shop now.",
"cta_text": "Shop now",
"landing_url": "https://www.nike.com/w/nikeskims-jackets-5sac5zb2asd",
"format": "dynamic_creative",
"media": {
"thumbnail_url": "https://scontent-iad3-2.xx.fbcdn.net/v/t39.35426-6/857014578_2174319749830422_6237423086901910294_n.jpg?_nc_cat=111&ccb=1-7&_nc_sid=c53f8f&_nc_ohc=KgSzPhaF66...",
"video_url": "https://video-iad6-1.xx.fbcdn.net/o1/v/t2/f2/m366/AQOM_F_MniZ-_eiw-ZpH_3mKF8mWUVD6uab43JspKB1zlLtipOCnu_yHODgd8GK7CzpKaUNjBvUbJf6NFghqmJSyKV6pbtFS3WCMO5YvZBI...",
"audio_url": null,
"image_urls": null,
"width": null,
"height": null
},
"regions": null,
"publisher_platforms": [
"instagram"
],
"impressions": null,
"spend": null,
"extra": {
"caption": "nike.com",
"cards": [
{
"cta_text": "Shop Now",
"link_url": "https://www.nike.com/w/nikeskims-jackets-5sac5zb2asd",
"title": "NikeSKIMS Outerwear",
"video_url": "https://video-iad6-1.xx.fbcdn.net/o1/v/t2/f2/m366/AQOM_F_MniZ-_eiw-ZpH_3mKF8mWUVD6uab43JspKB1zlLtipOCnu_yHODgd8GK7CzpKaUNjBvUbJf6NFghqmJSyKV6pbtFS3WCMO5YvZBI..."
},
{
"body": "Performance-driven details meet elevated silhouettes in NikeSKIMS first-ever outerwear collection. Shop now.",
"cta_text": "Shop Now",
"link_url": "https://www.nike.com/w/nikeskims-jackets-5sac5zb2asd",
"title": "NikeSKIMS Outerwear",
"video_url": "https://video-iad3-2.xx.fbcdn.net/o1/v/t2/f2/m366/AQNUO60K5qIDnVm3ZY1jVNWQ0MrqZ9TmOF-hwfU2Uzj1X9IszvYLPwMKVEF1CrMmwvTsERt5gfqW27e0Sp4OBOmTi63eLqNm0ohUXgFDg7O..."
}
],
"categories": [
"UNKNOWN"
],
"collation_count": 1,
"collation_id": "1504696874857690",
"contains_digital_created_media": false
}
}
],
"cursor": "eyJrIjoiZmJhZHMiLCJjIjoiQVFIVHY4UU9FVEp5MkwzXzYyc2RIeGQwWUd6RWpMN0V5N3JWVndXcnhtZHRkZGNlS2x1bmxlOG9aVExoSVdVdHp2NTEiLCJwIjoiMTUwODcwMjM0NDQifQ",
"has_more": true,
"parent": {
"object": "advertiser",
"platform": "facebook",
"id": "15087023444",
"name": "Nike",
"url": "https://facebook.com/nike",
"page_id": "15087023444",
"country": null,
"verified": null,
"ad_count": null,
"extra": {
"categories": [
"Sportswear"
],
"image_url": "https://scontent-iad3-2.xx.fbcdn.net/v/t39.35426-6/864869509_1653296926256147_3156543285094651318_n.jpg?stp=dst-jpg_s60x60_tt6&_nc_cat=111&ccb=1-7&_nc_sid=c5...",
"likes": 39491776
}
}
},
"cursor": "eyJrIjoiZmJhZHMiLCJjIjoiQVFIVHY4UU9FVEp5MkwzXzYyc2RIeGQwWUd6RWpMN0V5N3JWVndXcnhtZHRkZGNlS2x1bmxlOG9aVExoSVdVdHp2NTEiLCJwIjoiMTUwODcwMjM0NDQifQ",
"has_more": true
}Fields
A page of results. Each entry in items is a Ad. 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 | "ad" | ||
platform | Platform | yes | the ad library's platform |
id | string | yes | |
url | string or null | ||
advertiser | Advertiser or null | ||
status | "active" or "inactive" or "unknown" | ||
started_at | string (ISO 8601 date-time) or null | ||
ended_at | string (ISO 8601 date-time) or null | ||
title | string or null | ||
body | string or null | ||
cta_text | string or null | ||
landing_url | string or null | ||
format | string or null | "image" | "video" | "carousel" | "text" | platform-specific | |
media | Media |
Show the other 5 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.facebook.ad_library_company_ads(...) and the TypeScript client client.facebook.adLibraryCompanyAds(). 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.