1. Platforms
  2. Facebook Scraper API
  3. Facebook Ad Library advertiser search API

Facebook Ad Library advertiser search API

Advertisers matching a name: Ad Library page id, category, likes, verification and Instagram details.

GET api.socialscrape.dev/v1/facebook/ad-library/search/companies

Cost
1 credit
Cached repeats
0 creditssend max_age_days, results kept 30 days
Failed requests
0 credits

Use the page id with company/ads. Meta closes its advertiser typeahead, so these are the pages behind the ads a search for the name returns (up to 10, name matches first), each completed from the ad-details query; ad_count is not available.

You send query.

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/search/companies" \2  -H "x-api-key: $SOCIALSCRAPE_API_KEY" \3  --data-urlencode 'query=nike'

Parameters

NameTypeRequiredDescription
querystringyesSearch terms. Also accepted as keyword, q.
cursorstringOpaque 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.

Every request also accepts trim, raw and max_age_days.

Response

Sample from a recorded response, shortened. Values are examples, not your data.

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_d42b11390eaf7bfb7c1099f7",8  "data": {9    "object": "list",10    "items": [11      {12        "object": "advertiser",13        "platform": "facebook",14        "id": "15087023444",15        "name": "Nike",16        "url": "https://facebook.com/nike",17        "page_id": "15087023444",18        "country": null,19        "verified": true,20        "ad_count": null,21        "extra": {22          "ads_in_results": 8,23          "alias": "nike",24          "categories": [25            "Sportswear",26            "Product/service"27          ],28          "category": "Sportswear Store",29          "cover_url": "https://scontent-lga3-3.xx.fbcdn.net/v/t39.30808-6/285211224_10159903868008445_5477337468887983165_n.png?_nc_cat=102&ccb=1-7&_nc_sid=957871&_nc_ohc=53UQOnRTJ...",30          "entity_type": "PERSON_PROFILE"31        }32      },33      {34        "object": "advertiser",35        "platform": "facebook",36        "id": "146705838515566",37        "name": "Sukeban World",38        "url": "https://facebook.com/61551864263186",39        "page_id": "146705838515566",40        "country": null,41        "verified": false,42        "ad_count": null,43        "extra": {44          "ads_in_results": 1,45          "categories": [46            "Sports league"47          ],48          "category": "Sports league",49          "cover_url": "https://scontent-lga3-2.xx.fbcdn.net/v/t39.30808-6/509313384_10106078306132770_1968421726604544597_n.jpg?_nc_cat=105&ccb=1-7&_nc_sid=957871&_nc_ohc=ladQaK-N8...",50          "entity_type": "PERSON_PROFILE",51          "image_url": "https://scontent-lga3-2.xx.fbcdn.net/v/t39.30808-1/380760046_10105090366990730_3531502738674670798_n.jpg?stp=dst-jpg_s148x148_tt6&_nc_cat=101&ccb=1-7&_nc_sid..."52        }53      }54    ],55    "cursor": null,56    "has_more": false,57    "parent": null58  },59  "cursor": null,60  "has_more": false61}

Fields

A page of results. Each entry in items is a Advertiser. 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.

FieldTypeAlwaysNotes
object"advertiser"
platformPlatformyesthe ad library's platform
idstring or null
namestring or null
urlstring or null
page_idstring or null
countrystring or null
verifiedboolean or null
ad_countinteger or null
extraobject or null

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_search_companies(...) and the TypeScript client client.facebook.adLibrarySearchCompanies(). 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.