Meta Ads search API
Search ads in the Meta ad library. Call the Meta Ads search API and get JSON back in one request. 1 credit per call. Failed calls cost nothing.
Request
query is required.
Response
If successful, the response body contains the standard envelope.data.results[] contains the ads that match, each with its page, text, format and platforms.
The following example is a real response, truncated: each list shows one item and long strings are cut.
Optional parameters
Billing
Each successful request consumes 1 credit, regardless of the number of items returned. Requests that fail, or that return no items, are not billed.Pagination
Results are paginated. To retrieve the next page, pass the value ofdata.cursor as cursor in a subsequent request. A response that omits cursor is the last page.
Related methods
- Meta ads by page: Accepts an ad’s
pageIdasadvertiser. Returns the ads a Facebook page runs. - Meta ad details: Accepts
adUrl. Returns a Meta ad’s details.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
1 - 200ISO 3166-1 alpha-2 country code, or all. Any case is accepted.
^(?:[A-Za-z]{2}|[Aa][Ll][Ll])$active, inactive, all The Ad Library's own Media type filter: image, video, or text (no image or video).
image, video, text, meme, imageAndMeme The Ad Library's own Platform filter: only ads shown on at least one of these platforms.
1facebook, instagram, audienceNetwork, messenger, whatsapp, threads The Ad Library's own Language filter: a two-letter code like en. Only ads written in this language.
^[A-Za-z]{2}$The Ad Library's own Impressions by date: ads shown on or after this day.
^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$The Ad Library's own Impressions by date: ads shown on or before this day.
^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$The cursor from the previous response. Send it as is.
1