Sand AISand AI MAGI-2MAGI-2 agora está na SandBase: vídeo em 1080p com áudio nativoExperimente agora

Facebook Post Search

Docs da API
https://api.sandbase.ai/v1/api/facebook/search-posts

Search public Facebook posts by keyword, optionally filtered by location, and get structured post records (text, author, engagement).

Preço
A partir de $0.03USD / chamada
Método
POST
Resposta
JSON
Parâmetros
1 obrigatórios · 5 opcionais

Playground

Entrada
Keyword or phrase to search Facebook posts for (e.g. 'product launch').
120
Maximum number of results to return (1-20, default 20). Intervalo: 1 a 20.
Only return posts published on or before this date, format YYYY-MM-DD (e.g. 2024-12-31).
Optional place name; include both city and country for best matches (e.g. 'Paris, France'). Uses Facebook's place filter, which favors posts tagged at that place rather than every post by people who live there, and can still return some posts from elsewhere.
Only return posts published on or after this date, format YYYY-MM-DD (e.g. 2024-01-01).
Optional; omit it and routing is unchanged, with the cheapest source serving. Name the output fields this request must be able to return, for example `imagesCount` or `albumPreview`, and it is served only by a source that returns every one of them. Fields you do not name are still returned whenever the serving source has them. This can raise your price: when the cheapest source cannot return a named field, a dearer source serves, and you are quoted and charged its price. A named field can still be absent on a post that genuinely lacks it. Naming a combination that no single source returns together is refused as invalid input, with no charge.
SaídaPronto

Sua saída aparecerá aqui

Preencha as entradas e clique em Executar.

README da API

Facebook Post Search API

Returns public Facebook posts that match a keyword or phrase. Each record has the post text, the author, a post URL, and reaction, comment and share counts. The only required input is query, and you can narrow results with location, startDate and endDate.

Use cases

  • Track how people talk about a brand by searching its name and reading the post text.
  • Compare reactionCount, commentCount and shareCount across posts to find the ones that got the most engagement.
  • Find pages that post about a topic by collecting authorName and authorUrl from the results.
  • Pull posts tagged at a city for a local campaign review by setting location to a value like Paris, France.

Request

curl -X POST "https://api.sandbase.ai/v1/api/facebook/search-posts" \
  -H "Authorization: Bearer $SANDBASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"limit": 3, "query": "nike"}'

The result is returned in outputs[0].data.

Parameters

NameTypeRequiredDescription
querystringYesKeyword or phrase to search Facebook posts for (e.g. 'product launch').
endDatestringNoOnly return posts published on or before this date, format YYYY-MM-DD (e.g. 2024-12-31).
limitintegerNoMaximum number of results to return (1-20, default 20).
locationstringNoOptional place name; include both city and country for best matches (e.g. 'Paris, France'). Uses Facebook's place filter, which favors posts tagged at that place rather than every post by people who live there, and can s
requireFieldsarrayNoOptional; omit it and routing is unchanged, with the cheapest source serving. Name the output fields this request must be able to return, for example imagesCount or albumPreview, and it is served only by a source tha
startDatestringNoOnly return posts published on or after this date, format YYYY-MM-DD (e.g. 2024-01-01).

Example response

Real response for the request above, trimmed: lists keep their first item and long strings are cut.

{
  "data": {
    "items": [
      {
        "authorId": "100044541544829",
        "authorImage": "https://scontent.fdtw2-1.fna.fbcdn.net/v/t39.30808-1/284964043_10159903868513445…",
        "authorName": "Nike",
        "authorUrl": "https://www.facebook.com/nike",
        "commentCount": 2882,
        "createdUtc": 1509595630,
        "id": "10155532600988445",
        "image": "https://scontent.fdtw2-1.fna.fbcdn.net/v/t39.30808-6/468501570_10162044654548445…",
        "imagesCount": null,
        "reactionCount": 6019,
        "reactions": {
          "angry": 8,
          "care": 0,
          "haha": 15,
          "like": 4944,
          "love": 1015,
          "sad": 5,
          "wow": 32
        },
        "shareCount": 9413
      }
    ]
  },
  "found": true
}

Response fields

FieldMeaning
data.items[].idID of the post.
data.items[].urlLink to the post on Facebook.
data.items[].textText of the post. Long text may be cut in the response.
data.items[].authorName / data.items[].authorUrlDisplay name and Facebook URL of the page or profile that wrote the post.
data.items[].authorIdID of the author.
data.items[].createdUtcTime the post was created, as a Unix timestamp in seconds.
data.items[].reactionCountTotal reactions on the post.
data.items[].reactions.like / reactions.love / reactions.haha / reactions.wow / reactions.sad / reactions.angry / reactions.careCount of each reaction type on the post.
data.items[].commentCount / data.items[].shareCountNumber of comments and shares on the post.
data.items[].imageURL of the post image. It is an empty string when the post has no image.

Notes

  • Use limit to set how many posts come back, from 1 to 20. The default is 20.
  • startDate and endDate use the YYYY-MM-DD format.
  • imagesCount can be null. To require it, or albumPreview or type, list the name in requireFields. A dearer source may then serve the call, which can raise the price.
  • To read the comments on a post, call Facebook Post Comments. For the full record of one post, use Facebook Post.

Pricing

Billed at the actual cost of each call, about $0.03 for the request above. Failed calls are not charged.

Explorar mais

APIs relacionadas

Todas as APIs
APIPreçoResposta
FacebookA partir de $0.03 por chamadaJSON
FacebookA partir de $0.0012 por chamadaJSON
FacebookA partir de $0.00462 por chamadaJSON
FacebookA partir de $0.0012 por chamadaJSON
FacebookA partir de $0.0011 por chamadaJSON
FacebookA partir de $0.0011 por chamadaJSON

Guias:Best Facebook API in 2026: Pricing Compared

Perguntas

FAQ

Como eu uso a API Facebook Post Search?

Envie uma solicitação POST para https://api.sandbase.ai/v1/api/facebook/search-posts com sua chave de API da SandBase no cabeçalho Authorization (Bearer) e os parâmetros no corpo JSON. Você também pode testar no Playground desta página sem escrever código.

Quanto custa a API Facebook Post Search?

A partir de $0.03 por chamada, cobrado do seu saldo SandBase. Você paga apenas pelas chamadas que fizer; não há assinatura.

Quais parâmetros a API Facebook Post Search aceita?

Obrigatórios: query (string). Opcionais: limit (integer), endDate (string), location (string), startDate (string) e requireFields (array). A tabela de Parâmetros e o Playground nesta página listam todos os campos.

O que a API Facebook Post Search retorna?

Uma resposta JSON retornada na mesma solicitação HTTP (síncrona). O README desta página inclui um exemplo de resposta.

Preciso de uma conta de desenvolvedor Facebook ou de uma chave de API?

Não. Facebook Post Search funciona via SandBase, então uma única chave de API da SandBase cobre este endpoint e todas as outras APIs e modelos do catálogo. Você não precisa solicitar acesso à API do Facebook separadamente.