How to Scrape Facebook Data: Pages, Posts, Ads and Marketplace
To scrape Facebook data, use the official route where one exists: the Graph API reads public Pages you don't manage only with the Page Public Content Access feature, which needs App Review and Business Verification, and the Ad Library API covers ads. Marketplace and personal profiles have no general read API, so most teams collect public Page posts, comments and listings through a hosted API instead of maintaining a scraper.
"Facebook data" covers very different things: Page posts, comments, reels, ads, events, groups and Marketplace listings. Each has its own rules, and the official route only covers some of them. This guide maps every data type to the cheapest legitimate route, then shows code for the most common job: tracking public Pages.
What Facebook data you can collect, and how
| Data | Official route | Notes |
|---|---|---|
| Public Page details and posts | Graph API with Page Public Content Access (PPCA) | App Review and Business Verification; about 600 ranked posts a year per Page |
| Comments on Page posts | Graph API with PPCA | Same review |
| Ads | Ad Library API (ads_archive) | Outside the EU, only social issue, election or political ads |
| Marketplace listings | No public read API | See Facebook Marketplace API |
| Public groups and events | Limited; check Meta's current Graph API docs for your case | See Facebook Groups API and event scrapers |
| Personal profiles | None | Collect as little as you can; usually leave them out |
| Research access to all of the above | Meta Content Library | Free, for qualifying research organizations only |
Route 1: the Graph API for public Pages
To read a Page you don't manage, your app needs the Page Public Content Access feature. Meta's feature page says it covers "business metadata, public comments, and posts", requires "successful completion of the App Review process" before live data, and "is only available with business verification". During testing, your app can only read Pages whose admins also have a role on your app.
Once approved, a Page's posts come from the feed edge:
curl -G "https://graph.facebook.com/PAGE_ID/posts" \
-d "fields=message,created_time,permalink_url,shares,reactions.summary(true).limit(0),comments.summary(true).limit(0)" \
-d "limit=100" \
-d "access_token=YOUR_TOKEN"
Two limits from the Page feed reference shape your design: "The API will return approximately 600 ranked, published posts per year", and you can read at most 100 posts per request. A Page that posts 5 times a day publishes about 1,800 posts a year, so you would see about a third of them through the API. Plan backfills with that gap in mind. Our Facebook post scrapers post compares other ways to get posts.
Route 2: the Ad Library API
The ads_archive endpoint searches ads by keyword or Page with ad_type values such as ALL and POLITICAL_AND_ISSUE_ADS, and ad_reached_countries set to ALL or ISO country codes. The catch: ads that reached no EU location are returned only if they are about social issues, elections or politics. So a search for a sneaker brand's US ads returns nothing. Our Meta Ad Library API guide covers the fields and search rules.
Route 3: the Meta Content Library, for researchers
Meta's Content Library gives public content from Facebook, Instagram and WhatsApp Channels, and Threads in the web tool. There are "no fees associated with access or computation", but you must be affiliated with a not-for-profit academic or research organization, and an independent body reviews each application. If you qualify, it is the most complete source there is.
Open-source Facebook scrapers and their limits
The best-known Python package, facebook-scraper, has about 3,300 stars, but its last push was 22 June 2024. Its README says some functions, such as reactions, need you to be logged in with cookies, that "If you scrape too much, Facebook might temporarily ban your IP", and that groups may return only one page. Logged-in collection also means you have agreed to Meta's terms, which changes your position (see below). For anything that has to run every day, an unmaintained parser of a site that changes often is a poor base.
Route 4: a hosted API
A hosted API reads public Pages, posts, comments, ads and listings without a Meta app or review. The common job is a weekly tracker for a set of competitor Pages:
import requests
KEY = "YOUR_KEY"
PAGES = ["https://www.facebook.com/nike", "https://www.facebook.com/adidas"]
def get(path, **params):
r = requests.get("https://scrapeio.com" + path, params=params,
headers={"x-api-key": KEY}, timeout=60).json()
return r["data"] if r.get("success") else None
for url in PAGES:
page = get("/v1/facebook/profile", url=url)
posts = get("/v1/facebook/profile/posts", url=url) or {"items": []}
for p in posts["items"]:
engagement = (p["likes"] or 0) + (p["comments"] or 0) + (p["shares"] or 0)
rate = engagement / page["followers"] if page and page["followers"] else None
print(page["handle"] if page else url, p["created_at"], p["url"], engagement, rate)
Posts come back with the same likes, comments, shares and created_at fields as every other platform, so the engagement formula works unchanged on Instagram or TikTok rows.
Budget. Twenty Pages, one profile call and two pages of posts each, weekly, is 20 x 3 x 4 = 240 calls a month, about $0.45 at $1.88 per 1,000 credits. Add comments on each Page's top 3 posts and it becomes 480 calls, about $0.90.
Fields worth keeping per post
- Post URL and id, stored as text.
created_atin UTC, plus the time you pulled it.- Type: photo, video, reel, link or text. Reels and links behave differently, so never average them together.
- Reactions, comments, shares and, for video, views.
- The Page's follower count on the day you pulled it, so engagement rate stays fair as the Page grows.
What Meta's terms say
Meta's Terms of Service say: "You may not access or collect data from our Products using automated means (without our prior permission)". Its separate Automated Data Collection Terms add that accepting those terms "alone does not constitute the required written permission". Courts have looked at logged-in and logged-off collection differently; our legal guide covers the 2024 Meta v. Bright Data ruling. Stick to public data, collect what you need, and leave personal profiles out unless you have a clear lawful reason.
This is not legal advice. Terms and law change, and the answer depends on where you are and what you do with the data. Our guide to the main web scraping cases has the background.
Doing it with ScrapeIO
ScrapeIO reads public Facebook data with no Meta app: the Facebook Page posts API, comments API, Ad Library search API and Marketplace search API, at 1 credit a call. See the Facebook platform page or connect an agent through the Facebook MCP server.
FAQ
Can you scrape Facebook without logging in?
Public Pages, public posts and Marketplace listings are visible logged off, and hosted APIs read them without a Facebook account. Reactions and many group features need a login in open-source tools.
Is it legal to scrape Facebook?
Meta's terms forbid automated collection without permission. Whether that binds you, and what else applies, depends on your country, your method and your use. Get legal advice before a commercial project.
Does Facebook have an API for posts?
Yes, the Graph API, but reading Pages you don't manage needs Page Public Content Access, App Review and Business Verification, and returns about 600 posts a year per Page.
Can I scrape Facebook Marketplace?
Meta has no public API for reading listings. Listings are public on the website, and hosted APIs search them by location, keyword and price.
Can I scrape Facebook groups?
Only public groups, and only what they show logged off. Private groups are off limits on every legitimate route.
Sources
Checked on 9 November 2026 from each vendor's own pages. Prices and limits change; follow the links before you decide.
- https://developers.facebook.com/docs/features-reference/page-public-content-access
- https://developers.facebook.com/docs/graph-api/reference/page/feed/
- https://developers.facebook.com/docs/graph-api/reference/ads_archive/
- https://transparency.meta.com/researchtools/meta-content-library/
- https://github.com/kevinzg/facebook-scraper
- https://www.facebook.com/terms.php
- https://www.facebook.com/legal/automated_data_collection_terms
100 free credits, no card. Credits never expire.
Get API key