
Facebook Page Posts Scraper
FreeEfficiently extract and analyze Facebook page posts.
Free · Opens the source repo
What Facebook Page Posts Scraper does
The Facebook Page Posts Scraper is a Python-based tool designed to extract structured data from public Facebook page timelines. By utilizing this skill, users can scrape posts, retrieve engagement metrics, and analyze the content of Facebook pages they are interested in. It captures essential data points such as post text, author information, likes, comments, shares, and even reaction breakdowns, allowing for a comprehensive understanding of audience engagement. This skill is particularly useful for social media analysts, marketers, and researchers who need to monitor and assess the performance of Facebook content.
To use the scraper, the target Facebook page must be open in the user's browser, and they must be logged into Facebook. The tool operates by reading the data already displayed on the page, ensuring it adheres to Facebook's access controls. Users can leverage two main scripts: one to resolve the Facebook page URL to its numeric ID and another to fetch the posts from the timeline. The scraper supports pagination, enabling users to collect data in bulk while filtering posts by date range, which is essential for targeted analysis.
This skill is ideal for anyone looking to gather Facebook post data for analytics, content strategy, or competitive analysis. With the ability to extract detailed engagement statistics and content references, users can gain insights into audience preferences and trends. The structured output makes it easy to integrate the scraped data into further analysis or reporting workflows.
While the Facebook Page Posts Scraper is powerful, it has limitations; for instance, it does not provide direct URLs for media thumbnails or photos, which may restrict some use cases. Additionally, the skill requires a logged-in session to function properly, which may not be suitable for all users. Nevertheless, for those who are looking to analyze public Facebook page content, this tool offers a straightforward and effective solution.
When to use it
Use this skill when you need to extract and analyze posts from a public Facebook page for insights or reporting.
When not to use it
This tool is not suitable for private pages or for users who are not logged into Facebook, as it relies on accessing publicly displayed data.
What you can build with it
Social Media Analysis
Use this skill to gather and analyze engagement metrics from a public Facebook page to inform marketing strategies.
Content Performance Monitoring
Monitor the performance of posts on a Facebook page over time by extracting data for specific date ranges.
Competitive Research
Scrape posts from competitor Facebook pages to understand their engagement tactics and audience reactions.
How to install Facebook Page Posts Scraper
View source1. Install with the skills CLI
npx skills add browser-act/skills/facebook-page-posts --agent claude-code2. Or install it manually
Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.
Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs
Inside SKILL.md
Written by browser-actFacebook — Page Posts Scraper
Facebook page URL → list of posts with full engagement metrics and text references
Language
All process output to user (progress updates, process notifications) must be in English.
Objective
Extract posts from a public Facebook Page timeline, including post content, engagement counts, reaction breakdowns, and text references (hashtags/links).
Prerequisites
- The target Facebook page is open in the browser (e.g.,
https://www.facebook.com/cern) - User is logged into Facebook (user avatar visible in the top right)
Pre-execution Checks
1. Tool Readiness
If browser-act has been confirmed available in the current session → skip this step.
Invoke browser-act via Skill tool to load usage. If installation or configuration issues arise, follow its guidance to resolve then retry.
2. Login Verification
If login status for Facebook has been confirmed in the current session → skip this step.
Otherwise: navigate to https://www.facebook.com and check:
- User avatar or name visible in top right → logged in, continue
- Login button visible → not logged in, inform the user and assist with login
User refuses or cannot log in → terminate execution.
Capability Components
This Skill's operational boundary = what the user can manually do in their browser. It only reads data already displayed to the user on the page, never bypassing authentication or access controls. JS code is encapsulated in Python files under the
scripts/directory, invoked viaeval "$(python scripts/xxx.py {params})".$(...)is bash syntax; it is recommended to use the bash tool for execution.
API: Resolve Facebook page URL to numeric page ID
eval "$(python scripts/get-page-id.py '{page_url}')"
Parameters:
page_url: Full Facebook page URL, e.g.https://www.facebook.com/cern
Must run while the target page is open (or any Facebook page is open) so the browser has Facebook cookies.
Output example:
{
"pageId": "100064792144187", // Numeric page ID used in all subsequent API calls
"pageUrl": "https://www.facebook.com/cern"
}
API: Fetch posts from page timeline
eval "$(python scripts/get-page-posts.py '{page_id}' --cursor '{cursor}' --after-time {after_time} --before-time {before_time} --count {count})"
Parameters:
page_id: Numeric Facebook page ID (from get-page-id above)--cursor: Pagination cursor string from previous responsepagination.endCursor; omit or passnullfor first page--after-time: Unix timestamp (seconds); only return posts after this time; omit or passnullfor no filter--before-time: Unix timestamp (seconds); only return posts before this time; omit or passnullfor no filter--count: Number of posts per batch, default5, max recommended10
Output example:
{
"posts": [
{
"postId": "1417704873732571", // Numeric post ID
"url": "https://www.facebook.com/cern/posts/pfbid…", // Post permalink
"text": "CERN Council updates European Strategy…", // Full post text
"textReferences": [
{
"type": "ExternalUrl", // "ExternalUrl" or "Hashtag"
"url": "https://home.cern/...", // Clean URL (not l.facebook.com redirect)
"offset": 731, // Position in text
"length": 96
},
{
"type": "Hashtag",
"url": "https://www.facebook.com/hashtag/espp",
"offset": 296,
"length": 5
}
],
"creationTime": 1779460218, // Unix timestamp (seconds)
"user": {
"id": "100064792144187", // Page numeric ID
"name": "CERN", // Page display name
"profileUrl": "https://www.facebook.com/cern" // Page URL
},
"likes": 1220, // Total reactions count
"comments": 44, // Comment count
"shares": 122, // Share count
"topReactions": [
{ "name": "Like", "count": 1108 },
{ "name": "Love", "count": 92 },
{ "name": "Care", "count": 9 },
{ "name": "Wow", "count": 8 },
{ "name": "Haha", "count": 1 },
{ "name": "Sad", "count": 1 },
{ "name": "Angry", "count": 1 }
],
"topReactionsCount": 1220, // Same as likes, total reactions
"media": {
"type": "Photo", // "Photo", "Video", or null for text-only
"id": "photo_id_string", // Media asset ID
"viewsCount": null // Video view count; null for photos
},
"feedbackId": "ZmVlZGJhY2s6MTQxNzcw…" // Base64 feedback ID
}
],
"pagination": {
"endCursor": "Cg8Ob3JnYW5pY19jd…", // Pass to --cursor for next page
"hasNextPage": true // false when no more posts
}
}
Error handling: If response contains "error": true, check that the target page is open and the user is logged in, then retry once. If the error persists, the doc_id may have expired — check experience notes for updates.
Pagination
API Pagination: cursor-based. Pass pagination.endCursor from each response as --cursor in the next call. Start value: omit --cursor (first page). Termination: pagination.hasNextPage === false.
Success Criteria
posts.length >= 1 AND posts[0].postId is non-null AND posts[0].likes is non-null
Known Limitations
media.idis returned but media thumbnail/photo URLs are not included in the API response for this query; only type and ID are availableviewsCountis only populated for Video-type attachments; null for photosfeedbackIdis present but detailed reaction dialog data (individual reactor profiles) requires a separate API call not covered by this Skill- The
doc_id: 27278869228466784is a Facebook internal query ID that may change when Facebook deploys updates; if all calls return errors, the doc_id may need to be recaptured via HAR recording on the page - Requires an active Facebook login session; public/unauthenticated access is not supported
- Date filtering (
afterTime/beforeTime) applies to the timeline cursor position, not a strict server-side filter; posts near the boundary may occasionally appear outside the specified range
Execution Efficiency
- Batch orchestration: Write a bash script to loop through the command templates serially within a single session; do not parallelize within one browser (prone to triggering anti-scraping restrictions). Add a 1–2 second delay between paginated calls to avoid rate limiting. To increase throughput, open multiple browser sessions and distribute work across them — each session has an independent fingerprint so rate limits apply per session
- Test before batch execution: After writing a batch script, you must first test with 1-2 items to verify the script runs correctly; only then run the full batch. Never skip testing and execute in batch directly
- Reduce redundant pre-operations: Run
get-page-idonce per page URL and reuse the result for all paginated calls - Error resumption: Save results page by page during batch processing; on failure, resume from the last successful
endCursorrather than starting over
Experience Notes
Path: {working-directory}/browser-act-skill-forge-memories/facebook-posts-scraper-facebook-page-posts.memory.md
Before execution: If the file exists, read it first — it records unexpected situations encountered during past executions (e.g., a strategy has become ineffective); adjust strategy order accordingly.
After execution: If an unexpected situation is encountered (strategy became ineffective, page redesigned, anti-scraping upgraded, better path discovered), append a line:
{YYYY-MM-DD}: {what happened} → {conclusion}
Normal execution does not write to the file. Do not record what keywords were used or how many results were returned — those are task outputs, not experience.
Frequently asked questions about Facebook Page Posts Scraper
Similar skills
Power BI Semantic Modeling
Optimize your Power BI data models with best practices.
Data Context Extractor
Tailor data analysis skills to your company's needs.
Power BI Performance Troubleshooting
Systematic guidance for optimizing Power BI performance.
Power BI Model Design Review
Optimize your Power BI data models with expert reviews.
Power BI DAX Formula Optimizer
Optimize your DAX formulas for better performance and clarity.
Fabric Lakehouse
Optimize your data solutions with Lakehouse best practices.
