- Cost
- 1 credit
- Cached repeats
- 0 creditssend max_age_days, results kept 30 days
- Failed requests
- 0 credits
Also available as POST with a JSON body.
You send one of id or company_name.
Part of the Facebook Scraper API: 23 Facebook endpoints on one key.
Request
Send your key in the x-api-key header.
1curl -G "https://api.socialscrape.dev/v1/facebook/ad-library/company/ads" \2 -H "x-api-key: $SOCIALSCRAPE_API_KEY" \3 --data-urlencode 'id=15087023444' \4 --data-urlencode 'region=US'1import os2import requests34params = {5 "id": "15087023444",6 "region": "US",7}8res = requests.get(9 "https://api.socialscrape.dev/v1/facebook/ad-library/company/ads",10 headers={"x-api-key": os.environ["SOCIALSCRAPE_API_KEY"]},11 params=params,12 timeout=60,13)14body = res.json()1516if body["ok"]:17 print(body["data"])18else:19 print(body["error"]["code"], body["error"]["message"])1const url = new URL("https://api.socialscrape.dev/v1/facebook/ad-library/company/ads");2url.search = new URLSearchParams({3 id: "15087023444",4 region: "US",5}).toString();6const res = await fetch(url, {7 headers: { "x-api-key": process.env.SOCIALSCRAPE_API_KEY! },8});9const body = await res.json();1011if (body.ok) {12 console.log(body.data);13} else {14 console.error(body.error.code, body.error.message);15}1{2 "nodes": [3 {4 "name": "SocialScrape Facebook Ad Library ads by page",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/facebook/ad-library/company/ads",14 "sendQuery": true,15 "queryParameters": {16 "parameters": [17 {18 "name": "id",19 "value": "15087023444"20 },21 {22 "name": "region",23 "value": "US"24 }25 ]26 },27 "sendHeaders": true,28 "headerParameters": {29 "parameters": [30 {31 "name": "x-api-key",32 "value": "={{ $env.SOCIALSCRAPE_API_KEY }}"33 }34 ]35 }36 }37 }38 ],39 "connections": {}40}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 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_cc9a8398781187ace05db907",8 "data": {9 "object": "list",10 "items": [11 {12 "object": "ad",13 "platform": "facebook",14 "id": "1741150940324450",15 "url": "https://www.facebook.com/ads/library/?id=1741150940324450",16 "advertiser": {17 "object": "advertiser",18 "platform": "facebook",19 "id": "15087023444",20 "name": "Nike",21 "url": "https://facebook.com/nike",22 "page_id": "15087023444",23 "country": null,24 "verified": null,25 "ad_count": null,26 "extra": {27 "categories": [28 "Sportswear"29 ],30 "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...",31 "likes": 3949177632 }33 },34 "status": "active",35 "started_at": "2026-10-27T07:00:00Z",36 "ended_at": null,37 "title": "NikeSKIMS Outerwear",38 "body": "Performance-driven details meet elevated silhouettes in NikeSKIMS first-ever outerwear collection. Shop now.",39 "cta_text": "Shop now",40 "landing_url": "https://www.nike.com/w/nikeskims-jackets-5sac5zb2asd",41 "format": "dynamic_creative",42 "media": {43 "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...",44 "video_url": "https://video-iad3-1.xx.fbcdn.net/o1/v/t2/f2/m366/AQMThINznE2v6zjJUHiLUEsAe6tLCKgcJ6MocHt0gU-p-AsaNYsNictX5PBle5ainsTB4qblkbM2UlLyO4AZlQHUEa7f1zxKj_ESTcWbqYC...",45 "audio_url": null,46 "image_urls": null,47 "width": null,48 "height": null49 },50 "regions": null,51 "publisher_platforms": [52 "instagram"53 ],54 "impressions": null,55 "spend": null,56 "extra": {57 "caption": "nike.com",58 "cards": [59 {60 "cta_text": "Shop Now",61 "link_url": "https://www.nike.com/w/nikeskims-jackets-5sac5zb2asd",62 "title": "NikeSKIMS Outerwear",63 "video_url": "https://video-iad3-1.xx.fbcdn.net/o1/v/t2/f2/m366/AQMThINznE2v6zjJUHiLUEsAe6tLCKgcJ6MocHt0gU-p-AsaNYsNictX5PBle5ainsTB4qblkbM2UlLyO4AZlQHUEa7f1zxKj_ESTcWbqYC..."64 },65 {66 "body": "Performance-driven details meet elevated silhouettes in NikeSKIMS first-ever outerwear collection. Shop now.",67 "cta_text": "Shop Now",68 "link_url": "https://www.nike.com/w/nikeskims-jackets-5sac5zb2asd",69 "title": "NikeSKIMS Outerwear",70 "video_url": "https://video-iad6-1.xx.fbcdn.net/o1/v/t2/f2/m366/AQM0-S81Xgb6hqjKs_uFBvJvkit7yKus5AsUFSvpArSC4we5KxlUwn_Bvp_DONqWPcoJWFz34jGtAMa3asLcUTSo-SZcEf1zMAw-b7NE2pz..."71 }72 ],73 "categories": [74 "UNKNOWN"75 ],76 "collation_count": 2,77 "collation_id": "965683042768272",78 "contains_digital_created_media": false79 }80 },81 {82 "object": "ad",83 "platform": "facebook",84 "id": "863054156866007",85 "url": "https://www.facebook.com/ads/library/?id=863054156866007",86 "advertiser": {87 "object": "advertiser",88 "platform": "facebook",89 "id": "15087023444",90 "name": "Nike",91 "url": "https://facebook.com/nike",92 "page_id": "15087023444",93 "country": null,94 "verified": null,95 "ad_count": null,96 "extra": {97 "categories": [98 "Sportswear"99 ],100 "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...",101 "likes": 39491776102 }103 },104 "status": "active",105 "started_at": "2026-10-27T07:00:00Z",106 "ended_at": null,107 "title": "NikeSKIMS Outerwear",108 "body": "Performance-driven details meet elevated silhouettes in NikeSKIMS first-ever outerwear collection. Shop now.",109 "cta_text": "Shop now",110 "landing_url": "https://www.nike.com/w/nikeskims-jackets-5sac5zb2asd",111 "format": "dynamic_creative",112 "media": {113 "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...",114 "video_url": "https://video-iad6-1.xx.fbcdn.net/o1/v/t2/f2/m366/AQOM_F_MniZ-_eiw-ZpH_3mKF8mWUVD6uab43JspKB1zlLtipOCnu_yHODgd8GK7CzpKaUNjBvUbJf6NFghqmJSyKV6pbtFS3WCMO5YvZBI...",115 "audio_url": null,116 "image_urls": null,117 "width": null,118 "height": null119 },120 "regions": null,121 "publisher_platforms": [122 "instagram"123 ],124 "impressions": null,125 "spend": null,126 "extra": {127 "caption": "nike.com",128 "cards": [129 {130 "cta_text": "Shop Now",131 "link_url": "https://www.nike.com/w/nikeskims-jackets-5sac5zb2asd",132 "title": "NikeSKIMS Outerwear",133 "video_url": "https://video-iad6-1.xx.fbcdn.net/o1/v/t2/f2/m366/AQOM_F_MniZ-_eiw-ZpH_3mKF8mWUVD6uab43JspKB1zlLtipOCnu_yHODgd8GK7CzpKaUNjBvUbJf6NFghqmJSyKV6pbtFS3WCMO5YvZBI..."134 },135 {136 "body": "Performance-driven details meet elevated silhouettes in NikeSKIMS first-ever outerwear collection. Shop now.",137 "cta_text": "Shop Now",138 "link_url": "https://www.nike.com/w/nikeskims-jackets-5sac5zb2asd",139 "title": "NikeSKIMS Outerwear",140 "video_url": "https://video-iad3-2.xx.fbcdn.net/o1/v/t2/f2/m366/AQNUO60K5qIDnVm3ZY1jVNWQ0MrqZ9TmOF-hwfU2Uzj1X9IszvYLPwMKVEF1CrMmwvTsERt5gfqW27e0Sp4OBOmTi63eLqNm0ohUXgFDg7O..."141 }142 ],143 "categories": [144 "UNKNOWN"145 ],146 "collation_count": 1,147 "collation_id": "1504696874857690",148 "contains_digital_created_media": false149 }150 }151 ],152 "cursor": "eyJrIjoiZmJhZHMiLCJjIjoiQVFIVHY4UU9FVEp5MkwzXzYyc2RIeGQwWUd6RWpMN0V5N3JWVndXcnhtZHRkZGNlS2x1bmxlOG9aVExoSVdVdHp2NTEiLCJwIjoiMTUwODcwMjM0NDQifQ",153 "has_more": true,154 "parent": {155 "object": "advertiser",156 "platform": "facebook",157 "id": "15087023444",158 "name": "Nike",159 "url": "https://facebook.com/nike",160 "page_id": "15087023444",161 "country": null,162 "verified": null,163 "ad_count": null,164 "extra": {165 "categories": [166 "Sportswear"167 ],168 "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...",169 "likes": 39491776170 }171 }172 },173 "cursor": "eyJrIjoiZmJhZHMiLCJjIjoiQVFIVHY4UU9FVEp5MkwzXzYyc2RIeGQwWUd6RWpMN0V5N3JWVndXcnhtZHRkZGNlS2x1bmxlOG9aVExoSVdVdHp2NTEiLCJwIjoiMTUwODcwMjM0NDQifQ",174 "has_more": true175}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 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. 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.