Introducing the Instagram APIRead more →

Facebook Ad Library Search API. Ads matching your search.

Ads by keyword, with creatives and run dates. We handle the proxies, blocks and platform changes.

Facebook Ad Library Search API at a glance

Searches Meta's public Ad Library by keyword and returns the matching ads from Facebook, Instagram, Messenger, Threads and the Audience Network. Each ad has its advertiser, the days it first and last ran, whether it's still active, where it ran and its creatives: headline, text, link, call to action, images and videos. Political and social-issue ads add the payer and Meta's impression, reach and spend ranges. Filter by country, language, status and dates. Ads come most impressions first, the Ad Library's own order.

GET /v1/facebook/search_ads

Read the API reference
  • 1 credit per page, $0.75–$1.97 per 1,000 pages
  • 20 typed fields null when unknown
  • 10 ads per page, most impressions first
  • query is all it needs, e.g. coffee

Send one request. Get up to 10 ads back.

Copy the request in your language, or hand it to your agent. Sign up for an API key and your first 100 credits are free.

$ npm install socialtap
query = coffee
GET /v1/facebook/search_adsTry in
const params = new URLSearchParams({
  country: "US",
  query: "coffee",
});
const res = await fetch(`https://socialtap.dev/v1/facebook/search_ads?${params}`, {
  headers: { "x-api-key": process.env.SOCIALTAP_API_KEY ?? "" },
});
const body = await res.json();
if (!res.ok) throw new Error(`${body.error.code}: ${body.error.message}`);
const { data, page, meta } = body;
console.log(data, meta.credits_charged);
200 OK · GET https://socialtap.dev/v1/facebook/search_adsLong arrays and strings are shortened here. Real responses are complete.Docs

One schema on 4 platforms.

The response reference lists every field, its type and when it is null. See the full schema.

  • Null means unknown

    A field Facebook Ad Library doesn't show is null, never zero or an empty string, so a real zero always means zero.

  • What it accepts

    Keywords matched against the ad's text, in any order. Wrap the query in double quotes ("cold brew") to match an exact phrase.

  • Write one parser

    Facebook Ad Library, TikTok Ad Library, Google Ads Transparency Center and LinkedIn Ad Library answer in these fields, so the code that reads one reads them all.

platformstring
Library owner's platform ID (facebook for Meta's library, tiktok, google, linkedin).
idstring
Library ad ID (string).
urlstring
Public library page of the ad.
advertiserobject
The advertising page, business or account.
paid_bystring
Disclosed payer ("Paid for by").
is_activeboolean
True while the ad is running.
first_shown_atstring
First delivery, RFC 3339 UTC (often date-only: see approximate_fields).
last_shown_atstring
Last delivery, RFC 3339 UTC; null while active.

What teams build with the Facebook Ad Library Search API.

  • Find the most-seen ads for a keyword

  • Research ad copy in a market or niche

  • Track political and issue ad spending

  • Find who advertises on a topic

Good to know before you build.

  • advertiser.id is the Page's own ID. Facebook's posts and comments name a Page by its profile ID: join them to an advertiser by username, not id.
  • Payer, impressions, reach and spend are disclosed only for political and social-issue ads, and are null for other ads.
  • Run dates are whole days in US Pacific time, as Meta reports them, so approximate_fields lists them.
  • since and until keep the ads that ran during the window (first ran before until, and still running or last ran at or after since), in whole days as Meta reports them. A filtered page can hold fewer ads than limit without being the end of the list.
  • Meta groups ads that share a creative, and each ad in a group comes back as its own item.
  • Languages, targeting and EU reach by country are empty or null in search results: the Facebook Ad Library Ad API returns them for one ad.

1 credit per page. Failed requests are free.

Buy credits once and spend them on any endpoint, on any platform.

SourcePrice per successful pagePer 1,000 pages
Platform API api1 credit$0.75–$1.97
  • Cache hits are free.
  • Credits from packs and top-ups never expire.
  • A monthly plan's credits are spent first, and what is left of them ends at each renewal.
  • Prices exclude tax: sales tax is added at checkout where it applies.
  • Outside the US, plans and packs are sold to businesses: checkout asks for your VAT, GST or other business tax ID.

Questions about the Facebook Ad Library Search API.

More in the API reference.

How do I search for an exact phrase?
Wrap it in double quotes, as in "cold brew". Without quotes, every word must appear, in any order.
Which ads does it find?
Any ad in Meta's public Ad Library whose text matches the query, active or inactive, on any of Meta's apps and from any advertiser.
How much does the Facebook Ad Library Search API cost?
A page of up to 10 ads costs 1 credit. Every successful page is charged, empty pages included. SocialTap credits cost $0.75–$1.97 per 1,000, depending on the plan or pack.
How do I get the next page?
Repeat the same request with cursor set to page.next_cursor from the previous response, keeping the other parameters. When page.has_more is false there are no more pages. Cursors expire after 1 hour.

Try it with your own search.

Type it in the playground, or copy the request into your code.

100free credits
  • No credit card
  • Failed requests are free
  • Works on all 218 endpoints
Start for free Read the docs