Facebook Post & Comment Scraper for Pages, Groups and Profiles avatar

Facebook Post & Comment Scraper for Pages, Groups and Profiles

Pricing

from $1.00 / 1,000 results

Go to Apify Store
Facebook Post & Comment Scraper for Pages, Groups and Profiles

Facebook Post & Comment Scraper for Pages, Groups and Profiles

Scrape public Facebook posts from pages, groups, and profiles with best-effort comment extraction. Collect post text, post IDs, permalinks, likes, shares, comment counts, profile data, media URLs, and comment samples. Built for Apify with fallback scraping and proxy suppor

Pricing

from $1.00 / 1,000 results

Rating

0.0

(0)

Developer

Inus Grobler

Inus Grobler

Maintained by Community

Actor stats

0

Bookmarked

16

Total users

8

Monthly active users

10 days ago

Last modified

Share

Facebook Post Scraper for Apify

Scrape public Facebook posts from pages, groups, and profiles with this Apify Actor.
This Facebook scraper extracts top-level post data like text, date, post URL, likes, shares, comment count, and profile details.

What this Facebook scraper does

  • Scrapes top-level Facebook posts from public URLs.
  • Supports Facebook page scraping, group scraping, and profile scraping.
  • Supports optional in-run enrichment (enrichmentMode) so you can keep one Actor and toggle depth per run.
  • Uses a resilient two-step strategy: scrapling first, pydoll-python fallback.
  • Saves structured results to the Apify dataset for API use, JSON, CSV, Excel, and integrations.

Typical use cases

  • Social media monitoring and brand tracking
  • Competitor content analysis on public Facebook pages
  • Lead research from public Facebook groups and creators
  • Building datasets for BI dashboards and trend analysis

Input

  • targets (array): Facebook URL, page name, or group name
  • startUrls (array): one or more public Facebook URLs (backward-compatible)
  • maxPosts (integer): maximum posts to return per URL (1-200)
  • maxScrollRounds (integer): optional override for dynamic scrolling depth (0-40, 0 means auto)
  • performanceMode (string): fast (default), balanced, or maxCoverage
  • enrichmentMode (string): none (default), basic, or deep
  • maxEnrichedPosts (integer): max posts per URL to process with enrichment (0-200)
  • maxCommentsPerPost (integer): max comment text samples per post in deep mode (0-200)
  • maxCommentExpansionRounds (integer): maximum expand/scroll passes for comment and reply loading in deep mode (1-20)
  • includeReplies (boolean): when true, deep-mode browser extraction attempts to expand replies as well as top-level comments
  • emitCommentItems (boolean): when true, recovered comment samples are also emitted as separate dataset items with itemType=comment
  • failOnCommentBlock (boolean): when true, deep-mode runs fail if Facebook login-wall blocking prevents comment extraction for enriched posts
  • facebookCookieHeader (string, optional): raw Facebook cookie header from your logged-in browser session (c_user=...; xs=...) to improve post coverage when anonymous access is blocked
  • proxyConfiguration (object, optional): Apify Proxy / custom proxy settings (recommended: residential proxy group)

Output fields

Each dataset item includes:

  • itemType
  • sourceUrl
  • postAuthor
  • postTimestamp
  • postText
  • postUrl
  • postId
  • postOwnerId
  • likes
  • shares
  • commentCount
  • likesCount
  • sharesCount
  • commentCountValue
  • profileName
  • profileUrl
  • profileUsername
  • profileId
  • profileImageUrl
  • profileFollowers
  • profileFollowersCount
  • targetType
  • targetTitle
  • targetDescription
  • targetImageUrl
  • targetFollowers
  • targetFollowersCount
  • targetUrl
  • enrichmentMode
  • commentExtractionStatus
  • commentExtractionMethod
  • isEnriched
  • externalUrls
  • mediaUrls
  • mediaCount
  • commentSamples
  • commentSamplesCount
  • parentPostId
  • parentPostUrl
  • commentText
  • commentAuthor
  • commentAuthorUrl
  • commentTimestamp
  • commentId
  • commentUrl
  • commentSampleIndex
  • scrapedWith
  • scrapedAt

Example output item

{
"inputTarget": "NASA",
"sourceUrl": "https://www.facebook.com/NASA",
"postAuthor": "NASA - National Aeronautics and Space Administration",
"postTimestamp": "2d",
"postText": "Post text...",
"postUrl": "https://www.facebook.com/NASA/posts/...",
"postId": "pfbid02abc...",
"postOwnerId": "NASA",
"likes": "728",
"shares": "42",
"commentCount": "61",
"likesCount": 728,
"sharesCount": 42,
"commentCountValue": 61,
"profileName": "NASA - National Aeronautics and Space Administration",
"profileUrl": "https://www.facebook.com/NASA",
"profileUsername": "NASA",
"profileId": null,
"profileImageUrl": null,
"profileFollowers": "26,879,175",
"profileFollowersCount": 26879175,
"externalUrls": ["https://example.com"],
"mediaUrls": ["https://..."],
"mediaCount": 1,
"scrapedWith": "pydoll",
"scrapedAt": "2026-03-09T10:40:00+00:00"
}

Important scope

  • Base mode (enrichmentMode=none) scrapes posts only.
  • Deep enrichment mode adds best-effort comment extraction from post permalinks.
  • Deep-mode comment extraction now tries plain HTTP first, then a Playwright browser pass, then a pydoll browser fallback.
  • Deep-mode browser extraction can run multiple expansion rounds and optionally expand visible replies before sampling comments.
  • If emitCommentItems=true, those recovered comment samples are also pushed as separate dataset items linked back to the parent post.
  • Full comment-thread completeness is not guaranteed due Facebook privacy/auth walls and anti-bot behavior.

Reliability notes

  • Engagement metrics (likes, shares, commentCount) are best-effort and can be missing on restricted views.
  • Facebook anti-bot behavior changes by page, region, and IP quality.
  • If plugin/page requests are redirected to facebook.com/login, anonymous scraping is being restricted for that IP.
  • For higher coverage, provide facebookCookieHeader and use high-quality proxies (ideally residential) in proxyConfiguration.

For the highest practical post and comment coverage on Apify:

{
"startUrls": [{ "url": "https://www.facebook.com/NASA" }],
"maxPosts": 20,
"performanceMode": "balanced",
"enrichmentMode": "deep",
"maxEnrichedPosts": 10,
"maxCommentsPerPost": 25,
"maxCommentExpansionRounds": 8,
"includeReplies": true,
"emitCommentItems": true,
"failOnCommentBlock": false,
"facebookCookieHeader": "c_user=...; xs=...",
"proxyConfiguration": {
"useApifyProxy": true,
"apifyProxyGroups": ["RESIDENTIAL"],
"apifyProxyCountry": "US"
}
}
  • Use emitCommentItems=true if you want comments as separate dataset rows.
  • Increase maxCommentExpansionRounds if you want the actor to spend more time opening additional comments and replies on each post.
  • Keep includeReplies=true if replies matter; disable it if you want slightly faster deep-mode runs.
  • Use failOnCommentBlock=true when comment extraction is mandatory and you prefer a failed run over empty comment output.
  • Expect better results with a valid logged-in cookie header than with anonymous scraping.