Facebook Scraper API
Extract public page posts, event data, business info, and community content from Facebook. Stealth browsing handles Meta's aggressive anti-scraping measures.
Facebook remains the largest social network with billions of public business pages, community groups, and event listings. Spider uses stealth browsing to render Facebook's React interface and extract structured data from public pages.
* Disclosures and disclaimers# Guide to Facebook comments dataYou can fetch comments on a Facebook post or replies to a specific Facebook comment by using the `get()` method with the `facebook/posts/<id>/comments/preview` path. This document describes the parameters, and shows how to perform basic queries using the method.All of the examples in this document are taken from a Secure Research Environment use case and assume you have already created a Python or R Jupyter notebook and have created a client object. See Getting started to learn more.See Data dictionary for detailed information about the fields that are available.See Guide to bulk comments data for information about retrieving Facebook comments on multiple post or comment IDs using a single asynchronous query.**Estimating response size for comments**Estimating response size for any asynchronous search for comments (bulk or otherwise) has a limit of 1 million. A response size estimate of 1 million should therefore be interpreted as 1 million or more. See Search guide for more details on how to use asynchronous search, including estimating response size.## ParametersComma-separated list of fields you want included in the result. See Data dictionary for descriptions of all available fields.Sorting mode in which the comments are returned (only for synchronous endpoint). Available options:* `newest_to_oldest`: Comments are returned in reverse chronological order (newest first).* `oldest_to_newest`: Comments are returned in chronological order (oldest first).* `none`: No sorting is applied to the returned data.Default value: `newest_to_oldest`Boolean value that allows you to change the way of fetching comments. Available options:* `True`: All of the comments of the entity are returned, both nested and unnested. Since they are going to be returned in a “flattened way,” no sorting is applied. The same call, in code.
The capture above came back as markdown. These examples add a key, so you get browser rendering, proxies, and concurrency on facebook.com.
import { SpiderBrowser } from "spider-browser";
const spider = new SpiderBrowser({
apiKey: process.env.SPIDER_API_KEY!,
});
await spider.connect();
const page = spider.page!;
await page.goto("https://www.facebook.com/NASA/");
// No selectors, no schema. Spider reads the page and names the fields.
const data = await page.scrape();
console.log(data);
await spider.close(); import { SpiderBrowser } from "spider-browser";
const spider = new SpiderBrowser({
apiKey: process.env.SPIDER_API_KEY!,
stealth: 2,
});
await spider.connect();
const page = spider.page!;
await page.goto("https://www.facebook.com/NASA/");
await page.content(12000);
const data = await page.evaluate(`(() => {
const posts = [];
document.querySelectorAll("[role='article']").forEach(el => {
const text = el.querySelector("[data-ad-preview='message']")?.textContent?.trim();
const time = el.querySelector("abbr")?.getAttribute("title");
if (text) posts.push({ text: text.slice(0, 500), time });
});
return JSON.stringify({ total: posts.length, posts: posts.slice(0, 5) });
})()`);
console.log(JSON.parse(data));
await spider.close(); Ready for volume? Get an API key →
What teams build with facebook.com data.
Brand Monitoring
Track public mentions, reviews, and customer feedback across Facebook business pages and community groups.
Event Discovery
Aggregate public events by location, category, or date to build event listing platforms and calendars.
Competitive Analysis
Monitor competitor page activity, posting frequency, and engagement patterns on public business pages.
Local Business Data
Extract business profiles, hours, contact info, and reviews from Facebook business pages for directory enrichment.
Fields you can pull.
Spider names these from the page. The capture above came back as markdown; the same
call with return_format: "json" returns them as keys.
Meta anti-bot bypass
Residential proxies and fingerprint rotation handle Meta's aggressive anti-scraping detection on Facebook.
React SPA rendering
Full browser rendering for Facebook's complex React interface, including lazy-loaded posts and comments.
Page & post data
Extract posts, engagement metrics, business info, events, and page metadata in structured JSON.
What facebook.com costs to scrape.
The capture above cost $0.00163 to fetch. Pricing is $1 per GB of pre-transformation bandwidth plus $0.001 per CPU minute, so a page like this one lands at a fraction of a cent. Failed requests are billed at $0.
- Free balance on signup
- No card required to test
- Balance never expires
Run it keyless, no account
Scraping facebook.com.
Can I scrape Facebook without an account?
Spider extracts data from public Facebook pages, business profiles, and events that are visible without logging in.
How does Spider bypass Facebook anti-bot?
Spider uses residential proxies, browser fingerprint rotation, and full Chrome rendering to navigate Facebook's anti-scraping defenses.
What Facebook data can I extract?
Public posts, page names, likes, comments, shares, timestamps, media, event details, business info, and page metadata.
Can I scrape Facebook Marketplace?
Spider can access publicly visible Marketplace listings, though availability varies by region and listing visibility settings.
More Social scrapers.
Reddit Scraper
Extract subreddit posts, comments, vote counts, and user data from Reddit. The fastest Reddit scraping API with full JavaScript rendering for new Reddit and old Reddit layouts.
LinkedIn Scraper
Extract public company profiles, employee counts, job listings, and professional data from LinkedIn. The most reliable LinkedIn scraping API with residential proxy rotation and stealth browsing to handle aggressive anti-bot protection.
Twitter/X Scraper
Extract tweets, user profiles, engagement metrics, and trending topics from X (formerly Twitter). Full stealth browsing with residential proxies to handle X's aggressive bot detection.
Start scraping facebook.com.
You already have the call. A key raises the rate limit and turns on browser rendering, proxies, and concurrency. Balance never expires, and top-ups go through secure checkout.