Facebook Search posts API
Search public Facebook posts by keyword, optionally filtered by location, and get structured post records (text, author, engagement).
Try it
Make your first request
{
"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
}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 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"}'| Field | Type | Example value |
|---|---|---|
| Request body | ||
| query | string | "nike"Keyword or phrase to search Facebook posts for (e.g. 'product launch'). |
| endDate | string | Only return posts published on or before this date, format YYYY-MM-DD (e.g. 2024-12-31). |
| limit | integer | 3Maximum number of results to return (1-20, default 20). You are billed per result returned, so a lower limit costs less. |
| location | string | Optional location to narrow results; include both city and country for best matches (e.g. 'Paris, France'). |
| startDate | string | Only return posts published on or after this date, format YYYY-MM-DD (e.g. 2024-01-01). |
| Response | ||
| data | object | |
| 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. |
| found | boolean | Whether any matching posts were returned for the query. |
| Price | ||
| Price per request (ceiling) | USD | $0.0661 |
| Price /1k results | USD | $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.