Facebook Ads search API
Search the Meta Ad Library by keyword and get matching ads (advertiser, creative text, CTA, platforms, and run dates) with cursor pagination.
Provider network
Providers ranked by traffic
Try it
Make your first request
{
"data": {
"ads": [
{
"active": true,
"adCount": 12500,
"ctaText": "A short example description of this item.",
"ctaType": "general",
"displayFormat": "example",
"endDate": 42,
"id": "a1b2c3d4",
"linkUrl": "https://example.com/page",
"media": [
{
"height": 42,
"type": "general",
"url": "https://example.com/page",
"videoUrl": "https://example.com/page",
"width": 1024
}
],
"pageId": "a1b2c3d4",
"pageName": "Example title",
"pageProfilePicture": "https://example.com/image.jpg",
"platforms": [
"example"
],
"sourceUrl": "https://example.com/page",
"startDate": 42,
"text": "A short example description of this item.",
"title": "Example title"
}
],
"nextCursor": "example",
"totalResults": 12500
},
"found": true
}interface FacebookAdsSearchResponse {
data: {
ads: {
active: boolean;
adCount: number;
ctaText: string;
ctaType: string;
displayFormat: string;
endDate: number;
id: string;
linkUrl: string;
media?: {
height?: number;
type: string;
url: string;
videoUrl?: string;
width?: number;
}[];
pageId: string;
pageName: string;
pageProfilePicture?: string;
platforms: string[];
sourceUrl: string;
startDate: number;
text: string;
title: string;
}[];
nextCursor: string | null;
totalResults: number;
} | null;
found: boolean;
}Full parameter and response reference - every field, type, and example for this endpoint.
Reference
Request, response, and price
Last verified 2026-09-16 · uptime and latency measured over 30dcurl -X POST https://api.getanyapi.com/v1/run/facebook.ads_search \
-H "Authorization: Bearer $ANYAPI_KEY" \
-H "Content-Type: application/json" \
-d '{"country":"US","query":"nike","searchType":"keyword_exact_phrase"}'| Field | Type | Example value |
|---|---|---|
| Request body | ||
| query | string | "nike"Keyword to search the Meta Ad Library for (e.g. "protein powder"). |
| adType | enum | Restrict to all ads (default) or only political and issue ads. |
| country | string | "US"Two-letter country code to scope results. Omit for all countries. |
| cursor | string | Opaque pagination cursor from a previous response's nextCursor. |
| endDate | string | Filter to ads with impressions on or before this date, in YYYY-MM-DD format. |
| mediaType | enum | Creative media type filter. |
| searchType | enum | "keyword_exact_phrase"Match mode for the query: loose keyword match (keyword_unordered, the default) or exact phrase (keyword_exact_phrase). |
| sortBy | enum | Sort order: impressions (highest first, the default) or recent (most recent). |
| startDate | string | Filter to ads with impressions on or after this date, in YYYY-MM-DD format. |
| status | enum | Ad status filter. |
| Response | ||
| data | object | |
| data.ads | object[] | |
| data.ads[].active | boolean | |
| data.ads[].adCount | integer | Number of ads in this campaign (collation count). |
| data.ads[].ctaText | string | Populated whenever the provider has data for the entity. |
| data.ads[].ctaType | string | Populated whenever the provider has data for the entity. |
| data.ads[].displayFormat | string | Populated whenever the provider has data for the entity. |
| data.ads[].endDate | integer | Epoch seconds. |
| data.ads[].id | string | Ad Library archive ID. Populated whenever the provider has data for the entity. |
| data.ads[].linkUrl | string | Populated whenever the provider has data for the entity. |
| data.ads[].media | object[] | Creative attached to the ad: one element per image, video, or carousel card, in the order the ad presents them. Empty when the ad has none. |
| data.ads[].media[].height | integer | Pixel height of the media item, when the lane reports it. |
| data.ads[].media[].type | string | One of photo, video, or gif. |
| data.ads[].media[].url | string | Image URL. For a video or GIF this is the poster/thumbnail frame. |
| data.ads[].media[].videoUrl | string | Playable video file URL. Present only for video and gif items. |
| data.ads[].media[].width | integer | Pixel width of the media item, when the lane reports it. |
| data.ads[].pageId | string | Populated whenever the provider has data for the entity. |
| data.ads[].pageName | string | Populated whenever the provider has data for the entity. |
| data.ads[].pageProfilePicture | string | Profile picture of the advertising page. This is the advertiser's identity image, not ad creative. |
| data.ads[].platforms | string[] | Populated whenever the provider has data for the entity. |
| data.ads[].sourceUrl | string | Inspectable Meta Ad Library URL for this ad. Populated whenever the provider has data for the entity. |
| data.ads[].startDate | integer | Epoch seconds. Populated whenever the provider has data for the entity. |
| data.ads[].text | string | Ad body text. Populated whenever the provider has data for the entity. |
| data.ads[].title | string | Populated whenever the provider has data for the entity. |
| data.nextCursor | string | Opaque cursor for the next page of ads, or null when this lane has no more. Pass it back as cursor to continue. |
| data.totalResults | integer | |
| found | boolean | |
| Price | ||
| Price per request | USD | $0.0012 |
| Price /1k req | USD | $1.20 |
FAQ
About the Facebook Ads search API
The AnyAPI Facebook Ads search API returns Facebook ads search data as normalized JSON from one POST call to /v1/run/facebook.ads_search. Search the Meta Ad Library by keyword and get matching ads (advertiser, creative text, CTA, platforms, and run dates) with cursor pagination. AnyAPI routes each request across 2 sources and falls back automatically when one fails. It costs from $1.20 per 1,000 requests, in US dollars with no subscription and no monthly minimum. Over the last 30 days, 91.8% of Facebook ads search calls through AnyAPI succeeded, with a median response time of 2.7 seconds across 759 measured calls.