Skip to main content

Facebook Scraper API

tests license python

Python client for the GetSocialAPI Facebook Scraper API.

  • Groups: resolve links, overview, paginated members
  • Profiles: resolve links, About/contacts in raw GraphQL
  • Connections: followers, followings, friends
  • Raw responses — no transformations
  • Automatic retries on 429/502/503, typed exceptions

Installation

pip install git+https://github.com/GetSocialAPI/Facebook-Scraper-API.git

Quickstart

from getsocialapi_facebook import Client

# Get your API key at https://getsocialapi.com/dashboard/
client = Client(api_key="gsa_live_...")  # or set GETSOCIALAPI_FB_API_KEY

# Resolve any group link (slug, m.facebook, share/g) to a group_id
group = client.fb.resolve("https://www.facebook.com/groups/freegarden/")
group_id = group["group_id"]

# Profile links resolve the same way
user = client.fb.resolve_profile("https://www.facebook.com/nasa")
user_id = user["user_id"]

# Group card
client.fb.overview(group_id)

# Members: raw GraphQL pages (1st -> data.group, 2nd+ -> data.fetch__Group)
page = client.fb.members(group_id)  # fixed page of 15 members
page["data"]["group"]["group_member_profiles"]["page_info"]["end_cursor"]

# Next page: pass page_info.end_cursor as `after`
client.fb.members(group_id, after="AQHTm5Xq…")  # end_cursor from page_info

Base URL: https://api.getsocialapi.com/fb — authenticate with the API key from your dashboard.

Client

Client(api_key=None, base_url="https://api.getsocialapi.com/fb", timeout=30, max_retries=3)
  • api_key — your API key (env var GETSOCIALAPI_FB_API_KEY works too)

Methods

Method Route Description
resolve(url) GET /resolve group link → group_id (numeric id, slug, m.facebook, /share/g/…)
resolve_profile(url) GET /resolve/profile profile link → user_id
overview(group_id) GET /overview group card: name, visibility
members(group_id, after=None) GET /api/v1/members raw GraphQL page of 15 (1st — data.group, 2nd+ — data.fetch__Group)
group_posts(group_id, after=None) GET /api/v1/group_posts group feed: page of 2–3 Story posts, cursor from group_feed.page_info.end_cursor
contacts(user_id) GET /api/v1/contacts profile About: raw GraphQL
posts(user_id, after=None) GET /api/v1/posts user timeline: page of ~100 posts (the fixed service maximum), cursor from timeline_feed_units.page_info.end_cursor
feed(user_id=None, group_id=None, per_page=None, after=None) GET /api/v1/feed unified user/group feed, small pages: per_page 3–20 (default 10)
followers(user_id, after=None) GET /api/v1/followers raw GraphQL full_profile_list
followings(user_id, after=None) GET /api/v1/followings same shape
friends(user_id, after=None) GET /api/v1/friends same shape

Full request/response reference with live examples: getsocialapi.com/docs — API Reference / Facebook.

Pagination

Every method returns one raw page. Pass the connection's page_info.end_cursor as after while has_next_page is true.

List Page size (fixed) Cursor source
posts ~100 posts — the service maximum, there is no count parameter data.profile.timeline_feed_units.page_info.end_cursor
feed per_page 3–20 (default 10); a page may come back short — follow has_next_page same connection as the target: timeline_feed_units / group_feed page_info.end_cursor
group_posts 2–3 Story posts (skip GroupsSectionHeaderUnit edges, dedupe by cache_id) data.group_address.group_feed.page_info.end_cursor
members 15 data.(group / fetch__Group).group_member_profiles.page_info.end_cursor
followers / followings / friends 15 …list_items.page_info.end_cursor

Cursors are reusable and not bound to a session; a broken or foreign cursor returns 400 Invalid Cursor — take end_cursor only from the connection's page_info, never from node fields.

posts, after = [], None
while True:
    page = client.fb.posts(user_id, after=after)
    tfu = page["data"]["profile"]["timeline_feed_units"]
    posts += [e["node"] for e in tfu["edges"]]
    pi = tfu.get("page_info") or {}
    if not pi.get("has_next_page") or not pi.get("end_cursor"):
        break
    after = pi["end_cursor"]

Response notes

  • members page 1 lives in data.group, following pages in data.fetch__Group
  • connection lists: can_see_follower_list: false means the list is hidden by privacy settings (only the count is available)

Errors

Exception HTTP Notes
GetSocialFacebookError — base class; also network errors
BadRequestError 400 bad parameters
APIKeyError 401 invalid key
RateLimitError 429 .limit from the response
UpstreamError 502 temporary upstream error — retried automatically
ServiceUnavailableError 503 service overloaded — retried automatically

Only successful responses count against your quota. Plans and rate limits: getsocialapi.com/#pricing.

Support

License

MIT

Metadata

Release files for getsocialapi-facebook 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 getsocialapi-facebook 0.1.0
File Size Uploaded Provenance Actions
getsocialapi_facebook-0.1.0.tar.gz 9.9 kB With provenance Details for getsocialapi_facebook-0.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 19.6 kB

Release files / getsocialapi_facebook-0.1.0.tar.gz

Download URL getsocialapi_facebook-0.1.0.tar.gz
Size 9.9 kB
Tags Source
SHA-256 checksum
How to use checksums
d1d4340a9f2c3bdc6d0b612cfbc6d03b37de95a4870173f1275891b7bc121397
BLAKE2b-256 checksum
How to use checksums
d7ef322702ff1226bf8da2aebedaf27c8e8fd6224b3758a35022d3319f260e1e
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 10, 2026.

Transparency log

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

Download URL getsocialapi_facebook-0.1.0-py3-none-any.whl
Size 9.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9e0d8b1c2aa387d37812e346aa2ff79fbb240d2ccf3105137d78bbd772282a71
BLAKE2b-256 checksum
How to use checksums
e1f48896d557d41585d72df2413559ce9569588f24868d3d8603c243a9a9ca62
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 10, 2026.

Transparency log

Security for getsocialapi-facebook 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 getsocialapi_facebook-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 10, 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