Search the Meta ad library by keyword
meta-ad-library.meta-ads.library.searchSearch publicly running Facebook and Instagram ads by keyword
- Price
- freeA precio de catálogo
- Success rate
- —Aún no hay datos de tasa de éxitoAún no hay datos de tasa de éxito
- Latency p50
- ——
- Last verified
- —Not verified yet
GEThttps://toolswitch.dev/v1/tools/meta-ad-library.meta-ads.library.searchBeta- Uses platform quota
- Synchronous response
- Reads public data
Parámetros
give it either search_terms or search_page_ids — a call with neither returns an error, not the whole library. ad_snapshot_url is the human-viewable render of the creative and needs the access token appended to load. Results are ads Meta has KEPT: commercial ads leave the library some time after they stop running, so this is a live-ish view, not an archive
| Parámetro | Tipo | Obligatorio | Descripción | Ejemplo |
|---|---|---|---|---|
| Parámetros de consulta | ||||
after | cadena | Opcional | paging.cursors.after from the previous response | |
limit | entero | Opcional | page size; 25 by default, a few hundred is the practical ceiling before Meta starts timing out | 25 |
fields | cadena | Obligatorio | comma-separated; nothing but id comes back by default | id,page_id,page_name,ad_creative_bodies,ad_creative_link_titles,ad_creative_link_captions,ad_snapshot_url,ad_delivery_start_time,ad_delivery_stop_time,publisher_platforms,languages,estimated_audience_size |
ad_type | cadena | Opcional | ALL (default) | POLITICAL_AND_ISSUE_ADS | HOUSING_ADS | EMPLOYMENT_ADS | FINANCIAL_PRODUCTS_AND_SERVICES_ADS | ALL |
languages | matriz | Opcional | ISO 639-1 codes (plus CMN, YUE) | ["en"] |
media_type | cadena | Opcional | ALL | IMAGE | MEME | VIDEO | NONE | VIDEO |
search_type | cadena | Opcional | KEYWORD_UNORDERED (default, all words in any order) | KEYWORD_EXACT_PHRASE | KEYWORD_UNORDERED |
search_terms | cadena | Opcional | max 100 characters; matched against the ad's text. Required in practice unless you filter by search_page_ids instead | project management software |
ad_active_status | cadena | Opcional | ACTIVE (default) | INACTIVE | ALL — ALL is what you want for creative research, since a competitor's best-performing ad may have finished | ALL |
publisher_platforms | matriz | Opcional | FACEBOOK | INSTAGRAM | AUDIENCE_NETWORK | MESSENGER | WHATSAPP | OCULUS | THREADS | ["INSTAGRAM"] |
ad_delivery_date_max | cadena | Opcional | YYYY-MM-DD | |
ad_delivery_date_min | cadena | Opcional | YYYY-MM-DD; ads that were delivering on or after this date | 2026-06-01 |
ad_reached_countries | matriz | Obligatorio | REQUIRED on every ads_archive call. JSON array of ISO country codes, URL-encoded — ["US"] — or ALL | ["US"] |
estimated_audience_size_min | entero | Opcional | one of the fixed buckets 100 | 1000 | 5000 | 10000 | 50000 | 100000 | 500000 | 1000000 | |
- Parámetros de consulta
aftercadenaOpcionalpaging.cursors.after from the previous response
limitenteroOpcionalpage size; 25 by default, a few hundred is the practical ceiling before Meta starts timing out
Ejemplo:
25fieldscadenaObligatoriocomma-separated; nothing but id comes back by default
Ejemplo:
id,page_id,page_name,ad_creative_bodies,ad_creative_link_titles,ad_creative_link_captions,ad_snapshot_url,ad_delivery_start_time,ad_delivery_stop_time,publisher_platforms,languages,estimated_audience_sizead_typecadenaOpcionalALL (default) | POLITICAL_AND_ISSUE_ADS | HOUSING_ADS | EMPLOYMENT_ADS | FINANCIAL_PRODUCTS_AND_SERVICES_ADS
Ejemplo:
ALLlanguagesmatrizOpcionalISO 639-1 codes (plus CMN, YUE)
Ejemplo:
["en"]media_typecadenaOpcionalALL | IMAGE | MEME | VIDEO | NONE
Ejemplo:
VIDEOsearch_typecadenaOpcionalKEYWORD_UNORDERED (default, all words in any order) | KEYWORD_EXACT_PHRASE
Ejemplo:
KEYWORD_UNORDEREDsearch_termscadenaOpcionalmax 100 characters; matched against the ad's text. Required in practice unless you filter by search_page_ids instead
Ejemplo:
project management softwaread_active_statuscadenaOpcionalACTIVE (default) | INACTIVE | ALL — ALL is what you want for creative research, since a competitor's best-performing ad may have finished
Ejemplo:
ALLpublisher_platformsmatrizOpcionalFACEBOOK | INSTAGRAM | AUDIENCE_NETWORK | MESSENGER | WHATSAPP | OCULUS | THREADS
Ejemplo:
["INSTAGRAM"]ad_delivery_date_maxcadenaOpcionalYYYY-MM-DD
ad_delivery_date_mincadenaOpcionalYYYY-MM-DD; ads that were delivering on or after this date
Ejemplo:
2026-06-01ad_reached_countriesmatrizObligatorioREQUIRED on every ads_archive call. JSON array of ISO country codes, URL-encoded — ["US"] — or ALL
Ejemplo:
["US"]estimated_audience_size_minenteroOpcionalone of the fixed buckets 100 | 1000 | 5000 | 10000 | 50000 | 100000 | 500000 | 1000000
Ejemplos de código
Sustituye $TOOLSWITCH_KEY por la clave que creaste en la consola.
curl -X GET 'https://toolswitch.dev/v1/tools/meta-ad-library.meta-ads.library.search' \
-H "X-Toolswitch-Key: $TOOLSWITCH_KEY"import os
import requests
response = requests.request(
"GET",
"https://toolswitch.dev/v1/tools/meta-ad-library.meta-ads.library.search",
headers={"X-Toolswitch-Key": os.environ["TOOLSWITCH_KEY"]},
)
response.raise_for_status()
print(response.text)const response = await fetch("https://toolswitch.dev/v1/tools/meta-ad-library.meta-ads.library.search", {
method: "GET",
headers: {
"X-Toolswitch-Key": process.env.TOOLSWITCH_KEY ?? "",
},
});
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
console.log(await response.text());La API de la pasarela está en Beta; su URL y autenticación pueden cambiar. Los parámetros del ejemplo son datos de muestra. Las llamadas se facturan a free, incluida la tarifa de servicio.