Facebook Scraper: Public Facebook Pages via API
ProxyField's Web Scraping API fetches the public Facebook pages that logged-out visitors see, such as business Pages, public posts and the Ad Library, for $2.00 per 1,000 successful results with JS rendering, from $1.00 at volume, or $0.50 per 1,000 over plain HTTP where a page needs no browser. There is no separate Facebook API: you send a Facebook URL, get the page back and pay only for successful results; to start, contact sales, or run your own scraper on ProxyField residential proxies with the Easy Trial: 1 GB for $2.95.
Through the sales team on our 24/7 live chat
| Fetch | Entry | Volume, from |
|---|---|---|
| HTTP | $0.50 | $0.20 |
| JS rendering | $2.00 | $1.00 |
Billed on successful results only.
| Question | Short answer |
|---|---|
Does the Python facebook-scraper library still work? | For a small test at best: its last release, 0.2.59, is from August 31, 2022, and some functions need login cookies |
| What to use in Python instead | Meta's Graph API for Pages you manage; requests for a Page's og: tags; Playwright or the Web Scraping API ($2.00 per 1,000 rendered pages) for posts |
| A competitor's ads in the Ad Library | Their active ads, per country, from the public Ad Library; one rendered page per advertiser and country costs $0.002 |
| Public group posts without logging in | Some, not reliably: Facebook says anyone on or off Facebook can see a public group's content, but logged out it often shows a login prompt; private groups never |
Public Facebook data you can collect
Facebook shows logged-out visitors less than signed-in users: mostly business Pages, some of their public posts, public events and the public Ad Library, often under a sign-in prompt. Personal profiles, private groups, friends lists, Messenger and most comments need a login and are out of scope.
| Page | URL pattern | What a logged-out visitor usually sees |
|---|---|---|
| Business Page | facebook.com/<page-name> | Name, category, description, follower and like counts, website, address and hours where published, recent public posts |
| Public post | facebook.com/<page-name>/posts/<id> | Text, date, media, reaction, comment and share counts |
| Public group post | facebook.com/groups/<group>/posts/<id> | Some posts and counts, when Facebook does not show the login prompt |
| Event | facebook.com/events/<id> | Title, date, place, organiser, description, for public events |
| Ad Library | facebook.com/ads/library/ | Active ads by advertiser and country: creative, text, start date, platforms, Library ID |
| Link preview tags | Any Page's HTML og: meta tags | Title, description and image, no browser needed |
What Facebook shows logged out changes often and differs by country, so test your page types before you plan a volume. The API returns the page itself as HTML, Markdown or plain text, or a JSON envelope with the status code, the final URL, the headers, the cookies and the content; it has no parsed Facebook fields, so your parser reads them.
Does the Python facebook-scraper library still work?
Not as something to build on. The facebook-scraper package on PyPI has had no release since version 0.2.59 on August 31, 2022; its GitHub repository was last updated in June 2024 and showed 447 open issues and pull requests in October 2026. Its own README warns that "If you scrape too much, Facebook might temporarily ban your IP" and that some functions, such as reactions, need you to be logged in with cookies, which Meta's terms do not allow for automated collection. Use it for a small test of public Pages at most, and expect fields to come back empty.
| Python option | Login needed | Breaks when Facebook changes | Cost |
|---|---|---|---|
facebook-scraper library | For reactions and some other functions | Often; no release since August 2022 | Your IPs |
| Meta's Graph API (Pages API) | An app, a token and Meta's review | Rarely; versioned by Meta | Set by Meta |
requests + Beautiful Soup on a Page's og: tags | No | Rarely: the tags are for link previews | $0.50 per 1,000 via the API, or your proxy traffic |
| Playwright through a residential proxy | No, for logged-out pages | When the page layout changes | From $1.95/GB of residential traffic |
| Web Scraping API with JS rendering | No | Fetching is ours, parsing is yours | $2.00 per 1,000 successful rendered pages, from $1.00 |
For Pages you own or manage, the Graph API is the stable route. For public Pages you do not manage, read the link preview tags with requests (the code below) and render posts with Playwright or the Web Scraping API.
Sources: facebook-scraper on PyPI, its GitHub repository, Meta's Automated Data Collection Terms.
Scrape the Facebook Ad Library for a competitor's ads
The Ad Library shows the active ads an advertiser runs on Meta's products, one country at a time, without a login. Do it by hand first, then automate the same page:
-
Open facebook.com/ads/library and choose the country where the ads are shown.
-
Choose "All ads" as the ad category.
-
Search for the competitor's exact Facebook Page name and pick the advertiser from the suggestions, not the keyword search.
-
Set "Active status" to "Active ads".
-
Read each ad's creative, text, start date and platforms, and note its Library ID and ad URL so you can track changes.
-
Copy the URL of that results page: it carries the country, the active status and the Page ID, so the same URL, fetched with JS rendering, is your automated check.
-
Repeat for each country the competitor sells in, because ads can be shown in one country only.
Read moreShow less
What the Ad Library does not give you:
- Past commercial ads. Inactive ads stay in the library only for ads about social issues, elections or politics, kept for 7 years. Save each check if you want a history.
- Spend, reach and targeting for commercial ads. Meta shows who paid, the spend and reach by demographic for social-issue, election and political ads only.
- A guaranteed "every ad". Ads differ by country and version, and Meta can remove ads that break its rules, so check each country and record what you found and when.
Meta's Ad Library API is the official route, after identity confirmation, but it covers ads about social issues, elections and politics and ads delivered in the EU, not every commercial ad worldwide. For other ads, the public library page is the source.
| Ad Library check (30-day month) | Rendered pages | At $2.00 per 1,000 |
|---|---|---|
| 1 competitor, 1 country, daily | 30 | $0.06 |
| 50 competitors, 1 country, weekly | about 215 (50 × 4.3 weeks) | about $0.43 |
| 50 competitors, 5 countries, daily | 7,500 | $15 |
These counts assume one rendered results page per advertiser and country per check; an advertiser with many ads needs the page scrolled further, which the counts do not include. Billed: a page Facebook answered with a 2xx status. Not billed: blocked requests, timeouts and errors on our side; a blocked request is retried on new IPs, and the retries are not billed. Every response says whether it was billed. A target's 404 or 410, and a sign-in page the site serves with a 200 status, count as billed results.
Public Facebook groups without logging in
Some posts, not reliably. Facebook's help pages say that anyone on or off Facebook can see a public group's content, but logged-out visitors often get a login prompt after a few posts, and comments, media and member lists are limited. A logged-out scraper therefore gets part of a public group, never its complete history; private groups are never visible without membership.
- What works fetch known public post URLs one by one with JS rendering, at $2.00 per 1,000 successful results, and read the text, date and counts.
- What to expect comment counts rather than full comment threads, and gaps where Facebook shows the login prompt.
- What not to do log in, use an account, or get past the login prompt. ProxyField's acceptable use policy forbids accessing data behind logins you are not entitled to.
- People's data members' posts and names are personal data, so in the EU and UK the GDPR needs a lawful basis and data minimisation, and post content can be protected by copyright. For a full dataset, ask the group's admins for permission.
Source: Facebook Help Center, group privacy settings.
How the Web Scraping API fetches a Facebook page
Facebook builds its pages in the browser, so send Facebook URLs with JS rendering on; the Web Scraping API returns the rendered page. The API takes a POST to https://api.proxyfield.io/v1/scrape with your API key in an Authorization: Bearer <api_key> header and a JSON body: url, render (false for plain HTTP, true for JS rendering), country and output (html, markdown, text or json); with rendering, wait_for takes a CSS selector to wait for before the page is returned. Parameter reference: API documentation.
# The request the Web Scraping API takes (access through Contact sales)
curl https://api.proxyfield.io/v1/scrape \
-H "Authorization: Bearer <api_key>" \
-H "Content-Type: application/json" \
-d '{"url": "https://www.facebook.com/examplebrand", "render": true, "country": "us", "output": "json"}'Example response (shortened; content is the rendered page's HTML):
{
"metadata": {"id": "req_63f1b8d0e5a29c47", "api": "web_scrape", "status": "success", "billed": true},
"status_code": 200,
"final_url": "https://www.facebook.com/examplebrand",
"content_type": "text/html; charset=utf-8",
"content": "<!DOCTYPE html><html id=\"facebook\" lang=\"en\">…</html>"
}| Choice | Price per 1,000 successful results | Use it for |
|---|---|---|
| JS rendering | $2.00, from $1.00 at volume | Page timelines, posts, public group posts, events and the Ad Library |
| Plain HTTP | $0.50, from $0.20 at volume | A Page's name, description and image from its og: tags |
Pricing: $2.00 per 1,000 Facebook pages, from $1.00
Facebook pages cost the Web Scraping API's JS rendering price: $2.00 per 1,000 successful results, from $1.00 at volume; pages that need no browser cost $0.50 per 1,000, from $0.20. You pay only for successful results. The volume prices start at 10,000 successful results in one purchase.
Payment and balance: the same crypto balance as proxies, which never expires; there is no subscription or monthly fee. All prices: pricing.
Through the sales team on our 24/7 live chat
Sales contact: the sales team on our 24/7 live chat.
| Workload (30-day month) | Results | JS rendering at $2.00 | Plain HTTP at $0.50 |
|---|---|---|---|
| 300 competitor Pages, checked daily | 9,000 | $18 | $4.50 |
| 50 advertisers in the Ad Library, weekly | about 215 | about $0.43 | – |
| 20,000 public posts, once | 20,000 | $40 | – |
Meta's official tools or scraping?
Meta offers 3 official routes to public Facebook data, each with its own approval: the Graph API, which gives an app access to Pages it manages and, after Meta's app review, to public Page content; the Ad Library API, for ads about social issues, elections and politics and for ads delivered in the EU; and the Meta Content Library, for approved researchers. Scraping reads what a logged-out visitor sees instead, which is less than these tools give, and Meta's terms require its express written permission for automated collection.
| Item | Meta's APIs and Content Library | Web Scraping API |
|---|---|---|
| Who can use it | Approved apps, verified Ad Library users, approved researchers | ProxyField customers |
| Data | Pages you manage, reviewed public content, ads, research datasets | Public Pages, posts, events and the Ad Library as shown logged out |
| Approval | Meta's review per product | None from ProxyField beyond the acceptable use policy; Meta's terms still apply |
| Cost | Set by Meta | $2.00 per 1,000 successful rendered pages, from $1.00 |
What teams use Facebook data for
- Competitor monitoring what competitors' Pages post, how often and how it performs.
- Ad research which creatives and offers competitors run, from the public Ad Library.
- Local business data category, address, hours and website from business Pages.
- Event research public events by place and date for travel, venues and ticketing analysis.
Not allowed on ProxyField: spam, fraud including fake accounts or engagement, and accessing data behind logins you are not entitled to. Running your own Facebook ad or business accounts through fixed IPs is a different job: Facebook proxies. Marketplace listings have their own page: Facebook Marketplace scraper.
Scrape Facebook with Python and ProxyField proxies
The lightest public data on a Facebook Page is in its link preview tags, which Facebook serves in the HTML for other sites to read. Python can read them without a browser; for posts, groups and the Ad Library, use a headless browser such as Playwright through the same proxy. Facebook often answers plain requests with a login page, so the code checks for that.
import requests
from bs4 import BeautifulSoup
proxy = "http://<login>-country-us-city-new_york:<password>@gate.proxyfield.io:7000"
url = "https://www.facebook.com/examplebrand" # a public business Page
resp = requests.get(url, proxies={"http": proxy, "https": proxy},
headers={"User-Agent": "Mozilla/5.0", "Accept-Language": "en-US"},
timeout=30)
soup = BeautifulSoup(resp.text, "html.parser")
tags = {m["property"]: m.get("content") for m in soup.select('meta[property^="og:"]')}
if not tags or "login" in resp.url:
print("No public data or a sign-in page:", resp.status_code, resp.url)
else:
print(tags.get("og:title"), "|", tags.get("og:description"))ProxyField residential proxies cost $2.95/GB for 1 GB and from $1.95/GB at volume, with no subscription; the traffic never expires, and all purchases are final. You get 412M+ residential IPs in 195+ countries and 21,000+ cities, a new IP on every request or a sticky session from 30 s to 36 h, over HTTP, HTTPS or SOCKS5. The username format is <login>-country-us-city-new_york.
Meta's terms and the law
Meta's Automated Data Collection Terms (effective October 7, 2024) say you will not collect data by automated means "without first obtaining Meta's express written permission", so scraping Facebook without it breaches Meta's terms, separate from whether it breaks a law. Posts, names and photos are personal data in the EU and UK, so GDPR needs a lawful basis and data minimisation, and post content and media can be protected by copyright. The full answer is in Is It Legal to Scrape LinkedIn, Instagram, X and Other Social Media? and Is Web Scraping Legal? US, EU and UK Rules (2026).
ProxyField's acceptable use policy allows collecting public web data and social media monitoring, and forbids fake accounts and engagement and accessing data behind logins you are not entitled to. ProxyField's rule for every site: public pages only, and follow the site's terms. This is not legal advice.
More scraper APIs
- Social media scraper public pages from several networks on the same Web Scraping API.
- Instagram scraper public profiles and posts, on the same API.
- TikTok scraper public profiles and posts, on the same API.
- X (Twitter) scraper public profiles and posts, on the same API.
- Facebook Marketplace scraper public Marketplace listings.
- Web Scraping API any URL, plain HTTP or with JS rendering, from $0.20 per 1,000 successful results.
- All scraper APIs
Facebook Scraper FAQ
24/7 support by live chat, including help with setup and integration.
What's a good tool for scraping Facebook?
ProxyField's Web Scraping API fetches the public Facebook pages that logged-out visitors see, such as business Pages, public posts and the Ad Library, for $2.00 per 1,000 successful rendered pages, from $1.00 at volume. For data behind a login or at research scale, Meta's own APIs and Content Library are the tools; compare scrapers by what they reach logged out and what counts as a billable result.
Does the Python facebook-scraper library still work, or what should I use to scrape Facebook pages with Python?
Only for small tests: facebook-scraper has had no release since 0.2.59 on August 31, 2022, its README warns that Facebook may ban your IP, and some functions need login cookies. Use Meta's Graph API for Pages you manage, requests and Beautiful Soup for a public Page's og: tags, and Playwright or ProxyField's Web Scraping API, at $2.00 per 1,000 rendered pages, for public posts.
How do I scrape the Facebook Ad Library to see every ad a competitor is running?
Open facebook.com/ads/library, choose a country and "All ads", pick the competitor's exact Page from the suggestions and set "Active status" to "Active ads"; that results page lists their active ads with creative, text, start date and Library ID. Fetch the same URL with JS rendering on a schedule, at $2.00 per 1,000 rendered pages, once per country, because ads can run in one country only. Past commercial ads, spend and targeting are not shown; those are kept only for social-issue, election and political ads.
Can I scrape posts and comments from a public Facebook group without logging in to an account?
Partly. Facebook says anyone on or off Facebook can see a public group's content, but logged out it often shows a login prompt and limits posts and comments, so you get some posts and comment counts, not the complete history; private groups are never visible. Fetch known public post URLs with JS rendering at $2.00 per 1,000 successful results, never log in to get past the prompt, and treat members' posts as personal data.
What is a Facebook scraper?
A tool or script that collects public data from Facebook pages automatically, such as Page details, post counts or ads. It can be your own headless browser on proxies or a scraping API that fetches the pages for you.
How do I scrape Facebook?
List the public Page, post, event or Ad Library URLs you need, fetch them logged out with a headless browser or a scraping API with JS rendering, and read the fields from the rendered page. Keep the rate low and stop at the sign-in prompt rather than logging in.
What Facebook data can you scrape?
From logged-out pages: a business Page's name, category, description, follower count, website, address and hours, its public posts with reaction and share counts, public events and the active ads in the Ad Library. Personal profiles, private groups, friends lists and most comments need a login and are out of scope.
What do people use Facebook data for?
Mostly competitor monitoring of brand Pages, ad research in the Ad Library, local business data such as categories and hours, and event research. Researchers use Meta's Content Library for larger studies.
Does Facebook have an API for scraping data?
Meta's Graph API gives an app access to Pages it manages and, after Meta's app review, to public Page content; the Ad Library API covers social-issue, election and political ads and ads delivered in the EU. Each needs Meta's approval, and none returns personal profiles or private groups for business use.
Can I see a competitor's past Facebook ads?
Only their active ads, unless the ads are about social issues, elections or politics, which the Ad Library keeps for 7 years. To build a history of commercial ads, save each Ad Library check with its date and Library IDs.
Show 9 more questionsShow fewer questions
How do I scrape Facebook posts?
Open the public Page in a headless browser, let the timeline load and read each post's text, date and counts, or fetch known post URLs one by one. Logged out, Facebook shows only some recent posts, so plan on fewer than a signed-in user sees.
How do I scrape Facebook comments?
Facebook shows logged-out visitors few comments, mostly only the count on each post. Comments in full are behind the login, and commenters' names and texts are personal data, so a logged-out scraper should collect counts rather than comments.
Can I scrape Facebook profiles?
Personal profiles show logged-out visitors little beyond a name and a photo, and they are personal data, so collecting them needs a lawful basis that most business uses lack. Business Pages are the public part of Facebook that a scraper can use.
How many Facebook pages can I scrape per day without getting flagged?
Facebook publishes no limit; it shows the sign-in prompt sooner and blocks IPs that send fast, repetitive requests. Keep a few hundred Pages a day at a slow, steady rate with pauses between requests, and slow down as soon as sign-in prompts rise.
Is Facebook scraping detectable?
Yes: Facebook watches request rates, IP types and browser behaviour, and answers automated traffic with the sign-in prompt or a block. Collect only public pages, keep the rate low and stop at the sign-in prompt rather than logging in.
Can I scrape Facebook events?
Public events show their title, date, place, organiser and description to logged-out visitors, so their pages can be fetched with JS rendering at $2.00 per 1,000 successful results. Lists of who is going are behind the login.
What's the safest way to scrape Facebook for academic research?
Apply for Meta's Content Library, which gives approved researchers public Facebook and Instagram content within Meta's rules. Scraping is the fallback for public Pages only, with an ethics review and data minimisation.
Do browser extension scrapers work for Facebook?
They read what your own browser shows, so they work for a few pages, but if you are signed in they collect logged-in data, which breaches Meta's terms. They also do not scale or run on a schedule.
How do I make Facebook re-scrape my website's link preview?
Facebook's crawler reads your page's Open Graph tags when someone shares a link and caches the preview. After changing the tags, paste the URL into Meta's Sharing Debugger and choose "Scrape Again" to refresh it.
Related pages
Collect Facebook pages with the Web Scraping API
Billed on successful results only. Contact sales for the Web Scraping API and the volume you need, or run your own scraper on residential proxies. 24/7 live chat helps with setup and integration.