Search ads
ads_ads_searchMeta Ad Library API: Search ads. Ads matching a keyword or an advertiser page, with filters, up to 30 per call. Every ad carries days_active (whole days from started_at to ended_at, or to today while it runs; null when unknown) and winning_score (0-100, null when days_active is null): long-running ads are the ones that pay off. score = L + V + R, with L = 70 x min(days_active, 90) / 90, V = 15 x min(variants_count - 1, 9) / 9 and R = 15 x min(log10(1 + EU reach) / 6, 1). The EU reach is only in the single-ad lookup, so in lists score = (L + V) x 100 / 85: a missing reach never lowers it. Rounded to the nearest integer. min_days_active and sort=longevity apply to the ads of the returned page, at the same price. Price: 5 credits per call; failed calls are free. Paginated: pass pagination.next_cursor as cursor for the next page (each page is a new call). One of q, page_id is required.
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": "ads_ads_search"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| q | No | Keyword (required unless `page_id` is set) | |
| sort | No | Order. `longevity` puts the longest-running ads of the page first. | relevance |
| limit | No | Ads per page (max 30, one page of the source) | |
| match | No | Keyword match | any |
| cursor | No | `pagination.next_cursor` of the previous page | |
| status | No | Ad status | active |
| ad_type | No | All ads or political/issue ads | all |
| country | No | Two-letter country code or `ALL` | ALL |
| page_id | No | Only ads of this advertiser page | |
| active_to | No | Running on or before (YYYY-MM-DD) | |
| languages | No | Comma-separated ISO 639-1 codes | |
| platforms | No | Comma-separated: facebook, instagram, messenger, audience_network | |
| media_type | No | Creative type | all |
| active_from | No | Running on or after (YYYY-MM-DD) | |
| min_days_active | No | Keep only ads running for at least this many days (applied to the returned page, same price) |