Facebook Post Search & Keyword Scraper API avatar

Facebook Post Search & Keyword Scraper API

Pricing

from $0.99 / 1,000 post delivereds

Go to Apify Store
Facebook Post Search & Keyword Scraper API

Facebook Post Search & Keyword Scraper API

Search public Facebook posts by keyword, phrase, or hashtag. Export globally deduplicated posts with text, authors, dates, engagement, media, and match evidence. Use multiple queries in one run, verify literal matches, and distinguish confirmed no-results from blocked or partial searches.

Pricing

from $0.99 / 1,000 post delivereds

Rating

0.0

(0)

Developer

OverBifrost

OverBifrost

Maintained by Community

Actor stats

0

Bookmarked

32

Total users

18

Monthly active users

9 days ago

Last modified

Categories

Features

Limited permissions

Share

What does Facebook Post Search & Keyword Scraper API do?

Search public Facebook posts by keyword, phrase or hashtag, or extract details from individual post, video and Reel links. Get post text, authors, publication dates, reactions, comments, shares and media when Facebook exposes them. Use the results for brand monitoring, content research, competitor analysis and AI workflows.

No Facebook account, cookies or Facebook API key required. Keyword discovery uses Google's web index; each result's details come from the public Facebook document. Individual post links go directly to Facebook. This is an index-based search, with explicit coverage and missing-data reporting.

See the Facebook Post Search overview for supported workflows and the Facebook input guide for queries, matching, and monitoring.

How to scrape Facebook posts without code

  1. Enter a topic or individual post links in Keywords or Facebook links. For the first run, keep the small three-post example and SOURCE_RESULT matching.
  2. Set Posts per search and Total post limit. Leave filters and advanced settings unchanged initially.
  3. Start the Actor. Saved posts appear in the default Dataset; Search summary reports the outcome of each input.
  4. Open HTML results preview, or use the Dataset for your data pipeline. Turn on Also save posts.csv for a separate spreadsheet file.
  5. Check Search summary even when some posts were saved. It distinguishes completed, empty, blocked, and partial inputs.

Choose the input that matches your task:

You haveUse
A topic, phrase, brand name, or hashtagKeyword search through Google's index of public Facebook posts
A specific public post, video, or Reel linkDirect extraction of that individual post, without Google discovery
A Page, profile, or group collection URLUse individual post links or keywords instead; full timeline crawling is not supported

Start with one query and the small limits before adding filters, comments, monitoring, or more searches. No Facebook login is required, but the target must expose usable public data.

Result limits are maximums, not promises. Unavailable documents, strict filters and index coverage can reduce the result count. A successful mixed run can retain useful posts while some inputs remain blocked or incomplete. Check the Pricing page before starting.

What Facebook data can you extract?

DataAvailable fields
Post and captionPost ID, canonical URL, full exposed text, publication time, capture time and post type
Author and sourcePublic name, ID, profile/Page URL, author type, picture and Page/Group/Profile context when exposed
EngagementTotal reactions, reaction types, comments, shares and video views; each unavailable count stays unknown
Photos and videosImages, thumbnails, video URLs, duration, available SD/HD links, dimensions and accessibility captions
Links and contextLink previews, external links, hashtags, mentions, collaborators, tagged places and original reshared posts
Visible commentsOptional top-level comments with text, author, observed date, reactions and reply count
Match evidenceContributing searches, literal-match verification, requested/applied filters, identity, source and limitations

One post found by several searches becomes one row, with every contributing query preserved. An observed zero stays zero; an unavailable count stays null. totalEngagement is available only when reactions, comments and shares are all observed. publishedAt is publication time; capturedAt is collection time. Media URLs can expire.

An identity-only response containing a post/owner ID or playback duration, with no usable post details, is withheld before delivery and charging. Its query reports DOCUMENT_DETAILS_UNAVAILABLE in coverage gaps. Useful partial posts remain supported; there is no requirement that every field be available. The HTML report's Data availability table and RUN_SUMMARY.measurements.fieldCoverage count available fields across delivered unique posts, including observed zeros. They do not measure posts outside the checked source window or promise that every post contains media.

Which output format should I choose?

Dataset formatBest forWhat it retains
FULL — defaultAnalysis, archives and detailed integrationsNested observed data and evidence
FLATSpreadsheets and tools expecting scalar columnsScalar columns plus JSON text cells for nested details; use the Flat view
COMPACTAI agents, summaries and automationFull post text, author/source context, counts, comments when requested, all match evidence and limitations

COMPACT intentionally omits media URLs, duplicate image/video attachments, author pictures, mentions/collaborators and shared-original details from Dataset rows. mediaCount reports the observed attachment count; omitted media fields do not mean there was no media. Comment text remains when requested, with comment-author pictures omitted. This reduces export bytes, not acquisition requests or fees. The HTML preview, optional CSV and Top comments table still use canonical data.

Facebook keyword search: complete example input

This is the same bounded search used by the Form prefill:

{
"queries": ["James Webb Olhar Digital"],
"matchMode": "SOURCE_RESULT",
"sortBy": "TOP",
"maxPostsPerQuery": 3,
"maxUniquePosts": 3,
"maxScannedPostsPerQuery": 3,
"maxSerpPagesPerQuery": 1,
"maxDocumentsPerQuery": 6,
"maxTotalRequests": 48,
"maxTotalResponseMiB": 24,
"maxConcurrency": 1,
"outputFormat": "FULL",
"includeTopComments": false,
"writeCsv": false,
"onlyNewPosts": false,
"proxyStrategy": "AUTO"
}

Replace the query with your topic. Search phrases can include quoted terms, OR alternatives and exclusions. Query entries are limited to 300 characters. Repeated queries are merged while preserving input positions; keywords and extra hashtags together may contain at most 100 entries.

Input in queriesBehavior
A keyword or phraseDiscover indexed post links for the topic
#ClimateTechDiscover indexed posts for the hashtag
https://www.facebook.com/search/posts/?q=James%20WebbExtract the search text and use index discovery
https://www.facebook.com/hashtag/climatetechExtract the hashtag and use index discovery
An individual post, permalink, video, Watch or Reel URLFetch that post directly, with no Google search

Add separate tags through hashtags, with or without #. At least one queries entry is required. Search links reuse their text, not Facebook's native feed or embedded filters. Unsupported filters, profile/collection links, comment targets and non-Facebook links fail validation before acquisition.

Can I require posts to contain my keywords?

SOURCE_RESULT keeps posts found by source ranking without requiring a local text match. verifiedMatch: false in that mode does not mean the post is irrelevant; local verification was not requested.

Choose ALL_TERMS, ANY_TERM, EXACT_PHRASE, WHOLE_WORD, CONTAINS or HASHTAG for literal verification. ALL_TERMS and ANY_TERM support bounded expressions with quoted phrases, OR alternatives and exclusions. Strict modes keep only posts with a verified contributing query. Missing text cannot pass strict text verification. This checks the post text, not its author's name or a search snippet.

How to search Facebook posts by date and engagement

Set dateFrom and/or dateTo to an absolute date, timezone-bearing ISO timestamp or relative expression such as 7 days, 2 months or 1 year. Relative values resolve once at run start. A date-only upper bound includes that whole UTC day. These are local publication-date checks; they do not expand the search source.

unknownDate: "KEEP_FLAGGED" retains posts whose date is unavailable and flags the limitation. Choose "DROP" to exclude undated posts when applying a date window. Asking for older dates does not guarantee access to historical posts outside the index.

Use Post filters (filters) for these optional checks:

FilterAccepted values / behavior
sourceTypesPAGE, GROUP, PROFILE, EVENT, UNKNOWN
postTypesTEXT, LINK, PHOTO, ALBUM, VIDEO, REEL, SHARE, UNKNOWN
authorTypesPAGE, PROFILE, UNKNOWN from observed identity
languagesTwo-letter codes such as ["en", "es"]; detected from text
minReactions, minComments, minSharesMinimum observed counts; an unavailable count cannot meet a positive minimum
excludeResharesExclude explicitly observed reshares; unknown status stays flagged
taggedLocationIdsKeep posts with an explicitly observed matching Facebook place ID
mediaOnly, videoOnly, linkOnlyJSON/API switches for media, videos/Reels or external links

Language detection abstains on short or ambiguous text. A selected language filter excludes unknown languages. Tagged-place filtering does not infer a location from the author's address or post text.

Strict filters reduce the results, not the acquisition work. maxScannedPostsPerQuery defaults to the posts-per-search limit. Raise the scan limit, document limit and page depth deliberately when few fetched posts pass your filters. RUN_SUMMARY.filtering reports evaluated posts, rejection reasons and unavailable engagement. Rejection counts can overlap because one post can fail several filters.

How to monitor Facebook brand mentions

Turn on Only posts not returned before (onlyNewPosts) and reuse the same monitorName and search/filter settings. Save that configuration as an Apify task and use a schedule when you want recurring runs.

{
"queries": ["James Webb Olhar Digital"],
"matchMode": "SOURCE_RESULT",
"sortBy": "TOP",
"onlyNewPosts": true,
"monitorName": "space-news",
"monitorRetentionDays": 90,
"maxPostsPerQuery": 3,
"maxScannedPostsPerQuery": 12,
"maxUniquePosts": 3,
"maxSerpPagesPerQuery": 1,
"maxDocumentsPerQuery": 12,
"maxTotalRequests": 48,
"maxTotalResponseMiB": 24,
"maxConcurrency": 1,
"outputFormat": "COMPACT",
"includeTopComments": false,
"writeCsv": false,
"proxyStrategy": "AUTO"
}

A later run suppresses already delivered posts for the same monitoring configuration before another post event. isNew means new to that configuration, not recently published. A different query, meaningful filter or monitoring profile has independent history. A run with no newly delivered posts can succeed.

History stores identity/search hashes and timestamps, not post text. Retention defaults to 90 days, configurable from 1–365 days, with capacity for 51,200 hashes; one post can use several hashes. Expired or capacity-evicted entries may reappear. Concurrent runs using the same profile are refused before acquisition. Storage/lease failures stop delivery and are reported.

For manual exclusions, use excludePostIds or a read-only previousDatasetId. Monitoring revisits a bounded index sample and cannot guarantee discovery of every new Facebook mention.

Export posts, comments and an HTML report

The default Dataset is the saved-post export. Its views are Posts, Engagement, Media & links, Matching & coverage, Flat and Authors; they do not duplicate post rows. Dataset items are also available through the Apify API, including supported JSON, CSV, Excel and other export formats.

With includeTopComments: true, the Actor collects up to maxTopCommentsPerPost visible top-level comments, default 10 and maximum 50. Comments already exposed with the proved target post are retained inline and in the Top comments Dataset. This adds no comment-pagination request or post-delivered event. It is a visible subset, not a full comment thread or replies.

Search summary has one row per input, including partial, blocked, failed and empty searches. What happened explains known acquisition problems and Suggested next step gives a corresponding check. These explanations distinguish a login requirement, an unidentified post and a post exposed only as a reference; they do not infer that a post is private or deleted.

Document request and parse times are sums of up to 16 retained physical request timings per input. The table reports the sample count and whether every requested document was timed. Unknown timings stay null; concurrent intervals can overlap, so these sums are not the run's wall time. The HTML report includes the same explanations and a collapsed timing section. These measurements add no HTTP request or post event.

The run's default Key-value store contains:

RecordContents
REPORT.htmlPost cards, dates, metrics, media, comment excerpts and per-search coverage; also useful for empty/incomplete runs
RUN_SUMMARYCounts, source outcomes, filters, monitoring, exports and billing diagnostics
CHARGE_JOURNALPer-post persistence and charge decisions
posts.csvOptional UTF-8 spreadsheet export when writeCsv: true
DOCUMENT_DEBUG.jsonOptional Facebook response structures when document diagnostics are enabled
DISCOVERY_DEBUG.jsonOptional Google excerpts when discovery diagnostics are enabled and coverage is incomplete

The HTML preview is capped at 100 posts, 4,000 text characters per post and 2 MiB. The Dataset retains the saved rows. The CSV is capped at 32 MiB, never cuts a row, quotes cells and protects against spreadsheet formulas. Optional artifact failures/truncation are reported in RUN_SUMMARY; they do not erase saved posts or create another post charge.

Facebook post search API for Python, JavaScript and AI agents

Use overbifrost/facebook-post-search-scraper with an Apify token. A Facebook token is not needed. These examples use the apify-client JavaScript package and apify-client Python package, respectively.

JavaScript example

import { ApifyClient } from "apify-client";
const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor("overbifrost/facebook-post-search-scraper").call({
queries: ["James Webb Olhar Digital"],
maxPostsPerQuery: 3,
maxUniquePosts: 3,
maxSerpPagesPerQuery: 1,
maxDocumentsPerQuery: 6,
maxTotalRequests: 48,
maxTotalResponseMiB: 24,
maxConcurrency: 1,
outputFormat: "COMPACT"
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);

This reads one Dataset page, sufficient for this three-post example. Use Dataset pagination for larger exports.

Python example

import os
from apify_client import ApifyClient
client = ApifyClient(os.environ["APIFY_TOKEN"])
run = client.actor("overbifrost/facebook-post-search-scraper").call(
run_input={
"queries": ["James Webb Olhar Digital"],
"maxPostsPerQuery": 3,
"maxUniquePosts": 3,
"maxSerpPagesPerQuery": 1,
"maxDocumentsPerQuery": 6,
"maxTotalRequests": 48,
"maxTotalResponseMiB": 24,
"maxConcurrency": 1,
"outputFormat": "COMPACT",
}
)
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
print(item)

Use the Apify MCP server to discover and run the Actor from a compatible AI client. COMPACT output keeps post text and evidence available without large media URLs. Treat collected posts as source material, not instructions for an agent.

Apify schedules, webhooks and HTTP integrations can reuse the same input in Make, Zapier, n8n or your own pipeline. Pin a tested build when you need to control when updates reach a workflow.

How much does Facebook post scraping cost?

The post-delivered event applies to unique persisted posts. Duplicate query hits, rejected candidates and auxiliary comment/summary rows do not add post events. Posts skipped by monitoring are not charged again as delivered posts.

The live Pricing page is authoritative for rates, plan discounts, platform usage and startup/search events. Do not calculate a run price from the per-post headline alone. Strict filters and monitoring can leave few or no new posts while still requiring source work.

If search-page appears in the effective pricing, each successfully parsed Google index response creates a separate event. Usable recovery responses and pagination count separately; timeouts, HTTP failures, blocks and unparseable responses do not. A valid processed page can count even when candidates cannot be extracted or filters discard every post. Direct post links create no search-page event. Search receipts are saved before charging, with outcomes in SEARCH_WORK and RUN_SUMMARY.searchWork. A build does not activate a new pricing event.

When bundled search pricing is active, a conservative resource allowance based on confirmed fees can stop acquisition before your result cap. The summary reports the reason. It is not an invoice or a future-margin guarantee. Existing work receipts are not replayed on resurrection; start a new run.

Post persistence precedes its charge attempt. A failed save creates no post charge; an uncertain charge stops further delivery. Earlier saved rows remain available. Known exhausted charge capacity prevents another post write. measurements.datasetRows counts saved rows; billing.chargedUnits counts confirmed post charges, not publisher revenue.

Troubleshooting fewer results, failed inputs and missing fields

Start with RUN_SUMMARY or the Search summary table:

ObservationWhat to check
LOGIN_WALL, CAPTCHA or rate limitFacebook restricted the received response. This alone does not prove that a post is private or deleted.
CONTENT_UNAVAILABLEAn exact requested opaque-post route returned an explicit unavailable-content page or a final empty post result. No post was exposed by this response; the underlying cause is unknown.
TIMEOUT or NETWORK_ERRORAcquisition did not complete; inspect the transport stage. No received content is implied.
MALFORMED_RESPONSEThe response could not prove the intended content, or its layout was unusable. Check target-binding and scan diagnostics.
PARTIAL / LIMIT_REACHEDScan, document, page, request, byte or output bounds stopped coverage. More matching posts may exist.
Found posts but few savedCheck filtering.rejectionReasons, unavailable engagement, strict matching, date policy and previous-post suppression.
Missing date, media or counterFacebook may not expose the field. Unknown values are not zero and do not by themselves mean the whole input failed.

COMPLETE means the requested bounded acquisition completed. NO_RESULTS_CONFIRMED means the checked source window completed empty, not that all Facebook is empty. Incomplete queries retain their own states even when other inputs succeed. If no posts are saved and any query fails or is blocked, the run fails; clean empty, filtered and already-seen searches can still succeed.

Diagnose a direct Facebook post or missing data

Enable Save Facebook document diagnostics (saveDocumentDiagnostics: true). The Actor attempts to save DOCUMENT_DEBUG.json with at most three problem samples and one matched reference, within 256 KiB. This works for both direct and discovered post links and adds no HTTP request or post event.

The file contains canonical input post URLs, HTTP/parser decisions, response hashes and bounded JSON field/type structures. Post text, names, raw scripts, headers and tracking URLs are not stored; identity correlations and arbitrary keys use run-local keyed hashes. Sampling and traversal truncation are explicit. It is structural evidence, not raw HTML, a full replay fixture or proof that omitted content was absent. Check RUN_SUMMARY.documentDiagnostics for saved/empty/unavailable/failed status. Keep the file private and disable the option after troubleshooting; optional storage/compute still applies.

For unsupported routes, FBPS_DOCUMENT_ROUTE_BINDING also retains bounded Facebook routing-code identifiers in routeShape.routing. This identifies layout variants directly from the received Actor response. Only the known comet.fbweb namespace and Comet component-module syntax are eligible; other values are redacted. Recording a new identifier does not make that route supported or recover its post.

Repeated failure categories can be replaced by a newly observed category within the same sample budget. The file still does not contain every failed response; use Search summary or query coverage to account for every input in bulk runs. A MATCHED_FIELD_GAPS video sample records missing optional details even when the remaining details make the post usable; it does not classify its query as failed.

Diagnose keyword discovery

Add saveDiscoveryDiagnostics: true in JSON. For partial, failed or blocked coverage, the Actor attempts to save DISCOVERY_DEBUG.json: at most four Google excerpts, 512 KiB total. Scripts, form values, opaque/tracking links and credentials are redacted. Public result text and the query can remain. This file covers Google, not Facebook post content, and adds no HTTP request or post event. A later failure may be outside the captured sample. Keep it private and disable after troubleshooting.

For a reproducible issue, share the run ID, build, input, RUN_SUMMARY and relevant optional diagnostics privately. Remove tokens and signed access links from public reports. Diagnostics do not grant access to another user's unshared runs.

Use the Input reference for form options, the API page for generated endpoints and the Issues page to report problems without posting private artifacts.

For help with a run, contact OverBifrost support.

Advanced search limits

The small Form prefill differs from the API defaults below. Raising a result limit alone does not raise work or time bounds; 0 does not mean unlimited.

InputAPI defaultBound / purpose
maxPostsPerQuery201–500 saved posts per search
maxUniquePosts5001–20,000 saved unique posts across inputs
maxScannedPostsPerQueryPosts per search1–500 raw posts inspected per search
maxDocumentsPerQuery241–50 Facebook documents per search
maxSerpPagesPerQuery51–10 index pages per search
maxConcurrency31–10 parallel searches; Form prefill 1
maxTotalRequests4001–400 admitted HTTP attempts, including failures
maxTotalResponseMiB2561–256 MiB decoded responses; at most one bounded final-response overshoot
minDelayMs, maxDelayMs00–10,000 ms between document request starts; maximum defaults to minimum
proxyStrategyAUTODatacenter Facebook documents; residential only through explicit APIFY_RESIDENTIAL

Up to four fresh Facebook documents can be fetched concurrently across the run. Several searches take turns before deeper pagination; source response times still determine duration. Shared posts must fit every accepted contributing query's ceiling, so overlapping searches may return fewer posts.

Google discovery permits one 180-second attempt and one recovery of up to 60 seconds per page, within the shared deadline and downstream reserve. Recovery preserves the search terms, may simplify the layout or target post URL families, and adds no third attempt. More time cannot recover content the source does not expose. The summary distinguishes attempted HTTP work from usable source pages.

In mixed runs, measurements.discoverySource is MIXED, with the query source labels listed in discoverySources. indexDiscoveredPosts counts unique delivered posts with an accepted query that observed a successful index page. postsPerSuccessfulSerpPage uses that count; direct-only results do not inflate index yield. A post independently found by several index queries counts once in the numerator, while each observed successful page counts in the denominator.

JSON-only discoveryQueryVariant and discoveryTransportVariant controls are diagnostic experiments, unnecessary for normal use. proxyStrategy affects Facebook documents, not Google's SERP route. Keep optimizationComparison: false for monetized runs; the comparison mode refuses PPE before acquisition.

Automatic memory selection

At run startup, Apify selects memory from source-request budget, input count, output size and concurrency. The rule is cost-aware; it does not inspect URLs or measure runtime resource use.

Input workloadDefault memory
One or two small direct links with up to 12 source requests512 MB
Three or more direct links with up to 12 source requests1,024 MB
One or two ordinary keyword searches512 MB
Three or more normal searches, or a query requesting more than 100 posts1,024 MB
Eight or more searches with at least 120 allowed source requests and concurrency 4+2,048 MB
A very large 1,000+-post target with at least 120 allowed source requests and concurrency 4+2,048 MB

Other combinations are clamped to 512–2,048 MB. A run-level Apify memory selection overrides the formula. Memory is allocated once before startup, never resized during a run. More memory supplies more CPU and can raise compute cost, but does not guarantee Facebook availability or solve intermittent document timeouts. These thresholds are conservative starting values, not measured optimums.

Frequently asked questions

Does this use Facebook's native search or the official Graph API?

It uses Google's web index to discover post URLs and public Facebook documents for post details. It does not require a Facebook access token. Search snippets are not promoted to Facebook post text.

Can I get the newest Facebook posts first?

Native newest-first search is unavailable. TOP means index relevance. RECENT is retained for compatibility but reports UNSUPPORTED; locally sorting a small indexed sample would not establish newest-first Facebook coverage.

Can I scrape all posts from a Facebook Page or group?

This Actor accepts individual post links and keywords. Page/profile/group collection URLs are unsupported. A group's post can be extracted when its individual URL exposes a public target. Full timeline crawling, private posts, customer sessions, video transcription and full comment threads are outside this Actor's scope.

Why did a successful run return zero new posts?

A completed search can find only previously delivered posts or posts rejected by matching/filters. Check monitoring and filtering counts. A blocked or failed acquisition is reported separately and never relabeled as confirmed no-results.

Can this find every brand mention or run successfully every day?

It searches a bounded public index and depends on external availability. Unindexed or newly published posts can be absent. Scheduling does not make missing content available or guarantee a successful daily run; inspect coverage alongside the saved data.

Are media, comments and engagement always available?

Only fields proved by the public target document are returned. Some posts expose text with no media or counters; others expose a video but no date. Visible comments are a subset, and media URLs can expire. No unavailable metric is fabricated.

This Actor is not affiliated with Meta or Facebook.