Facebook API

Facebook Search posts API

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

POST/v1/run/facebook.search_posts
Uptime
99.13%
30d · 689 calls
Requests
692
30d · weekly, last 12 wks
Response
18.0s
median · 30d

Try it

Make your first request

Open in
Get a free key
Sample response
Free runs return only the first 3 results. Fund a key to get the full response.
{
  "data": {
    "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"
      }
    ]
  },
  "found": true
}
Response interface
interface FacebookSearchPostsResponse {
  data: {
    items: {
      authorName?: string;
      authorUrl?: string;
      commentCount?: number;
      createdUtc: number;
      id: string;
      image?: string;
      reactionCount?: number;
      shareCount?: number;
      text: string;
      url: string;
    }[];
  } | 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 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"}'
FieldTypeExample value
Request body
querystring"nike"Keyword or phrase to search Facebook posts for (e.g. 'product launch').
endDatestringOnly return posts published on or before this date, format YYYY-MM-DD (e.g. 2024-12-31).
limitinteger3Maximum number of results to return (1-20, default 20). You are billed per result returned, so a lower limit costs less.
locationstringOptional location to narrow results; include both city and country for best matches (e.g. 'Paris, France').
startDatestringOnly return posts published on or after this date, format YYYY-MM-DD (e.g. 2024-01-01).
Response
dataobject
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.
foundbooleanWhether any matching posts were returned for the query.
Price
Price per request (ceiling)USD$0.0661
Price /1k resultsUSD$3.15

FAQ

About the Facebook Search posts API

The AnyAPI Facebook Search posts API returns Facebook search posts data as normalized JSON from one POST call to /v1/run/facebook.search_posts. Search public Facebook posts by keyword, optionally filtered by location, and get structured post records (text, author, engagement). AnyAPI returns one normalized schema whichever source serves it. It costs $3.15 per 1,000 results, and never more than $0.0661 for a single request, in US dollars with no subscription and no monthly minimum. Over the last 30 days, 99.1% of Facebook search posts calls through AnyAPI succeeded, with a median response time of 18.0 seconds across 689 measured calls.

It costs $3.15 per 1,000 results, and never more than $0.0661 for a single request, in US dollars with no subscription and no monthly minimum. You fund one USD wallet, each call draws it down, and a failed request costs $0.

Search public Facebook posts by keyword, optionally filtered by location, and get structured post records (text, author, engagement). The response is normalized JSON with the same envelope every AnyAPI endpoint returns, so parsing a second endpoint is a change of URL and nothing else.

Over the last 30 days, 99.1% of Facebook search posts calls through AnyAPI succeeded, with a median response time of 18.0 seconds across 689 measured calls. These are AnyAPI's own measurements of traffic through the gateway, recomputed continuously, not a published service-level target.