Search ads in the Meta Ad Library
meta_ads_searchSearch ads running on Facebook, Instagram and Meta’s other apps by keyword or advertiser, with filters for country, active status, ad category, media type, platform, language and dates. Each ad includes its text, images, videos, carousel cards, link, call to action, run dates, platforms and advertiser, plus spend, impressions and the paid-for-by disclaimer for ads about social issues, elections or politics. Read-only: returns public data and changes nothing. Costs 1 credit per result returned, with a minimum of 1 credit per request.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"exactPhrase": "<exactPhrase>",
"country": "<country>",
"activeStatus": "<activeStatus>",
"adType": "<adType>",
"mediaType": "<mediaType>",
"sortBy": "<sortBy>",
"count": "<count>"
},
"name": "meta_ads_search"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| q | No | Keywords to search the ads’ text for, e.g. "running shoes". Leave it out to list every ad matching the other filters. | |
| count | Yes | Number of results to return (1–30). Defaults to 10. | |
| adType | Yes | Ad category: "all", "political_and_issue_ads" (social issues, elections or politics), "housing_ads", "employment_ads" or "credit_ads". Defaults to "all". | all |
| cursor | No | The previous response's `nextCursor`, to fetch the next page. Omit it for the first page. | |
| pageId | No | Only return ads from this advertiser: its Facebook Page ID, e.g. "15087023444", as returned in `page.id` or by the advertiser search. The Ad Library link of the advertiser’s ads (`?view_all_page_id=<id>`) works too. | |
| sortBy | Yes | Order of the ads: most seen first ("impressions"), or recently started ads first ("recent"), which Meta orders roughly rather than strictly by start date. Defaults to "impressions". | impressions |
| country | Yes | Two-letter country code to search ads shown in, e.g. "US" or "GB", or "ALL" for every country. Defaults to "ALL". | ALL |
| endDate | No | Only return ads that ran on or before this date (YYYY-MM-DD), e.g. "2026-03-31". | |
| cacheOnly | No | Return only a cached result and never scrape live. With `cacheMaxAgeHours`, only a result that recent is returned; without it, the latest cached result of any age. Responds 404, at no cost, when there is none, e.g. true. | |
| languages | No | Only return ads in these languages, as two-letter codes, e.g. ["en", "es"]. | |
| mediaType | Yes | Media in the ad: "all", "image", "meme", "image_and_meme", "video", or "none" for ads with no image or video. Defaults to "all". | all |
| platforms | No | Only return ads running on these platforms, e.g. ["instagram"]. Leave it out for every platform. | |
| startDate | No | Only return ads that ran on or after this date (YYYY-MM-DD), e.g. "2026-01-01". | |
| exactPhrase | Yes | Match `q` as an exact phrase instead of matching any ad that has all its words. Defaults to false. | |
| activeStatus | Yes | Return ads that are still running ("active"), that stopped ("inactive"), or both ("all"). Defaults to "active". | active |
| cacheMaxAgeHours | No | Accept a cached result scraped up to this many hours ago. A cached result costs no credits, and its `cachedAt` says when it was scraped. When no cached result is that recent, the data is scraped live at the normal price. Leave it out to always scrape live, e.g. 24. |