facebook-posts-search avatar

facebook-posts-search

Pricing

from $8.00 / 1,000 results

Go to Apify Store
facebook-posts-search

facebook-posts-search

Search Facebook posts by keyword with recent-posts, location and date-range filters. Drop-in replacement for powerai/facebook-post-search-scraper (identical input and output schema).

Pricing

from $8.00 / 1,000 results

Rating

5.0

(1)

Developer

code craker

code craker

Maintained by Community

Actor stats

0

Bookmarked

4

Total users

3

Monthly active users

2 days ago

Last modified

Share

Facebook Posts Search Scraper

Search Facebook posts by keyword and export them as clean, structured data โ€” no code required.

Give it one or more keywords and the scraper returns matching public posts with their text, author, reaction breakdown, comment and share counts, media, links, timestamps and more. Filter by recent posts, location or a date range, and pull up to 5,000 results per keyword with automatic pagination.

Features

  • ๐Ÿ”Ž Keyword search โ€” find posts by any word or phrase; wrap a phrase in quotes for an exact match.
  • ๐Ÿงต Multiple keywords per run โ€” pass a whole list; results are combined and de-duplicated automatically.
  • ๐Ÿ•’ Recent-posts filter โ€” restrict to the freshest posts only.
  • ๐Ÿ“ Location filter โ€” narrow results to a specific location.
  • ๐Ÿ“… Date range โ€” limit posts to a start/end date.
  • ๐Ÿ“„ Auto-pagination โ€” keeps loading until it reaches your result target or the feed runs out.
  • ๐Ÿ“ฆ Structured output โ€” every post is a tidy JSON record, ready for Excel, Google Sheets, a database or your own code.

Input

FieldTypeRequiredDescription
querystringYes*A single keyword or phrase. Wrap in "double quotes" for an exact-phrase match. You can also paste several keywords, one per line.
queriesarrayYes*A list of keywords/phrases. Each is searched separately and the results are merged and de-duplicated. maxResults applies per keyword.
recent_postsbooleanNoOnly return recent posts.
location_uidstringNoLocation identifier to filter posts by.
start_datestringNoEarliest post date to include (YYYY-MM-DD).
end_datestringNoLatest post date to include (YYYY-MM-DD).
maxResultsintegerNoNumber of posts to fetch per keyword (default 10, max 5000).
cookiesarrayNoFacebook session cookies (JSON). See Authentication below.
fbEmailstringNoFacebook account email/phone for automated login. See Authentication.
fbPasswordstringNoPassword for that account (stored encrypted).
proxyConfigurationobjectNoProxy settings. Residential proxies are strongly recommended (default: Apify Proxy).

* Provide either query or queries (or both โ€” they're merged). At least one keyword is required.

Example โ€” single keyword

{
"query": "\"climate change\"",
"maxResults": 100,
"recent_posts": true
}

Example โ€” multiple keywords

{
"queries": ["climate change", "renewable energy", "\"solar power\""],
"maxResults": 50,
"recent_posts": true
}

Output

Each result is one post, saved to the dataset:

{
"post_id": "971562908763987",
"type": "post",
"url": "https://www.facebook.com/businessinsiderssa/posts/pfbid02cuDx...",
"message": "Full post text...",
"message_rich": "Full post text...",
"timestamp": 1775211321,
"comments_count": 152,
"reactions_count": 1564,
"reshare_count": 69,
"reactions": { "like": 1499, "love": 57, "care": 6, "haha": 1, "wow": 1, "sad": 0, "angry": 0 },
"author": {
"id": "100077308612555",
"name": "Business Insider Africa",
"url": "https://www.facebook.com/businessinsiderssa",
"profile_picture_url": "https://scontent.xx.fbcdn.net/..."
},
"image": { "uri": "https://scontent.xx.fbcdn.net/...", "height": 1350, "width": 1080, "id": "971562895430655" },
"video": null,
"video_view_count": null,
"video_thumbnail": null,
"external_url": null,
"attached_post": null,
"attached_post_url": null,
"associated_group": null,
"searchQuery": "climate change",
"scrapedAt": "2026-07-03T14:06:01.794Z"
}

Field reference

FieldDescription
post_idFacebook's unique ID for the post.
urlDirect link to the post.
message / message_richThe post text.
timestampPublish time, Unix seconds (UTC).
reactions_countTotal reactions.
reactionsBreakdown by type (like, love, care, haha, wow, sad, angry).
comments_count / reshare_countComment and share totals.
authorPoster's id, name, profile URL and picture.
image / video / video_thumbnailAttached media, when present.
external_urlOutbound link shared in the post, when present.
attached_post / attached_post_urlThe original post, when this is a share.
associated_groupThe group the post belongs to, when applicable.
searchQueryWhich of your keywords surfaced this post.
scrapedAtWhen the record was collected (ISO 8601).

You can export the dataset as JSON, CSV, Excel, HTML or RSS from the run's Storage tab, or fetch it via the Apify API.

Authentication (required)

Facebook does not allow searching posts without being logged in, so the scraper needs a Facebook session. Use a dedicated throwaway account, never your personal one. There are two ways to provide it:

Option A โ€” automated login (easiest)

Set your account credentials and let the scraper log in for you:

  • fbEmail and fbPassword in the input, or (recommended) as the FB_EMAIL and FB_PASSWORD environment variables on the actor.

The scraper logs in once, reuses the session on later runs, and re-authenticates automatically when it expires.

The account must have two-factor authentication turned off, and should be logged in once from a normal browser (in the same country as your proxy) before its first run, so Facebook doesn't flag it as suspicious.

Option B โ€” session cookies

Provide cookies from an already-logged-in session in the cookies input:

  1. Log into your throwaway account in a browser.
  2. Install the Cookie-Editor extension, open facebook.com, and Export โ†’ JSON.
  3. Paste the exported array into the cookies field. Make sure it includes the c_user and xs cookies.

Proxy

Facebook blocks most datacenter IPs. Keep the proxy on Residential (the default) and, ideally, in the same country as your account for the most reliable results.

Tips & limitations

  • Quotes matter. "exact phrase" matches that phrase; unquoted multi-word keywords match more loosely.
  • maxResults is per keyword. Ten keywords at maxResults: 50 targets up to 500 posts (minus duplicates).
  • Only public posts that appear in Facebook search are returned; content from private profiles and closed groups is not accessible.
  • Availability depends on Facebook. Facebook changes its site frequently and may throttle heavy activity; using recent, warmed-up accounts and residential proxies gives the most stable results.

Support

Found a bug or need a field added? Open an issue or email m83588864@gmail.com and we'll take a look.