Search ads
search_adsSearch the public Meta Ad Library (Facebook, Instagram, Messenger, Audience Network, Threads) for ads by keyword and/or advertiser.
Cost: 1 credit per call, whatever the number of ads returned (an empty result too);
an error costs 0. `limit` (max 30, one page of the Ad Library) does not change the cost:
keep it small only to keep the answer short. The next page is a new call (1 credit).
Args:
query: Keyword or phrase (1-100 chars). Required unless page_id is given.
page_id: Restrict to one advertiser (numeric page ID, see search_pages).
country: ISO-3166 alpha-2 country where the ads ran (e.g. 'IT', 'US') or 'ALL'.
status: 'active' (default), 'inactive' or 'all'.
ad_type: 'all' or 'political' (political & issue ads, with spend/impressions).
media_type: 'all', 'image', 'video', 'meme' or 'none'.
platforms: Subset of facebook, instagram, messenger, audience_network, threads.
languages: ISO-639-1 language codes of the ad text (e.g. ['it', 'en']).
active_from: YYYY-MM-DD; ads running at some point from this date.
active_to: YYYY-MM-DD; ads running at some point up to this date.
match: 'any' (all words, default) or 'exact' (exact phrase).
sort: 'relevance' (default), 'impressions' (most impressions first) or 'longevity'
(longest-running first: days_active, applied to the returned page).
min_days_active: Keep only ads running for at least this many days (applied to the
returned page, so fewer ads may come back; same cost). Long-running ads are
the ones that work ("winning ads"): each ad has days_active and a 0-100
winning_score (longevity, variants, EU reach).
limit: Ads per page, 1-30 (default 10).
cursor: next_cursor from a previous call, to get the next page (same filters).
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "search_ads"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sort | No | relevance | |
| limit | No | ||
| match | No | any | |
| query | No | ||
| cursor | No | ||
| status | No | active | |
| ad_type | No | all | |
| country | No | ALL | |
| page_id | No | ||
| active_to | No | ||
| languages | No | ||
| platforms | No | ||
| media_type | No | all | |
| active_from | No | ||
| min_days_active | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |