Facebook Scraper avatar

Facebook Scraper

Pricing

from $5.00 / 1,000 posts

Go to Apify Store
Facebook Scraper

Facebook Scraper

Scrape public Facebook content without login.

Pricing

from $5.00 / 1,000 posts

Rating

0.0

(0)

Developer

Morph Coder

Morph Coder

Maintained by Community

Actor stats

0

Bookmarked

3

Total users

2

Monthly active users

7 days ago

Last modified

Share

Facebook Post Scraper

What is Facebook Post Scraper?

Facebook Post Scraper is a lightweight Apify Actor that extracts public Facebook posts from direct post URLs. Paste one or more links to individual posts (or post IDs), run the Actor, and get structured JSON with text, engagement metrics, and media metadata—without using the official Facebook API.

It is built for known post links: monitoring specific announcements, archiving posts you already found, or feeding URLs from search/other tools into a pipeline. It uses fast HTTP scraping (Cheerio), not a full browser, so runs are cheap and quick when Facebook serves public HTML.

Best for: post URLs you already have · public pages and profiles · batch export to JSON/CSV via Apify
Not for: crawling an entire page feed by profile URL only · hashtag search · logged-in-only insights


Why use this Actor?

  • Direct post URLs — one row per startUrls entry; no Graph API app review
  • Full post text when Facebook embeds message.text in the page (not truncated og:description)
  • Engagement — reactions, comments, shares; views when present in public HTML (often null without login)
  • Media — image/video URLs, thumbnails, optional ocrText (Facebook accessibility captions, not a separate vision model)
  • Optional video transcript — from embedded captions when videoTranscript: true
  • Optional Apify Proxy — residential proxy if datacenter IPs are blocked
  • Export anywhere — dataset on Apify, or JSON/CSV/Excel and API clients (Python/Node)

What data can you extract?

FieldDescription
textPost body (full text from embedded JSON when available)
urlCanonical post URL when found in HTML
postIdNumeric or pfbid id
reactions / likesReaction count (likes mirrors reactions)
commentsComment count
sharesShare count
viewsView/play count if embedded (often null on public pages)
publishedAtISO timestamp when available
authorNameFrom Open Graph / page metadata when available
ocrTextImage accessibility text (e.g. “May be an image of…”)
videoTranscriptAuto captions from HTML when enabled and present
media[]url, thumbnail, ocrText, mediaType (photo / video)
sourceUrlYour input URL
scrapedAtExtraction time

Errors are returned as { "type": "error", "code", "message" } (e.g. ACCESS_DENIED, NOT_FOUND).


How do I use Facebook Post Scraper?

  1. Create a free Apify account.
  2. Open this Actor in Apify Console.
  3. Add post URLs under Start URLs (or postUrls / postIds).
  4. Set Results limit (max URLs per run, default 20).
  5. Optionally enable Image captions / OCR or Video transcript, and proxy if you see login walls.
  6. Click Start, then download the dataset (JSON, CSV, Excel, etc.).

Input

Primary input is a list of public post URLs, for example:

{
"startUrls": [
{
"url": "https://www.facebook.com/61559402542547/posts/breaking-scottie-thompson-has-been-traded-to-magnoliais-reportedly-being-traded-/122212876880313418/"
}
],
"resultsLimit": 20,
"captionText": true,
"videoTranscript": false,
"useProxy": false
}
FieldDescription
startUrlsPost links (requestListSources editor)
postUrlsAlias for startUrls
postIdsPost URL, numeric id, or pfbid token
resultsLimitMax posts to process per run (1–500)
captionTextInclude ocrText on images (default true)
videoTranscriptInclude embedded video transcript (default false)
useProxy / proxyApify Proxy; useApifyProxy in proxy editor also enables proxy

See the Input tab in Console for the full JSON schema.

Output

Results are stored in the run Dataset. Example post record:

{
"url": "https://www.facebook.com/permalink.php?story_fbid=…",
"text": "🚨BREAKING: …\n\nMagnolia will get:\nScottie Thompson",
"reactions": 56,
"comments": 12,
"shares": 19,
"views": null,
"likes": 56,
"ocrText": "May be an image of basketball, basketball jersey and text that says '…'",
"videoTranscript": null,
"media": [
{
"url": "https://scontent.xx.fbcdn.net/…",
"thumbnail": "https://scontent.xx.fbcdn.net/…",
"ocrText": "May be an image of basketball…",
"mediaType": "photo"
}
],
"postId": "122212876880313418",
"authorName": null,
"publishedAt": "2024-01-15T12:00:00.000Z",
"sourceUrl": "https://www.facebook.com/…/posts/…",
"scrapedAt": "2026-06-01T15:14:00.529Z"
}

Proxy and access

Facebook may return a login wall for cloud IPs. If you see ACCESS_DENIED:

  1. Set Use Apify proxy to true, or enable use Apify Proxy in the proxy editor.
  2. Prefer RESIDENTIAL proxy groups for difficult posts.
  3. Confirm the post is public and the URL opens in a private browser without logging in.

This Actor does not accept Facebook cookies or passwords (public content only).


API and integrations

Run the Actor via Apify API, apify-client (Node.js / Python), webhooks, or integrations (Make, Zapier, Google Sheets, etc.). Use the API tab in Console for a ready-made code snippet.


Pricing

This Actor uses pay-per-event billing:

EventWhen charged
apify-actor-startEach run (synthetic; configured in Console)
postEach successful post written to the dataset

Error rows (type: "error") are not charged. Set the post price in Publication → Monetization and mark it as the primary event.

Local test with PPE: ACTOR_TEST_PAY_PER_EVENT=1 apify run.


FAQ

Can I scrape all posts from a page by pasting only https://www.facebook.com/pagename/?
No. This Actor expects post URLs (or post IDs). To collect many posts from a page, you need those links from another source or a feed-oriented Actor.

How is this different from large “Facebook Posts Scraper” products on the store?
Those often crawl page feeds, filters, and rich page metadata in a browser. This Actor is a focused, URL-in → post-out tool: fast, transparent, and ideal when you already have post links.

Is ocrText from ChatGPT / vision AI?
No. It is read from Facebook’s own accessibility / OCR fields in the page JSON when available.

Why is views null?
Facebook usually does not expose view counts on anonymous HTML; they may appear for some videos or with a logged-in session.

Is scraping legal?
Only scrape public data you are allowed to use. You are responsible for compliance with Meta’s Terms and applicable law. Do not scrape private or personal data without a lawful basis.


Develop locally

cd actors/facebook-scraper
npm install
npm run build
npm run test:unit
apify run

Example input: scripts/test-input.example.json

Deploy

cd actors/facebook-scraper
apify login
apify push

CI path: actors/facebook-scraper (use forward slashes on Linux).