Skip to main content

facebook-scraper-api

Public Facebook data from Python: Page details, Page and group posts, reels, videos, comments and search. Functions in the style of the old facebook-scraper (get_posts(account, pages=...)), but the data comes from a hosted API, so nothing breaks when Facebook changes its pages: no login, no cookies, no browser, no proxies.

Powered by SocialAPIs. Get a free API key: 200 calls/month, no card.

pip install facebook-scraper-api
export SOCIALAPIS_TOKEN=your_key
from facebook_scraper_api import get_page_info, get_posts, get_comments

page = get_page_info("nasa")
print(page["title"], page["followers_count"])

for post in get_posts("nasa", pages=2, limit=9):   # 2 calls, 9 posts each
    print(post)

for comment in get_comments("https://www.facebook.com/nasa/posts/...", pages=1):
    print(comment)

Or call set_api_token("...") first instead of the environment variable.

Function What it returns
get_page_info(account) A Page's details: name, followers, likes, category, contact, links
get_posts(account, pages=1, limit=None, after=None, before=None) A Page's posts, newest first
get_group_posts(group, pages=1, ...) / get_posts(group=...) A public group's posts
get_group_info(group) A public group's details
get_reels(account, pages=1) / get_videos(account, pages=1) A Page's reels / videos
get_post(post_url, extended=False) One post's details
get_comments(post_url, pages=1) Comments on a post or reel
search_posts(query, pages=1) / search_pages(query, pages=1) Keyword search

Listings are generators: they follow the API's end_cursor and stop after pages calls or when there are no more results. account is a Page URL or username; group is a group URL or id. For several keys or a custom connection, use FacebookScraperAPI(api_token=...), which has the same methods.

Command line

facebook-scraper-api page nasa
facebook-scraper-api posts nasa --pages 3 --limit 9 --out nasa.csv
facebook-scraper-api group-posts https://www.facebook.com/groups/123 --format jsonl
facebook-scraper-api comments https://www.facebook.com/nasa/posts/123 --pages 2

CSV columns are the fields of the records (nested fields as reactions.total).

Costs

Most calls cost 1 credit. Page and group posts cost round(limit ÷ 3) credits per call (limit 3-9, default 3). Failed calls (4xx / 5xx) are not charged. Pricing.

Public data only. You are responsible for how you use it, including personal data rules (GDPR) where they apply. MIT license.

Metadata

Release files for facebook-scraper-api 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for facebook-scraper-api 0.1.0
File Size Uploaded Provenance Actions
facebook_scraper_api-0.1.0.tar.gz 11.3 kB With provenance Details for facebook_scraper_api-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for facebook-scraper-api 0.1.0
File Interpreter ABI Platform Actions
facebook_scraper_api-0.1.0-py3-none-any.whl Python 3 none any Details for facebook_scraper_api-0.1.0-py3-none-any.whl

Total release size: 22.3 kB

Release files / facebook_scraper_api-0.1.0.tar.gz

Download URL facebook_scraper_api-0.1.0.tar.gz
Size 11.3 kB
Tags Source
SHA-256 checksum
How to use checksums
79bf703a2cd871206df19d213383546c5ab9120d7a52c4d9b3a78efaaabd2f97
BLAKE2b-256 checksum
How to use checksums
9f52e4f352353b950142b06843c636e9ef360212ba0919c6f7c6b484714fcb0a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.

Transparency log

Release files / facebook_scraper_api-0.1.0-py3-none-any.whl

Download URL facebook_scraper_api-0.1.0-py3-none-any.whl
Size 11.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cf4dca3fd03c9082fcd2bd81c4db01a568253a2be23e0644a0edc121f12e857d
BLAKE2b-256 checksum
How to use checksums
38f17633b58f5bf0b41737afc16ed66e535da8d2436ccd5d96aa6a15726decd9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.

Transparency log

Security for facebook-scraper-api 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for facebook_scraper_api-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page