How to get a Facebook Page's follower count and contact details in Python
Checked on 2026-11-19.
The official route is one Graph API request: the follower count and the contact fields are on the Page node. It works at once for a Page you manage. For any other Page your app needs the Page Public Metadata Access or Page Public Content Access feature, and both come only through App Review and business verification. Without that, an unofficial HTTP API that reads the public Page returns the same kind of data.
1. The Graph API
A Page is a node in the Graph API, and you choose its fields with the fields parameter. The names below are from Meta's Page reference; v27.0 was the latest Graph API version when this was checked.
import os
import requests
FIELDS = "name,username,link,category,followers_count,fan_count,emails,phone,website,single_line_address"
res = requests.get(
"https://graph.facebook.com/v27.0/PAGE-ID",
params={"fields": FIELDS, "access_token": os.environ["FB_ACCESS_TOKEN"]},
timeout=30,
)
page = res.json()
print(page.get("name"), page.get("followers_count"))
print(page.get("emails"), page.get("phone"), page.get("website"), page.get("single_line_address"))What the reference says about those fields:
| Field | Meaning |
|---|---|
followers_count | "Number of page followers" |
fan_count | "The number of users who like the Page." For a Page on the New Page Experience it returns followers_count |
emails | "The emails listed in the About section of a Page." |
phone | "Phone number provided by a Page." |
website | "The URL of the Page's website." |
single_line_address | "The Page address, if any, in a simple single line format." |
Which Pages the Graph API lets you read
A Page you manage. Use a token of someone who can perform the MODERATE task on the Page, with the permissions pages_show_list, pages_read_engagement and pages_read_user_content. The Graph API Explorer hands out a token for testing, and /me/accounts lists your Pages with their ids. No review is needed while everyone who uses the app has a role on it: Meta's App Review page says "If your app will only be used by app users who have a role on the app itself, App Review is not required."
Any other Page. The reference names two features, and an app needs one of them:
- Page Public Metadata Access, whose allowed usage is "to analyze engagement with public Pages by viewing Like and follower counts, or aggregate public-facing About Page information from multiple, disparate pages".
- Page Public Content Access, which also covers a Page's posts and comments. The reference lists
phoneas readable with this feature only, and Meta's page for the first feature says it "is superseded by" this one.
Each of them "requires successful completion of the App Review process before your app can access live data" and "is only available with business verification". With one approved, the request above works for a published, unrestricted Page with an app access token or a user access token.
Where it stops: at the review. If you are building a product on Page data and your business can pass it, this is the route to take: it is the official one, and the Page node has many more fields than the few shown here. For a one-off list or a prototype the review is a lot, and before it an app reads only Pages whose admin has a role on the app.
2. An HTTP API that reads the public Page
Pipefetch returns what a Page says about itself for one HTTPS request with one key. There is no Meta app, no token and no review, because it does not use the Graph API: it reads what the Page shows a visitor who is not logged in. It is an independent service, not an official API, and it is not affiliated with or endorsed by Meta.
import os
import requests
res = requests.get(
"https://pipefetch.com/v1/facebook/page",
params={"page": "nasa"}, # username, numeric id or URL
headers={"x-api-key": os.environ["PIPEFETCH_API_KEY"]},
timeout=90,
)
if res.status_code == 404:
print("No such public Page") # not charged
else:
res.raise_for_status()
page = res.json()["data"]
print(page["name"], page["category"], page["isVerified"])
print(page["followerCount"]) # 28723751
print(page["emails"], page["phones"], page["websites"])
print(page["address"], page["socialLinks"])What to know about the answer:
followerCountis the number Facebook publishes: exact for most Pages (28723751, not "28M"), and a rounded figure for a few very large ones.- Emails, phone numbers, websites, the address and the social links are what the Page lists about itself. What a Page does not list comes back as
nullor an empty list. Nothing is guessed. - Opening hours, the number of likes, the long About text and the Page's creation date are not included.
- A Page that does not exist answers 404
page_not_foundand costs nothing. So does a Page that Facebook shows only to people who are logged in, one limited by age or country for example. - A request costs 2 credits, because reading a Page takes more of our resources than our other requests. A new account has 100 free credits and needs no card.
The reference lists every field. When a Page lists a website and no email, the website contacts endpoint reads the emails and phone numbers that website publishes.
Which one should you use?
| Situation | Use |
|---|---|
| Your own Pages, or Pages whose admins have a role on your app | The Graph API |
| A product on other Pages' data, and a business that can pass App Review | The Graph API with one of the two features |
| Follower counts and listed contact details of public Pages, without a Meta app | An unofficial HTTP API such as Pipefetch |
Followers or likes?
The Graph API has both: fan_count is the number of people who like a Page. But the Page reference says that for New Page Experience Pages "this field will return followers_count", so ask for followers_count. Pipefetch returns the follower count and no separate number of likes.
What about the facebook-scraper library?
There is a Python library that reads Facebook's pages without the Graph API, facebook-scraper. Its latest release on PyPI, 0.2.59, is from August 2022. Its README warns "If you scrape too much, Facebook might temporarily ban your IP", and says some functions need the cookies of a logged-in account. Meta's terms of service say you "may not access or collect data from our Products using automated means (without our prior permission)", so a scraper of your own is against them.
Pipefetch is not an official route either: it is an independent service, and you are responsible for how you use what it returns. If Meta's approval matters to your project, the Graph API is the route to take.
A Page's contact details can be a person's
A Page can belong to a company, and it can belong to one person: a creator, a freelancer, a shop run from a kitchen table. Then the email, the phone number and the address it lists are that person's own, and they are personal data under laws such as the GDPR, whichever route fetched them.
Keep to organisations where you can, store only what your purpose needs, and do not build lists of private individuals. The Pipefetch terms forbid using the data to harass people or to build profiles of private individuals, and sending unsolicited bulk messages to addresses or phone numbers the API returned where the law forbids it.
Try it with 100 free credits. No card needed. No scraper to build or maintain. Get an API key or read the docs.
Free tools for this
APIs used in this guide
-
1 credit
Website Contacts API
The emails, phone numbers and social profiles a website publishes, with its contact page, address and company name.
GET /v1/web/contacts -
2 credits
Facebook Page API
The public details of a Facebook Page: category, followers, email, phone, website, address, social links and pictures.
GET /v1/facebook/page -
2 credits
Facebook Posts API
The newest posts of a Facebook Page with text, images, reactions by type, comment and share counts, and top comments.
GET /v1/facebook/posts
More Facebook guides
- How to get a Facebook Page's posts without app review
- Is there a Facebook Marketplace API?
- Facebook Groups API alternatives after its removal in 2024
Guides for other sources
Every source
YouTube
- How to get a YouTube transcript in Python
- How to get a YouTube transcript in Node.js
- YouTube API quota exceeded: what the error means and how to fix it
- How to find a YouTube channel ID from a handle or URL
- How to download YouTube subtitles as SRT or VTT
- youtube-transcript-api RequestBlocked or IpBlocked: why it happens and how to fix it
- How to get YouTube comments in Python
- How to search YouTube from Python
- How to list a YouTube channel's videos in Python
- How to summarize a YouTube video with an LLM in Python
- How to get YouTube transcripts and video stats in Google Sheets
- How to get YouTube video views and likes in Python
- How to get YouTube transcripts in n8n, Make and Zapier
- LangChain YoutubeLoader fails on a server: why, and a loader that works
- How to get a YouTube channel's subscriber count in Python
- How to give Claude or Cursor access to YouTube (MCP server)
- How to get YouTube comments in Node.js
- How to analyze YouTube comments with an LLM in Python
- How to list a YouTube channel's Shorts in Python
- How to search YouTube from JavaScript
- How to get an Instagram follower count in Python
- Instagram Basic Display API alternatives: what to use after the shutdown
- Instaloader 401 Unauthorized, 429 and "Login required": what to do
- How to calculate an Instagram engagement rate in Python
- How to get an Instagram follower count in Node.js
- How to get Instagram follower counts in Google Sheets
- How to get Instagram Reel views in Python
Websites
- Clearbit Logo API alternatives: get a company logo from its domain
- How to extract email addresses from a website in Python
- How to turn a web page into Markdown in Python
- How to detect what a website is built with, in Python
- How to get the contact emails and phone numbers of websites in Google Sheets
- How to build a LangChain tool that reads web pages and searches Google
- How to turn a web page into Markdown in JavaScript for RAG
- How to extract social media links from a website in Python
- How to get a website's favicon in Python
- How to check robots.txt in Python before you fetch a page
TikTok
- How to get a TikTok video's views and likes in Python
- How to get the comments of a TikTok video in Python
- How to get a TikTok follower count in Python
- TikTok Research API: who can get access, and what to do if you cannot
- How to get TikTok video views, likes and shares in Node.js
- How to get TikTok views, likes and follower counts in Google Sheets
- How to get Google search results in Python
- pytrends 429 TooManyRequestsError: what it means and what to do
- How to get Google Trends data in Python
- Why is Wyoming first in Google Trends?
- How to get Google search results in Node.js
- How to get Google search results into Google Sheets
- How to give an LLM live Google results with tool calling
Threads
- How to get LinkedIn company data in Python
- How to search LinkedIn jobs from Python
- How to get a LinkedIn company page's latest posts in Python