Facebook Ad Library ads by page (POST body) API
  1. Docs
  2. Facebook
  3. Facebook Ad Library ads by page (POST body) API

Facebook Ad Library ads by page (POST body) API

The same as the GET form, with the parameters in a JSON body.

POST /v1/facebook/ad-library/company/ads

POST /v1/facebook/ad-library/company/ads

The same as the GET form, with the parameters in a JSON body.

  • Cost: 1 credit
  • Cache: Results are kept up to 30 days; send max_age_days to reuse them for free.
  • Timeout: A request still running after about 25 seconds answers 202 with a job to poll (Batch and jobs).

Parameters#

NameTypeRequiredDescriptionIn
idstringone ofAd Library page id of the advertiser (from advertiser search). Also accepted as pageId, page_id.body
company_namestringone ofAdvertiser name (resolved to a page id). Also accepted as companyName.body
statusstringnoAd 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.body
media_typestringnoCreative 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.body
languagestringnoOnly ads in this language, a 2-letter code (EN, ES, FR). Also accepted as lang.body
sortstringnoOrder 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.body
start_datestringnoImpressions window start, YYYY-MM-DD.body
end_datestringnoImpressions window end, YYYY-MM-DD.body

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: true for a smaller response without null fields and extra.
  • raw: true to also get the platform's original object as raw.
  • 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 -X POST "https://api.socialscrape.dev/v1/facebook/ad-library/company/ads" \2  -H "x-api-key: $SOCIALSCRAPE_API_KEY" \3  -H "content-type: application/json" \4  -d '{"id":"15087023444"}'

Example response#

This is a sample from a recorded response, lists and long text are shortened. Status 200.

200 OKSample response
1{2  "ok": true,3  "credits_charged": 1,4  "credits_remaining": 4999,5  "cached": false,6  "cached_at": null,7  "request_id": "req_85776afc9704511f31f58dc8",8  "data": {9    "object": "list",10    "items": [11      {12        "object": "ad",13        "platform": "facebook",14        "id": "1016451784037642",15        "url": "https://www.facebook.com/ads/library/?id=1016451784037642",16        "advertiser": {17          "object": "advertiser",18          "platform": "facebook",19          "id": "15087023444",20          "name": "Nike",21          "url": "https://www.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.fbna2-1.fna.fbcdn.net/v/t39.35426-6/509357337_4088170881445143_8138324132275675252_n.jpg?stp=dst-jpg_s60x60_tt6&_nc_cat=101&ccb=1-7&_nc_sid=c53f8f&_nc_ohc=E54VvdMHySUQ7kNvwEnvChq&_nc_oc=AdqCjHz2Z3FCDYuoYTlBrei5fT0yOdXr6n78q...",31            "likes": 3949177632          }33        },34        "status": "active",35        "started_at": "2025-06-20T07:00:00Z",36        "ended_at": null,37        "title": "{{product.name}}",38        "body": "Get the gear that goes hard on and off the field.",39        "cta_text": "Shop now",40        "landing_url": "https://www.nike.com/us/en_us",41        "format": "dynamic_product",42        "media": {43          "thumbnail_url": null,44          "video_url": null,45          "audio_url": null,46          "image_urls": [47            "https://scontent.fcha1-1.fna.fbcdn.net/v/t39.35426-6/509094198_1485897442775736_2519419118144931021_n.jpg?_nc_cat=111&ccb=1-7&_nc_sid=c53f8f&_nc_ohc=yCKYUPvBXQQQ7kNvwHy1XqI&_nc_oc=AdrLnwg91W_KZPYr3dEXLa2Ig9AiYRSSr7klXFu5nrliot9duhhoIeNVyHDZ...",48            "https://scontent.fbna2-1.fna.fbcdn.net/v/t39.35426-6/508839160_1795820578003799_8147925336477608418_n.jpg?_nc_cat=100&ccb=1-7&_nc_sid=c53f8f&_nc_ohc=_nC5tWBvI38Q7kNvwGOJQwX&_nc_oc=AdrjalKY4JCxI9rGkqSVW5dvL8UBzt-fc7bsb-2zGySCqCC35zSjlU98iLm6...",49            "https://scontent.fcha1-1.fna.fbcdn.net/v/t39.35426-6/509269099_740526921689557_370794322046462071_n.jpg?_nc_cat=105&ccb=1-7&_nc_sid=c53f8f&_nc_ohc=pELkLSuCGYYQ7kNvwHdifKQ&_nc_oc=AdrqStQzy4BXqGZLyxi8Qozwqe2SzPHEjkOwuwAvojqZmrHD4XB4KiWPIgqu5U..."50          ],51          "width": null,52          "height": null53        },54        "regions": null,55        "publisher_platforms": [56          "facebook",57          "instagram"58        ],59        "impressions": null,60        "spend": null,61        "extra": {62          "caption": "NIKE.COM",63          "cards": [64            {65              "body": "Get the gear that goes hard on and off the field.",66              "cta_text": "Shop Now",67              "image_url": "https://scontent.fcha1-1.fna.fbcdn.net/v/t39.35426-6/509094198_1485897442775736_2519419118144931021_n.jpg?_nc_cat=111&ccb=1-7&_nc_sid=c53f8f&_nc_ohc=yCKYUPvBXQQQ7kNvwHy1XqI&_nc_oc=AdrLnwg91W_KZPYr3dEXLa2Ig9AiYRSSr7klXFu5nrliot9duhhoIeNVyHDZ...",68              "link_url": "https://www.nike.com/t/air-monarch-iv-mens-workout-shoes-extra-wide-p8qNlT/416355-001?dplnk=member",69              "title": "Nike Air Monarch IV "70            },71            {72              "body": "Get the gear that goes hard on and off the field.",73              "cta_text": "Shop Now",74              "image_url": "https://scontent.fbna2-1.fna.fbcdn.net/v/t39.35426-6/508839160_1795820578003799_8147925336477608418_n.jpg?_nc_cat=100&ccb=1-7&_nc_sid=c53f8f&_nc_ohc=_nC5tWBvI38Q7kNvwGOJQwX&_nc_oc=AdrjalKY4JCxI9rGkqSVW5dvL8UBzt-fc7bsb-2zGySCqCC35zSjlU98iLm6...",75              "link_url": "https://www.nike.com/t/tempo-shorts-toddler-shorts-Gx0CH3/267358-019?dplnk=member",76              "title": "Nike Tempo Shorts "77            },78            {79              "body": "Get the gear that goes hard on and off the field.",80              "cta_text": "Shop Now",81              "image_url": "https://scontent.fcha1-1.fna.fbcdn.net/v/t39.35426-6/509269099_740526921689557_370794322046462071_n.jpg?_nc_cat=105&ccb=1-7&_nc_sid=c53f8f&_nc_ohc=pELkLSuCGYYQ7kNvwHdifKQ&_nc_oc=AdrqStQzy4BXqGZLyxi8Qozwqe2SzPHEjkOwuwAvojqZmrHD4XB4KiWPIgqu5U...",82              "link_url": "https://www.nike.com/t/air-monarch-iv-mens-workout-shoes-extra-wide-p8qNlT/416355-102?dplnk=member",83              "title": "Nike Air Monarch IV "84            }85          ],86          "categories": [87            "UNKNOWN"88          ],89          "contains_digital_created_media": false,90          "contains_sensitive_content": false,91          "gated_type": "ELIGIBLE",92          "hide_data_status": "NONE",93          "is_aaa_eligible": false,94          "media_expires_at": "2026-11-03T13:03:49Z",95          "regional_regulation_data": {96            "finserv": {97              "is_deemed_finserv": false,98              "is_limited_delivery": false99            },100            "tw_anti_scam": {101              "is_limited_delivery": false102            }103          }104        }105      },106      {107        "object": "ad",108        "platform": "facebook",109        "id": "1120113070497516",110        "url": "https://www.facebook.com/ads/library/?id=1120113070497516",111        "advertiser": {112          "object": "advertiser",113          "platform": "facebook",114          "id": "15087023444",115          "name": "Nike",116          "url": "https://www.facebook.com/nike/",117          "page_id": "15087023444",118          "country": null,119          "verified": null,120          "ad_count": null,121          "extra": {122            "categories": [123              "Sportswear"124            ],125            "image_url": "https://scontent.fcha1-1.fna.fbcdn.net/v/t39.35426-6/861252476_2084753155502396_8547913395286178715_n.jpg?stp=dst-jpg_s60x60_tt6&_nc_cat=111&ccb=1-7&_nc_sid=c53f8f&_nc_ohc=qAjohwWFq84Q7kNvwHwiUzy&_nc_oc=AdqcUMir1RbfgLtklFpDaXefHkrqDADHr6ZjV...",126            "likes": 39491776127          }128        },129        "status": "active",130        "started_at": "2026-10-23T07:00:00Z",131        "ended_at": null,132        "title": "{{product.name}}",133        "body": "Get the gear not afraid to put in the work.",134        "cta_text": "Shop now",135        "landing_url": "https://www.nike.com/",136        "format": "dynamic_product",137        "media": {138          "thumbnail_url": null,139          "video_url": null,140          "audio_url": null,141          "image_urls": [142            "https://scontent.fbna2-1.fna.fbcdn.net/v/t39.35426-6/857775335_1482362137114094_8883723222350936326_n.jpg?_nc_cat=106&ccb=1-7&_nc_sid=c53f8f&_nc_ohc=VCYuEpQe4CYQ7kNvwH8z-rz&_nc_oc=AdpQ3Kj9C7CIp6255XNbWBqynfR6y1YvzkyxIGnrOsWAxpxJAJtnvzNdDV54...",143            "https://scontent.fcha1-1.fna.fbcdn.net/v/t39.35426-6/855497992_1677688053962186_291249616028421191_n.jpg?_nc_cat=109&ccb=1-7&_nc_sid=c53f8f&_nc_ohc=DTdAONcQPjkQ7kNvwE-b3w1&_nc_oc=AdoxXHssfMPGAAf1mOUrKToGqgOX5kPr92T9K7D3NlkRu4EfjyT96Af1smSpr...",144            "https://scontent.fbna2-1.fna.fbcdn.net/v/t39.35426-6/859082956_1149373757658736_8182143225806562368_n.jpg?_nc_cat=101&ccb=1-7&_nc_sid=c53f8f&_nc_ohc=3KPeyrL1fd0Q7kNvwFHyLiY&_nc_oc=Adq3RbdVEbTucJeN4aL0CT7zYYIWMJSM6494vb-_bBCkTOnngrs2rZX0zZaf..."145          ],146          "width": null,147          "height": null148        },149        "regions": null,150        "publisher_platforms": [151          "facebook",152          "instagram"153        ],154        "impressions": null,155        "spend": null,156        "extra": {157          "caption": "NIKE.COM",158          "cards": [159            {160              "body": "Get the gear not afraid to put in the work.",161              "cta_text": "Shop Now",162              "image_url": "https://scontent.fbna2-1.fna.fbcdn.net/v/t39.35426-6/857775335_1482362137114094_8883723222350936326_n.jpg?_nc_cat=106&ccb=1-7&_nc_sid=c53f8f&_nc_ohc=VCYuEpQe4CYQ7kNvwH8z-rz&_nc_oc=AdpQ3Kj9C7CIp6255XNbWBqynfR6y1YvzkyxIGnrOsWAxpxJAJtnvzNdDV54...",163              "link_url": "https://www.nike.com/t/air-monarch-iv-mens-workout-shoes-extra-wide-p8qNlT/416355-001?dplnk=member",164              "title": "Nike Air Monarch IV"165            },166            {167              "body": "Get the gear not afraid to put in the work.",168              "cta_text": "Shop Now",169              "image_url": "https://scontent.fcha1-1.fna.fbcdn.net/v/t39.35426-6/855497992_1677688053962186_291249616028421191_n.jpg?_nc_cat=109&ccb=1-7&_nc_sid=c53f8f&_nc_ohc=DTdAONcQPjkQ7kNvwE-b3w1&_nc_oc=AdoxXHssfMPGAAf1mOUrKToGqgOX5kPr92T9K7D3NlkRu4EfjyT96Af1smSpr...",170              "link_url": "https://www.nike.com/t/air-monarch-iv-mens-workout-shoes-p8qNlT/415445-001?dplnk=member",171              "title": "Nike Air Monarch IV"172            },173            {174              "body": "Get the gear not afraid to put in the work.",175              "cta_text": "Shop Now",176              "image_url": "https://scontent.fbna2-1.fna.fbcdn.net/v/t39.35426-6/859082956_1149373757658736_8182143225806562368_n.jpg?_nc_cat=101&ccb=1-7&_nc_sid=c53f8f&_nc_ohc=3KPeyrL1fd0Q7kNvwFHyLiY&_nc_oc=Adq3RbdVEbTucJeN4aL0CT7zYYIWMJSM6494vb-_bBCkTOnngrs2rZX0zZaf...",177              "link_url": "https://www.nike.com/t/air-monarch-iv-mens-workout-shoes-p8qNlT/415445-102?dplnk=member",178              "title": "Nike Air Monarch IV"179            }180          ],181          "categories": [182            "UNKNOWN"183          ],184          "contains_digital_created_media": false,185          "contains_sensitive_content": false,186          "gated_type": "ELIGIBLE",187          "hide_data_status": "NONE",188          "is_aaa_eligible": false,189          "media_expires_at": "2026-11-03T11:11:37Z",190          "regional_regulation_data": {191            "finserv": {192              "is_deemed_finserv": false,193              "is_limited_delivery": false194            },195            "tw_anti_scam": {196              "is_limited_delivery": false197            }198          }199        }200      }201    ],202    "cursor": "eyJrIjoiZmJhZHMiLCJjIjoiQVFIVEZfamZkd1hQZjYwUk9Ld3A0Qk1QeGlCM1BiN2pxYkc3dEtlbEhXSmJMc3hnb29XbnFjbWRnUUJCMEJ0Y3RGcW8iLCJwIjoiMTUwODcwMjM0NDQifQ",203    "has_more": true,204    "parent": {205      "object": "advertiser",206      "platform": "facebook",207      "id": "15087023444",208      "name": "Nike",209      "url": "https://www.facebook.com/nike/",210      "page_id": "15087023444",211      "country": null,212      "verified": null,213      "ad_count": 91,214      "extra": {215        "categories": [216          "Sportswear"217        ],218        "image_url": "https://scontent.fbna2-1.fna.fbcdn.net/v/t39.35426-6/509357337_4088170881445143_8138324132275675252_n.jpg?stp=dst-jpg_s60x60_tt6&_nc_cat=101&ccb=1-7&_nc_sid=c53f8f&_nc_ohc=E54VvdMHySUQ7kNvwEnvChq&_nc_oc=AdqCjHz2Z3FCDYuoYTlBrei5fT0yOdXr6n78q...",219        "likes": 39491776220      }221    }222  },223  "cursor": "eyJrIjoiZmJhZHMiLCJjIjoiQVFIVEZfamZkd1hQZjYwUk9Ld3A0Qk1QeGlCM1BiN2pxYkc3dEtlbEhXSmJMc3hnb29XbnFjbWRnUUJCMEJ0Y3RGcW8iLCJwIjoiMTUwODcwMjM0NDQifQ",224  "has_more": true225}

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.

CodeHTTPRetryMeaning
invalid_params400noA parameter is missing, unknown or has the wrong type.
not_found404noThe 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.

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.