Facebook Ad Library ads by page API
The ads a company runs, by Ad Library page id or by company name.
GET /v1/facebook/ad-library/company/ads
GET /v1/facebook/ad-library/company/ads
The ads a company runs, by Ad Library page id or by company name. Also available as POST with a JSON body.
- Cost: 1 credit
- Cache: Results are kept up to 30 days; send
max_age_daysto reuse them for free. - Timeout: A request still running after about 25 seconds answers
202with a job to poll (Batch and jobs).
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 | no | Ad status. One of active, inactive, all. Default active. Also accepted as active_status. Also accepted values: ACTIVE for active, INACTIVE for inactive, ALL for all. |
media_type | string | no | Creative type. meme is Meta's word for text on an image. One of all, image, video, meme, image_and_meme, none. Also accepted values: ALL for all, IMAGE for image, VIDEO for video, MEME for meme, IMAGE_AND_MEME for image_and_meme, NONE for none. |
language | string | no | Only ads in this language, a 2-letter code (EN, ES, FR). Also accepted as lang. |
sort | string | no | Order of results: impressions is most impressions first (ScrapeCreators' default), newest is most recent. Changing it restarts the cursor chain. One of relevance, impressions, newest. Also accepted as sort_by, sortBy, order. Also accepted values: total_impressions for impressions, relevancy_monthly_grouped for newest. |
start_date | string | no | Impressions window start, YYYY-MM-DD. |
end_date | string | no | Impressions window end, YYYY-MM-DD. |
Send at least one of id, company_name. If you send several, the first listed is used and the rest are ignored.
Every request also accepts:
cursor: the cursor from the previous page (Pagination).region: two-letter country code for results that vary by country. Changing it restarts the cursor chain.trim:truefor a smaller response withoutnullfields andextra.raw:trueto also get the platform's original object asraw.max_age_days: accept a cached result up to this many days old, for 0 credits (Caching).
Example request#
Set your key in the environment first (see Authentication).
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" \5 --data-urlencode "cursor=eyJrIjoiZmJhZHMiLCJjIjoiQVFIVEZfamZkd1hQZjYwUk9Ld3A0Qk1QeGlCM1BiN2pxYkc3dEtlbEhXSmJMc3hnb29XbnFjbWRnUUJCMEJ0Y3RGcW8iLCJwIjoiMTUwODcwMjM0NDQifQ"1import os2import requests34params = {5 "id": "15087023444",6 "region": "US",7 "cursor": "eyJrIjoiZmJhZHMiLCJjIjoiQVFIVEZfamZkd1hQZjYwUk9Ld3A0Qk1QeGlCM1BiN2pxYkc3dEtlbEhXSmJMc3hnb29XbnFjbWRnUUJCMEJ0Y3RGcW8iLCJwIjoiMTUwODcwMjM0NDQifQ",8}9res = requests.get(10 "https://api.socialscrape.dev/v1/facebook/ad-library/company/ads",11 headers={"x-api-key": os.environ["SOCIALSCRAPE_API_KEY"]},12 params=params,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 "cursor": "eyJrIjoiZmJhZHMiLCJjIjoiQVFIVEZfamZkd1hQZjYwUk9Ld3A0Qk1QeGlCM1BiN2pxYkc3dEtlbEhXSmJMc3hnb29XbnFjbWRnUUJCMEJ0Y3RGcW8iLCJwIjoiMTUwODcwMjM0NDQifQ"6}).toString();7const res = await fetch(url, {8 headers: { "x-api-key": process.env.SOCIALSCRAPE_API_KEY! },9});10const body = await res.json();1112if (body.ok) {13 console.log(body.data);14} else {15 console.error(body.error.code, body.error.message);16}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 "name": "cursor",27 "value": "eyJrIjoiZmJhZHMiLCJjIjoiQVFIVEZfamZkd1hQZjYwUk9Ld3A0Qk1QeGlCM1BiN2pxYkc3dEtlbEhXSmJMc3hnb29XbnFjbWRnUUJCMEJ0Y3RGcW8iLCJwIjoiMTUwODcwMjM0NDQifQ"28 }29 ]30 },31 "sendHeaders": true,32 "headerParameters": {33 "parameters": [34 {35 "name": "x-api-key",36 "value": "={{ $env.SOCIALSCRAPE_API_KEY }}"37 }38 ]39 }40 }41 }42 ],43 "connections": {}44}Example response#
This is a sample from a recorded response, lists and long text are shortened. Status 200.
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=c53f8f&_nc_ohc=uSW_Qxt7K9QQ7kNvwG7kpel&_nc_oc=AdoQi3RqZdma5IEI2u7F5LjvR9njdcm05RFGsZF...",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=10fUTWw10RMQ7kNvwHCY_uY&_nc_oc=AdquGCOv_7TJ2g_apQc9xkLLh6dXSzY3fyvRIybw-F66_HdEfmO42AUvGzLW_Y...",44 "video_url": "https://video-iad3-1.xx.fbcdn.net/o1/v/t2/f2/m366/AQMThINznE2v6zjJUHiLUEsAe6tLCKgcJ6MocHt0gU-p-AsaNYsNictX5PBle5ainsTB4qblkbM2UlLyO4AZlQHUEa7f1zxKj_ESTcWbqYC6RQ.mp4?_nc_cat=104&_nc_sid=b66105&_nc_ht=video-iad3-1.xx.fbcdn.net&_nc_ohc=nb_6WRH...",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_ESTcWbqYC6RQ.mp4?_nc_cat=104&_nc_sid=b66105&_nc_ht=video-iad3-1.xx.fbcdn.net&_nc_ohc=nb_6WRH..."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-b7NE2pzTzA.mp4?_nc_cat=107&_nc_sid=b66105&_nc_ht=video-iad6-1.xx.fbcdn.net&_nc_ohc=xzRxgs8..."71 }72 ],73 "categories": [74 "UNKNOWN"75 ],76 "collation_count": 2,77 "collation_id": "965683042768272",78 "contains_digital_created_media": false,79 "contains_sensitive_content": false,80 "gated_type": "ELIGIBLE",81 "hide_data_status": "NONE",82 "is_aaa_eligible": false,83 "media_expires_at": "2026-11-03T12:01:44Z",84 "regional_regulation_data": {85 "finserv": {86 "is_deemed_finserv": false,87 "is_limited_delivery": false88 },89 "tw_anti_scam": {90 "is_limited_delivery": false91 }92 },93 "video_urls": [94 "https://video-iad3-1.xx.fbcdn.net/o1/v/t2/f2/m366/AQMThINznE2v6zjJUHiLUEsAe6tLCKgcJ6MocHt0gU-p-AsaNYsNictX5PBle5ainsTB4qblkbM2UlLyO4AZlQHUEa7f1zxKj_ESTcWbqYC6RQ.mp4?_nc_cat=104&_nc_sid=b66105&_nc_ht=video-iad3-1.xx.fbcdn.net&_nc_ohc=nb_6WRH...",95 "https://video-iad6-1.xx.fbcdn.net/o1/v/t2/f2/m366/AQM0-S81Xgb6hqjKs_uFBvJvkit7yKus5AsUFSvpArSC4we5KxlUwn_Bvp_DONqWPcoJWFz34jGtAMa3asLcUTSo-SZcEf1zMAw-b7NE2pzTzA.mp4?_nc_cat=107&_nc_sid=b66105&_nc_ht=video-iad6-1.xx.fbcdn.net&_nc_ohc=xzRxgs8..."96 ]97 }98 },99 {100 "object": "ad",101 "platform": "facebook",102 "id": "863054156866007",103 "url": "https://www.facebook.com/ads/library/?id=863054156866007",104 "advertiser": {105 "object": "advertiser",106 "platform": "facebook",107 "id": "15087023444",108 "name": "Nike",109 "url": "https://facebook.com/nike",110 "page_id": "15087023444",111 "country": null,112 "verified": null,113 "ad_count": null,114 "extra": {115 "categories": [116 "Sportswear"117 ],118 "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=c53f8f&_nc_ohc=YQbv5qKzW6QQ7kNvwHUrCpf&_nc_oc=Adp_t208XBYDDRNJmXdgMFKyceLQgheCHSqN9qD...",119 "likes": 39491776120 }121 },122 "status": "active",123 "started_at": "2026-10-27T07:00:00Z",124 "ended_at": null,125 "title": "NikeSKIMS Outerwear",126 "body": "Performance-driven details meet elevated silhouettes in NikeSKIMS first-ever outerwear collection. Shop now.",127 "cta_text": "Shop now",128 "landing_url": "https://www.nike.com/w/nikeskims-jackets-5sac5zb2asd",129 "format": "dynamic_creative",130 "media": {131 "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=KgSzPhaF660Q7kNvwET6gjh&_nc_oc=AdqXxLJz_8rHvlmOzRAlfrVtUPFZ33GyoGwNcOpZX3Cg73RB6svrlGF3IKpZci...",132 "video_url": "https://video-iad6-1.xx.fbcdn.net/o1/v/t2/f2/m366/AQOM_F_MniZ-_eiw-ZpH_3mKF8mWUVD6uab43JspKB1zlLtipOCnu_yHODgd8GK7CzpKaUNjBvUbJf6NFghqmJSyKV6pbtFS3WCMO5YvZBIB0A.mp4?_nc_cat=100&_nc_sid=b66105&_nc_ht=video-iad6-1.xx.fbcdn.net&_nc_ohc=UkXyVMe...",133 "audio_url": null,134 "image_urls": null,135 "width": null,136 "height": null137 },138 "regions": null,139 "publisher_platforms": [140 "instagram"141 ],142 "impressions": null,143 "spend": null,144 "extra": {145 "caption": "nike.com",146 "cards": [147 {148 "cta_text": "Shop Now",149 "link_url": "https://www.nike.com/w/nikeskims-jackets-5sac5zb2asd",150 "title": "NikeSKIMS Outerwear",151 "video_url": "https://video-iad6-1.xx.fbcdn.net/o1/v/t2/f2/m366/AQOM_F_MniZ-_eiw-ZpH_3mKF8mWUVD6uab43JspKB1zlLtipOCnu_yHODgd8GK7CzpKaUNjBvUbJf6NFghqmJSyKV6pbtFS3WCMO5YvZBIB0A.mp4?_nc_cat=100&_nc_sid=b66105&_nc_ht=video-iad6-1.xx.fbcdn.net&_nc_ohc=UkXyVMe..."152 },153 {154 "body": "Performance-driven details meet elevated silhouettes in NikeSKIMS first-ever outerwear collection. Shop now.",155 "cta_text": "Shop Now",156 "link_url": "https://www.nike.com/w/nikeskims-jackets-5sac5zb2asd",157 "title": "NikeSKIMS Outerwear",158 "video_url": "https://video-iad3-2.xx.fbcdn.net/o1/v/t2/f2/m366/AQNUO60K5qIDnVm3ZY1jVNWQ0MrqZ9TmOF-hwfU2Uzj1X9IszvYLPwMKVEF1CrMmwvTsERt5gfqW27e0Sp4OBOmTi63eLqNm0ohUXgFDg7O94w.mp4?_nc_cat=111&_nc_sid=b66105&_nc_ht=video-iad3-2.xx.fbcdn.net&_nc_ohc=ExQREJ1..."159 }160 ],161 "categories": [162 "UNKNOWN"163 ],164 "collation_count": 1,165 "collation_id": "1504696874857690",166 "contains_digital_created_media": false,167 "contains_sensitive_content": false,168 "gated_type": "ELIGIBLE",169 "hide_data_status": "NONE",170 "is_aaa_eligible": false,171 "media_expires_at": "2026-11-03T12:27:40Z",172 "regional_regulation_data": {173 "finserv": {174 "is_deemed_finserv": false,175 "is_limited_delivery": false176 },177 "tw_anti_scam": {178 "is_limited_delivery": false179 }180 },181 "video_urls": [182 "https://video-iad6-1.xx.fbcdn.net/o1/v/t2/f2/m366/AQOM_F_MniZ-_eiw-ZpH_3mKF8mWUVD6uab43JspKB1zlLtipOCnu_yHODgd8GK7CzpKaUNjBvUbJf6NFghqmJSyKV6pbtFS3WCMO5YvZBIB0A.mp4?_nc_cat=100&_nc_sid=b66105&_nc_ht=video-iad6-1.xx.fbcdn.net&_nc_ohc=UkXyVMe...",183 "https://video-iad3-2.xx.fbcdn.net/o1/v/t2/f2/m366/AQNUO60K5qIDnVm3ZY1jVNWQ0MrqZ9TmOF-hwfU2Uzj1X9IszvYLPwMKVEF1CrMmwvTsERt5gfqW27e0Sp4OBOmTi63eLqNm0ohUXgFDg7O94w.mp4?_nc_cat=111&_nc_sid=b66105&_nc_ht=video-iad3-2.xx.fbcdn.net&_nc_ohc=ExQREJ1..."184 ]185 }186 }187 ],188 "cursor": "eyJrIjoiZmJhZHMiLCJjIjoiQVFIVHY4UU9FVEp5MkwzXzYyc2RIeGQwWUd6RWpMN0V5N3JWVndXcnhtZHRkZGNlS2x1bmxlOG9aVExoSVdVdHp2NTEiLCJwIjoiMTUwODcwMjM0NDQifQ",189 "has_more": true,190 "parent": {191 "object": "advertiser",192 "platform": "facebook",193 "id": "15087023444",194 "name": "Nike",195 "url": "https://facebook.com/nike",196 "page_id": "15087023444",197 "country": null,198 "verified": null,199 "ad_count": null,200 "extra": {201 "categories": [202 "Sportswear"203 ],204 "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=c53f8f&_nc_ohc=uSW_Qxt7K9QQ7kNvwG7kpel&_nc_oc=AdoQi3RqZdma5IEI2u7F5LjvR9njdcm05RFGsZF...",205 "likes": 39491776206 }207 }208 },209 "cursor": "eyJrIjoiZmJhZHMiLCJjIjoiQVFIVHY4UU9FVEp5MkwzXzYyc2RIeGQwWUd6RWpMN0V5N3JWVndXcnhtZHRkZGNlS2x1bmxlOG9aVExoSVdVdHp2NTEiLCJwIjoiMTUwODcwMjM0NDQifQ",210 "has_more": true211}Response#
A list of Ad objects in data.items, with data.cursor and data.has_more.
See Data models for every field. The envelope around data is described in Responses.
Errors#
Failures are free: credits_charged is 0. Branch on error.code, never on the message.
| Code | HTTP | Retry | Meaning |
|---|---|---|---|
invalid_params | 400 | no | A parameter is missing, unknown or has the wrong type. |
not_found | 404 | no | The platform says this profile, post or item does not exist. |
Every request can also fail with the account and platform errors listed on the Errors page.
Example error:
1{2 "ok": false,3 "error": {4 "code": "not_found",5 "message": "The platform says this profile, post or item does not exist.",6 "retryable": false7 },8 "credits_charged": 0,9 "request_id": "req_c4b8addd8b5f1e5089096dee"10}Also served at#
These paths answer the same request, so code written for other APIs keeps working: /v1/facebook/adLibrary/company/ads. See Switching from ScrapeCreators.
Related endpoints#
- Facebook Ad Library search (
GET /v1/facebook/ad-library/search) - Facebook Ad Library search (POST body) (
POST /v1/facebook/ad-library/search) - Facebook Ad Library ads by page (POST body) (
POST /v1/facebook/ad-library/company/ads) - Facebook Ad Library ad details (
GET /v1/facebook/ad-library/ad) - Facebook Ad Library ad transcript (
GET /v1/facebook/ad-library/ad/transcript) - Facebook Ad Library advertiser search (
GET /v1/facebook/ad-library/search/companies) - Facebook profile or page (
GET /v1/facebook/profile) - Facebook profile posts (
GET /v1/facebook/profile/posts)