Facebook hub

Facebook Ad Library Search API

Keyword search across Meta's Ad Library — query in, structured ad rows out, same envelope as the rest of the Facebook tag.

GET /v1/facebook/ad-library/ads/search

1 credit per successful request.

About this endpoint

Competitor creative research still starts in Facebook's Ad Library. Clicking through the public UI works for a few brands; it falls apart when you need recurring keyword sweeps, country slices, or a warehouse that already stores Instagram and TikTok rows in one schema.

`GET /v1/facebook/ad-library/ads/search` takes a required `query` string and returns matching Ad Library ads in the shared Social Fetch envelope. Optional filters narrow the page: `sortBy` (`impressions`, `most-recent`), `searchType` (`keyword-unordered`, `exact-phrase`), `adType`, `country` (two-letter code or `ALL`), `status`, `mediaType`, plus `startDate` / `endDate` as `YYYY-MM-DD`. When `data.page.hasMore` is true, pass `data.page.nextCursor` as `cursor` on the next call. Bill from `meta.creditsCharged`.

This route is keyword ads search. For one known archive id or Ad Library URL, use `GET /v1/facebook/ad-library/ads`. To find advertisers by name, use company search; to list ads for a known page, use company ads. All of them share one Social Fetch API key.

Facebook Ad Library Search API FAQ

What does the Facebook Ad Library Search API return?

A page of Ad Library ads that match your keyword query under data.ads, the echoed query under data.query, and pagination under data.page (hasMore, nextCursor, totalResultsEstimate). Each response uses the shared Social Fetch envelope with meta.requestId and meta.creditsCharged.

How do I call Facebook Ad Library keyword search?

Send GET /v1/facebook/ad-library/ads/search with x-api-key and a required query parameter. Optionally add sortBy, searchType, adType, country, status, mediaType, startDate, endDate, cursor, and trim. Full enums and examples are in the API docs.

How much does Facebook Ad Library ads search cost?

Pricing is documented on the operation in the API registry (shown on this page). Confirm on every response with meta.creditsCharged — that field is the billing source of truth. Each paginated page is a separate billed request.

Is this the same as getting one Facebook Ad Library ad by id?

No. GET /v1/facebook/ad-library/ads/search finds ads by keyword and filters. GET /v1/facebook/ad-library/ads returns a single ad when you already have an archive id or Ad Library URL.

Can I filter Ad Library search by country, status, or media?

Yes. country accepts ALL or a two-letter country code. status accepts all, active, or inactive. mediaType accepts all, image, video, meme, image-and-meme, or none. Keep the same query and filters when you paginate with cursor.

How does pagination work on Facebook Ad Library search?

When data.page.hasMore is true, pass data.page.nextCursor as the cursor query param on the next request. Do not treat totalResultsEstimate as an exact count or as the only end-of-results signal.

Do I need a Meta ads account or Marketing API token to search?

No. You authenticate to Social Fetch with an API key. The route reads public Ad Library search results; it does not act on behalf of an ads account you manage.