API para Facebook: Buscar posts
Busque posts públicos do Facebook por palavra-chave, opcionalmente filtrados por localização, e receba registros estruturados de posts (texto, autor, engajamento).
Rede de provedores
Provedores ordenados por tráfego
com teto de US$ 0,0661 por requisição1 resultadoUS$ 0,0033611 resultadosUS$ 0,0363621 resultadosUS$ 0,0661 (teto)Você paga pelo que volta. Reduza o limite para pagar menos - e nenhuma requisição custa mais que o teto, não importa quanto volte.
Teste
Faça sua primeira requisição
{
"data": {
"albumPreview": [
{
"id": "a1b2c3d4",
"image": "https://example.com/image.jpg",
"type": "general",
"url": "https://example.com/page"
}
],
"authorId": "Alex Rivera",
"authorImage": "https://example.com/image.jpg",
"imagesCount": 12500,
"items": [
{
"authorName": "Alex Rivera",
"authorUrl": "https://example.com/page",
"commentCount": 12500,
"createdUtc": 12.5,
"id": "a1b2c3d4",
"image": "https://example.com/image.jpg",
"reactionCount": 12500,
"shareCount": 13,
"text": "A short example description of this item.",
"url": "https://example.com/page"
}
],
"reactions": {
"angry": 42,
"care": 42,
"haha": 42,
"like": 12500,
"love": 42,
"sad": 42,
"wow": 42
},
"type": "general"
},
"found": true,
"reason": "not_found"
}interface FacebookSearchPostsResponse {
data: {
albumPreview?: {
id?: string;
image?: string;
type?: string;
url?: string;
}[];
authorId?: string;
authorImage?: string;
imagesCount?: number | null;
items: {
authorName?: string;
authorUrl?: string;
commentCount?: number;
createdUtc: number;
id: string;
image?: string;
reactionCount?: number;
shareCount?: number;
text: string;
url: string;
}[];
reactions?: {
angry?: number;
care?: number;
haha?: number;
like?: number;
love?: number;
sad?: number;
wow?: number;
};
type?: string;
} | 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.search_posts \
-H "Authorization: Bearer $ANYAPI_KEY" \
-H "Content-Type: application/json" \
-d '{"limit":3,"query":"nike"}'| Campo | Tipo | Valor de exemplo |
|---|---|---|
| Corpo da requisição | ||
| query | string | "nike"Palavra-chave ou frase para buscar posts do Facebook (ex.: 'product launch'). |
| endDate | string | Retorna apenas posts publicados nesta data ou antes, no formato YYYY-MM-DD (ex.: 2024-12-31). |
| limit | integer | 3Número máximo de resultados a retornar (1-20, padrão 20). |
| location | string | Localização opcional para restringir os resultados; inclua cidade e país para melhores correspondências (ex.: 'Paris, France'). |
| startDate | string | Retorna apenas posts publicados nesta data ou depois, no formato YYYY-MM-DD (ex.: 2024-01-01). |
| Resposta | ||
| data | object | |
| data.albumPreview | object[] | Preview of the photos attached to the post. |
| data.albumPreview[].id | string | Numeric Facebook id of the photo, as a string. |
| data.albumPreview[].image | string | Image URL of the photo. |
| data.albumPreview[].type | string | Kind of attachment, e.g. "photo". |
| data.albumPreview[].url | string | Canonical Facebook URL of the photo. |
| data.authorId | string | Numeric Facebook id of the page or profile that posted, as a string. |
| data.authorImage | string | Profile picture URL of the page or profile that posted. |
| data.imagesCount | integer | Number of images attached to the post. Null when the source does not report it. |
| data.items | object[] | Matching public Facebook post records for the query. Populated whenever the provider has data for the entity. |
| data.items[].authorName | string | Display name of the post's author. Empty when the upstream omits it. |
| data.items[].authorUrl | string | Canonical profile URL of the post's author, with tracking query params stripped. Empty when the upstream omits it. |
| data.items[].commentCount | integer | Total number of comments on the post. |
| data.items[].createdUtc | number | UTC epoch timestamp in seconds (Unix time). Multiply by 1000 for a JS Date in milliseconds. |
| data.items[].id | string | The post's numeric Facebook ID, as a string. Populated whenever the provider has data for the entity. |
| data.items[].image | string | URL of the post's primary image, with tracking query params stripped. Empty for text-only or video posts. |
| data.items[].reactionCount | integer | Total number of reactions on the post. |
| data.items[].shareCount | integer | Total number of shares/reshares of the post. |
| data.items[].text | string | The post's text/message. Empty for media-only posts with no caption. |
| data.items[].url | string | Canonical URL of the post, with tracking query params stripped. Populated whenever the provider has data for the entity. |
| data.reactions | object | Reaction counts on the post, broken down by reaction type. |
| data.reactions.angry | integer | Angry reactions. |
| data.reactions.care | integer | Care reactions. |
| data.reactions.haha | integer | Haha reactions. |
| data.reactions.like | integer | Like reactions. |
| data.reactions.love | integer | Love reactions. |
| data.reactions.sad | integer | Sad reactions. |
| data.reactions.wow | integer | Wow reactions. |
| data.type | string | Kind of record Facebook returned, e.g. "post". |
| found | boolean | Whether any matching posts were returned for the query. |
| 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,03 |
| Preço /mil req. | USD | US$ 30,00 |
Dúvidas frequentes
Sobre o endpoint Buscar posts da API para Facebook
O endpoint Buscar posts da AnyAPI para Facebook retorna dados de Facebook em JSON normalizado com uma chamada POST para /v1/run/facebook.search_posts. Busque posts públicos do Facebook por palavra-chave, opcionalmente filtrados por localização, e receba registros estruturados de posts (texto, autor, engajamento). A AnyAPI distribui cada requisição entre 2 fontes, com failover automático quando uma falha. Custa a partir de US$ 30 por mil requisições, em dólares, sem assinatura e sem mínimo mensal. Nos últimos 30 dias, 99,2% das chamadas ao endpoint Buscar posts da API para Facebook feitas pela AnyAPI tiveram sucesso, com tempo de resposta mediano de 20,2 segundos, em 1.435 chamadas medidas.