Skip to main content

Facebook GraphQL Scraper

Scrape Facebook GraphQL data without an API key — profiles, posts, comments, reactions, groups, marketplace, and the search engine.

The scraper is designed to be fast, lightweight, and reliable.

Fetches data directly through Facebook's internal GraphQL endpoints — the same endpoints the web app uses.

Get started​

How it works​

Existing scrapers break easily — they parse HTML, rely on CSS selectors, run a headless browser, or use browser automation. The first two are brittle: Facebook changes its markup and the selectors stop matching. The last two are resource-heavy and easy for Facebook to flag.

This scraper targets Facebook's internal GraphQL endpoints directly over HTTP.

Facebook rotates the GraphQL doc_id every few days. When that happens, the scraper evaluates Facebook's JavaScript bundle in an embedded V8 runtime (PyMiniRacer) to discover the current doc_id, then retries the request.

Facebook Gql Scraper
│
▼
┌───────────┐
│ Doc ID │◄──────────────┐
└─────┬─────┘ │
│ │
▼ │
GraphQL Request │
│ │
┌─────┴─────────┐ │
│ │ │
[Doc Id Valid] [Doc Id Invalid] │
│ │ │
▼ ▼ │
Scrape Mini JavaScript │
V8 │
│ │
▼ │
New Doc ID ────┘