API para Facebook

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).

POST/v1/run/facebook.search_posts
Disponibilidade
99,23%
30d · 1.435 chamadas
Requisições
1.438
30d · semanal, últimas 12 sem.
Resposta
20,2s
mediana · 30d

Teste

Faça sua primeira requisição

Abrir em
Obter chave grátis
Resposta de exemplo
Execuções grátis retornam só os primeiros 3 resultados. Recarregue uma chave para receber a resposta completa.
{
  "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 da resposta
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 30d
POST /v1/run/facebook.search_posts
curl -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"}'
CampoTipoValor de exemplo
Corpo da requisição
querystring"nike"Palavra-chave ou frase para buscar posts do Facebook (ex.: 'product launch').
endDatestringRetorna apenas posts publicados nesta data ou antes, no formato YYYY-MM-DD (ex.: 2024-12-31).
limitinteger3Número máximo de resultados a retornar (1-20, padrão 20).
locationstringLocalização opcional para restringir os resultados; inclua cidade e país para melhores correspondências (ex.: 'Paris, France').
startDatestringRetorna apenas posts publicados nesta data ou depois, no formato YYYY-MM-DD (ex.: 2024-01-01).
Resposta
dataobject
data.albumPreviewobject[]Preview of the photos attached to the post.
data.albumPreview[].idstringNumeric Facebook id of the photo, as a string.
data.albumPreview[].imagestringImage URL of the photo.
data.albumPreview[].typestringKind of attachment, e.g. "photo".
data.albumPreview[].urlstringCanonical Facebook URL of the photo.
data.authorIdstringNumeric Facebook id of the page or profile that posted, as a string.
data.authorImagestringProfile picture URL of the page or profile that posted.
data.imagesCountintegerNumber of images attached to the post. Null when the source does not report it.
data.itemsobject[]Matching public Facebook post records for the query. Populated whenever the provider has data for the entity.
data.items[].authorNamestringDisplay name of the post's author. Empty when the upstream omits it.
data.items[].authorUrlstringCanonical profile URL of the post's author, with tracking query params stripped. Empty when the upstream omits it.
data.items[].commentCountintegerTotal number of comments on the post.
data.items[].createdUtcnumberUTC epoch timestamp in seconds (Unix time). Multiply by 1000 for a JS Date in milliseconds.
data.items[].idstringThe post's numeric Facebook ID, as a string. Populated whenever the provider has data for the entity.
data.items[].imagestringURL of the post's primary image, with tracking query params stripped. Empty for text-only or video posts.
data.items[].reactionCountintegerTotal number of reactions on the post.
data.items[].shareCountintegerTotal number of shares/reshares of the post.
data.items[].textstringThe post's text/message. Empty for media-only posts with no caption.
data.items[].urlstringCanonical URL of the post, with tracking query params stripped. Populated whenever the provider has data for the entity.
data.reactionsobjectReaction counts on the post, broken down by reaction type.
data.reactions.angryintegerAngry reactions.
data.reactions.careintegerCare reactions.
data.reactions.hahaintegerHaha reactions.
data.reactions.likeintegerLike reactions.
data.reactions.loveintegerLove reactions.
data.reactions.sadintegerSad reactions.
data.reactions.wowintegerWow reactions.
data.typestringKind of record Facebook returned, e.g. "post".
foundbooleanWhether 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çãoUSDUS$ 0,03
Preço /mil req.USDUS$ 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.

Custa a partir de US$ 30 por mil requisições, em dólares, sem assinatura e sem mínimo mensal. Você recarrega uma carteira em dólares e cada chamada desconta dela. Algumas requisições pagas pela carteira que falham geram cobranças de processamento, que repassamos pelo custo, sem margem; a resposta de erro mostra o valor cobrado.

Busque posts públicos do Facebook por palavra-chave, opcionalmente filtrados por localização, e receba registros estruturados de posts (texto, autor, engajamento). A resposta é JSON normalizado, com o mesmo envelope que todo endpoint da AnyAPI retorna, então processar um segundo endpoint é só trocar a URL, e nada mais.

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. Estas são medições da própria AnyAPI sobre o tráfego que passa pelo gateway, recalculadas continuamente, e não uma meta de nível de serviço publicada.