Facebook Post & Comment Scraper for Pages, Groups and Profiles
Pricing
from $1.00 / 1,000 results
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
Actor stats
0
Bookmarked
16
Total users
8
Monthly active users
10 days ago
Last modified
Categories
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:
scraplingfirst,pydoll-pythonfallback. - 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 namestartUrls(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,0means auto)performanceMode(string):fast(default),balanced, ormaxCoverageenrichmentMode(string):none(default),basic, ordeepmaxEnrichedPosts(integer): max posts per URL to process with enrichment (0-200)maxCommentsPerPost(integer): max comment text samples per post indeepmode (0-200)maxCommentExpansionRounds(integer): maximum expand/scroll passes for comment and reply loading indeepmode (1-20)includeReplies(boolean): whentrue, deep-mode browser extraction attempts to expand replies as well as top-level commentsemitCommentItems(boolean): whentrue, recovered comment samples are also emitted as separate dataset items withitemType=commentfailOnCommentBlock(boolean): whentrue, deep-mode runs fail if Facebook login-wall blocking prevents comment extraction for enriched postsfacebookCookieHeader(string, optional): raw Facebook cookie header from your logged-in browser session (c_user=...; xs=...) to improve post coverage when anonymous access is blockedproxyConfiguration(object, optional): Apify Proxy / custom proxy settings (recommended: residential proxy group)
Output fields
Each dataset item includes:
itemTypesourceUrlpostAuthorpostTimestamppostTextpostUrlpostIdpostOwnerIdlikessharescommentCountlikesCountsharesCountcommentCountValueprofileNameprofileUrlprofileUsernameprofileIdprofileImageUrlprofileFollowersprofileFollowersCounttargetTypetargetTitletargetDescriptiontargetImageUrltargetFollowerstargetFollowersCounttargetUrlenrichmentModecommentExtractionStatuscommentExtractionMethodisEnrichedexternalUrlsmediaUrlsmediaCountcommentSamplescommentSamplesCountparentPostIdparentPostUrlcommentTextcommentAuthorcommentAuthorUrlcommentTimestampcommentIdcommentUrlcommentSampleIndexscrapedWithscrapedAt
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
facebookCookieHeaderand use high-quality proxies (ideally residential) inproxyConfiguration.
Recommended production settings
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=trueif you want comments as separate dataset rows. - Increase
maxCommentExpansionRoundsif you want the actor to spend more time opening additional comments and replies on each post. - Keep
includeReplies=trueif replies matter; disable it if you want slightly faster deep-mode runs. - Use
failOnCommentBlock=truewhen 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.
