API para Facebook: Busca de anúncios
Busque na Biblioteca de Anúncios da Meta por palavra-chave e receba os anúncios correspondentes (anunciante, texto do criativo, CTA, plataformas e datas de veiculação) com paginação por cursor.
Rede de provedores
Provedores ordenados por tráfego
Teste
Faça sua primeira requisição
{
"data": {
"ads": [
{
"active": true,
"adCount": 12500,
"caption": "A short example description of this item.",
"categories": [
"example"
],
"ctaText": "A short example description of this item.",
"ctaType": "general",
"displayFormat": "example",
"endDate": 42,
"id": "a1b2c3d4",
"isReshared": true,
"linkDescription": "https://example.com/page",
"linkUrl": "https://example.com/page",
"media": [
{
"height": 42,
"type": "general",
"url": "https://example.com/page",
"videoUrl": "https://example.com/page",
"width": 1024
}
],
"pageCategories": [
"example"
],
"pageDeleted": false,
"pageId": "a1b2c3d4",
"pageLikes": 12500,
"pageName": "Example title",
"pageProfilePicture": "https://example.com/image.jpg",
"pageUrl": "https://example.com/page",
"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,
"reason": "not_found"
}interface FacebookAdsSearchResponse {
data: {
ads: {
active: boolean;
adCount: number | null;
caption?: string;
categories?: string[];
ctaText: string;
ctaType: string;
displayFormat: string;
endDate: number;
id: string;
isReshared?: boolean;
linkDescription?: string;
linkUrl: string;
media?: {
height?: number;
type: string;
url: string;
videoUrl?: string;
width?: number;
}[];
pageCategories?: string[];
pageDeleted?: boolean;
pageId: string;
pageLikes?: number;
pageName: string;
pageProfilePicture?: string;
pageUrl?: string;
platforms: string[];
sourceUrl: string;
startDate: number;
text: string;
title: string;
}[];
nextCursor: string | null;
totalResults: number | null;
} | null;
found: boolean;
reason?: "not_found";
}Referência completa de parâmetros e resposta - todos os campos, tipos e exemplos deste endpoint.
Referência
Requisição, resposta e preço
Última verificação em 2026-09-29 · disponibilidade e latência medidas em 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"}'| Campo | Tipo | Valor de exemplo |
|---|---|---|
| Corpo da requisição | ||
| query | string | "nike"Palavra-chave a buscar na Biblioteca de Anúncios da Meta (ex.: "protein powder"). |
| adType | enum | Restringe a todos os anúncios (padrão) ou apenas anúncios políticos e sobre temas sociais. |
| country | string | "US"Código de país de duas letras para delimitar os resultados. Omita para todos os países. |
| cursor | string | Cursor de paginação opaco do nextCursor de uma resposta anterior. |
| endDate | string | Filtra anúncios com impressões nesta data ou antes, no formato YYYY-MM-DD. |
| mediaType | enum | Filtro de tipo de mídia do criativo. |
| requireFields | array | Opcional; se omitido, o roteamento não muda e a fonte mais barata atende. Informe os campos de saída que esta requisição precisa poder retornar, por exemplo `totalResults`, e ela só será atendida por uma fonte que retorne todos eles. Os campos que você não informar continuam sendo retornados sempre que a fonte que atende os tiver. Isso pode aumentar o seu preço: quando a fonte mais barata não consegue retornar um campo informado, uma fonte mais cara atende, e você recebe a cotação e é cobrado pelo preço dela. Um campo informado ainda pode vir ausente em um anúncio que realmente não o tenha. Se você informar uma combinação de campos que nenhuma fonte retorna sozinha, a requisição é recusada como entrada inválida, sem cobrança. |
| searchType | enum | "keyword_exact_phrase"Modo de correspondência da consulta: palavra-chave flexível (keyword_unordered, o padrão) ou frase exata (keyword_exact_phrase). |
| sortBy | enum | Ordenação: impressions (mais impressões primeiro, o padrão) ou recent (mais recentes). |
| startDate | string | Filtra anúncios com impressões nesta data ou depois, no formato YYYY-MM-DD. |
| status | enum | Filtro de status do anúncio. |
| Resposta | ||
| data | object | |
| data.ads | object[] | |
| data.ads[].active | boolean | |
| data.ads[].adCount | integer | Number of ads in this campaign (collation count). Null when the source does not report it. |
| data.ads[].caption | string | Caption line of the ad creative, usually the advertiser's display domain. |
| data.ads[].categories | string[] | Ad Library categories the ad is filed under. |
| 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[].isReshared | boolean | Whether the ad creative is a reshare of another post. |
| data.ads[].linkDescription | string | Description text shown under the ad's link. |
| 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[].pageCategories | string[] | Categories Facebook lists the advertising page under. |
| data.ads[].pageDeleted | boolean | Whether the advertising page has been deleted. |
| data.ads[].pageId | string | Populated whenever the provider has data for the entity. |
| data.ads[].pageLikes | integer | Like count of the advertising page. |
| 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[].pageUrl | string | Canonical Facebook URL of the advertising page. |
| 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.totalResultspode ser exigido | integer | Total number of ads matching the search. Null when the source cannot report an exact count. |
| found | boolean | |
| reason | "not_found" | Present only when `found` is false, and says why there is no result. `not_found`: the source states the target does not exist, or returned nothing for it. A `found: false` answer is a successful call, not an error, and `costUsd` is what it actually cost. |
| Preço | ||
| Preço por requisição | USD | US$ 0,0012 |
| Preço /mil req. | USD | US$ 1,20 |
Dúvidas frequentes
Sobre o endpoint Busca de anúncios da API para Facebook
O endpoint Busca de anúncios da AnyAPI para Facebook retorna dados de Facebook em JSON normalizado com uma chamada POST para /v1/run/facebook.ads_search. Busque na Biblioteca de Anúncios da Meta por palavra-chave e receba os anúncios correspondentes (anunciante, texto do criativo, CTA, plataformas e datas de veiculação) com paginação por cursor. A AnyAPI distribui cada requisição entre 3 fontes, com failover automático quando uma falha. Custa a partir de US$ 1,20 por mil requisições, em dólares, sem assinatura e sem mínimo mensal. Nos últimos 30 dias, 99,8% das chamadas ao endpoint Busca de anúncios da API para Facebook feitas pela AnyAPI tiveram sucesso, com tempo de resposta mediano de 2,8 segundos, em 4.514 chamadas medidas.