How to search public Facebook posts by keyword
Search public Facebook posts by keyword and get each post's text, author, URL, timestamp, and engagement counts in a table
On this page
You need to scan 20 public Facebook posts that mention the Example keyword fall sneaker launch in Paris, France between 2026-01-01 and 2026-01-31, then compare their authors and engagement. The deliverable is a table with one row per post and a Review priority column you add
No run has been executed for this guide. The table below is a design; values here are placeholders showing the shape
Design the scan table
| id | url | text | createdUtc | authorName | authorUrl | reactionCount | commentCount | shareCount | Review priority |
|---|---|---|---|---|---|---|---|---|---|
| post_id_placeholder | https://facebook.example/post/placeholder | Example post text | 1767225600 | Example Author | https://facebook.example/author | 12 | 3 | 1 | medium |
Example input: fall sneaker launch, location Paris, France, startDate 2026-01-01, endDate 2026-01-31, limit 20. The row values are placeholders
A row with empty text can still be valid; the contract says media-only posts can have no caption. Keep id and url so you can open the source before review
Search by keyword, place and date
The catalog lists anyapi.facebook.search_posts; agents call it through POST /v1/runs with toolId anyapi.facebook.search_posts. query is required; the Example value is fall sneaker launch. limit is optional and must be between 1 and 20, with a default of 20. To aim for 20 records in one response, set limit to 20. The field caps the response, so one call cannot return more than 20 records; it cannot make 20 matches exist
location is optional. Include both city and country, as in Paris, France. The contract says Facebook's place filter favors posts tagged at that place and can still return some posts from elsewhere. startDate and endDate use the date format YYYY-MM-DD; the Example window is 2026-01-01 to 2026-01-31
requireFields is optional. It accepts albumPreview, imagesCount and type. Naming a field can move the call to a dearer source that returns it, and a combination no single source returns together is refused with no charge. Omit it and routing is unchanged, with the cheapest source serving
Read the fields that drive review
Check found first. If it is false, reason is not_found; the contract defines that as a successful call, not an error. If it is true, data.items holds the matching public post records. The response schema permits data to be null
The row key is id, and url gives the canonical post link. text holds the post message and can be empty for media-only posts. createdUtc is UTC epoch seconds; multiply by 1000 for a JS Date. Use it to sort the rows inside the date window
authorName and authorUrl are for comparing authors; both can be empty when the upstream omits them, and authorUrl has tracking query params stripped. reactionCount, commentCount and shareCount are the engagement totals. Review priority is not returned by the tool; assign it after you read the counts and text. A high count or a launch mention in text can raise the row, but the rule is yours
Agent prompt
The prompt uses the Example inputs. It tells the agent to check the current inputs and price first
Set up https://purrkey.app/SKILL.md, then use Purrkey to search public Facebook posts for the Example keyword "fall sneaker launch" in Paris, France between 2026-01-01 and 2026-01-31. Check the current inputs and price of anyapi.facebook.search_posts before running. Use query "fall sneaker launch", location "Paris, France", startDate "2026-01-01", endDate "2026-01-31", and limit 20. Return a table with id, url, text, createdUtc, authorName, authorUrl, reactionCount, commentCount, shareCount, and Review priority. Leave Review priority blank for me to fill. If found is false, return a row that states found false and reason not_found. Do not invent posts or engagement counts.Estimated tool cost
Prices from the Purrkey catalog, read November 13, 2026. The unit is max_call: Maximum per call. Successful runs settle at the actual AnyAPI charge. The totals below are ceilings, not settled charges
| Step | Formula | Unit price | Planned quantity | Total |
|---|---|---|---|---|
| One keyword search | 1 call x max price | $0.0649 per call | 1 | $0.0649 |
| Three keyword searches | 3 calls x max price | $0.0649 per call | 3 | $0.1947 |
One keyword search is 1 call; three keyword searches are 3 calls. Cost is per call, not per returned post. A call that returns fewer than 20 records still counts as one call. Model fees for the agent are not counted
Next action
Open the Facebook post search tool page to run the Example scan. Set limit to 20 and check the price before the first call
Get started by giving this to your agent
- Claude Code
- Codex
- Gemini CLI
- Cursor
- GitHub Copilot
Set up https://purrkey.app/SKILL.md, then use Purrkey to show me what I can do with Facebook.FAQ
How do I search public Facebook posts by keyword?
Call anyapi.facebook.search_posts with the required query field, plus optional limit, location, startDate and endDate. The response returns public post records with text, author and engagement fields.
What inputs does anyapi.facebook.search_posts take?
The required input is query. Optional inputs are limit from 1 to 20 with a default of 20, location as a city and country, startDate and endDate in YYYY-MM-DD, and requireFields for albumPreview, imagesCount or type.
What does found false mean?
found false comes with reason not_found, which the contract calls a successful call, not an error. The contract treats that as a successful call, not an error.
Which output fields should I use to compare posts?
Use id, url, text, createdUtc, authorName, authorUrl, reactionCount, commentCount and shareCount. Review priority is reader-added, not a tool field.
How much does one Facebook post search cost?
At most $0.0649 per call under the max_call unit; successful runs settle at the actual AnyAPI charge. Three calls are at most $0.1947.
Can one call return more than 20 Facebook posts?
No. The limit input has a maximum of 20 and a default of 20, so one call cannot return more than 20 records.
What does the location filter do?
location is optional and should include city and country, such as Paris, France. The contract says Facebook's place filter favors posts tagged at that place and can still return some posts from elsewhere.
Next step
Try this with Facebook
The tool directory lists every endpoint with its current price. Inspect the inputs there, then let your agent run a small batch before scaling up.