Skip to main content

Facebook GraphQL Scraper - No login required, simple API to scrape public Facebook posts

Project description

fb_scraper_request

Scrape public Facebook posts without login using a simple, requests-based scraper.

This project is a streamlined fork developed from the foundational work at FaustRen/facebook-graphql-scraper.

Improvements

  • Lightweight: Uses only requests to fetch user posts—no browser, Selenium, or Playwright required.
  • Focused: Removed login-dependent features to focus exclusively on public page scraping.
  • Efficient: Optimized for speed and minimal dependency overhead.

Install

pip install fb_scraper_request

Quick Example

from fb_scraper_request import FacebookGraphqlScraper

# Initialize the scraper
fb = FacebookGraphqlScraper()

# Get posts from a specific username with a day limit
result = fb.get_user_posts("honghotduongpho.official00", days_limit=3)

for post in result["data"]:
    print(f"Content: {post['context']}")
    print(f"Likes: {post['reaction_count.count']}")
    print("-" * 20)

Results

The result object returns a structured dictionary containing profile info and a list of post data:

{
"fb_username_or_userid": "100063640556423",
    "profile": [
        "Life at VNG | Ho Chi Minh City"
    ],
    "data": [
        {
            "post_id": "1601334011997935",
            "post_url": "https://www.facebook.com/1601334011997935",
            "username_or_userid": "100063640556423",
            "owing_profile": {
                "__typename": "User",
                "name": "Life at VNG",
                "short_name": "Life at VNG",
                "id": "100063640556423"
            },
            "published_date": "2026-03-28T11:58:04",
            "published_date2": "2026-03-28",
            "time": 1774673884,
            "reaction_count.count": 16,
            "comment_rendering_instance.comments.total_count": null,
            "share_count.count": null,
            "sub_reactions": {
                "Thích": 10,
                "Yêu thích": 5,
                "Wow": 1
            },
            "context": "[HÀ NỘI] BUSINESS DEVELOPMENT FRESHER 2026 “BẬT ĐỊNH VỊ” HẸN GẶP SINH VIÊN THỦ ĐÔ 📍\n✨ Ứng tuyển Business Development Fresher 2026 tại: https://bit.ly/4rRnqaG \n\nBusiness Development Fresher 2026 (BDF 2026) - chương trình tuyển chọn và phát triển thế hệ Business Development tiềm năng của VNG ZingPlay Game Studios đã sẵn sàng gặp gỡ và giao lưu cùng các bạn sinh viên Hà Nội.\n\n👉 Nếu bạn đam mê khám phá thị trường Game,...",
            "video_view_count": null
        },
        ...
    ],
    "raw_data": [
        <raw_facebook_meta_response>
    ]
}

Extracting Additional Data

Note: If you need more data fields than what's provided in data, you can manually extract additional information from raw_data. This contains the complete raw Facebook GraphQL API responses.

result = fb.get_user_posts("page_username", days_limit=3)

# Access raw API responses for custom data extraction
for raw_response in result["raw_data"]:
    # Extract any custom fields you need
    custom_field = raw_response.get("your_custom_field")

Credits

Thank you to the original project owner FaustRen and the facebook-graphql-scraper repository for the foundational work that made this simplified version possible.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fb_scraper_request-0.2.3.tar.gz (8.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fb_scraper_request-0.2.3-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

Details for the file fb_scraper_request-0.2.3.tar.gz.

File metadata

  • Download URL: fb_scraper_request-0.2.3.tar.gz
  • Upload date:
  • Size: 8.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.8

File hashes

Hashes for fb_scraper_request-0.2.3.tar.gz
Algorithm Hash digest
SHA256 414a2b43ece4712e9579d0c176e2f118a9bfa56b72c07da63c5ed4b87d9ff322
MD5 23f6a90e218f926af2e08a212b1c1f15
BLAKE2b-256 d96854b74c7d52d1520e9d48fdeb2550afd07e266933616c2b55cfb30075caa3

See more details on using hashes here.

File details

Details for the file fb_scraper_request-0.2.3-py3-none-any.whl.

File metadata

File hashes

Hashes for fb_scraper_request-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 f14b692cf39103f9c55d757e55f8ae7a66eacbe994e068be4496b6e7a5ef5dd4
MD5 a4595bb302f5d4b05c6d473a7103c793
BLAKE2b-256 52e016885b33ff1630c72618c49ce1439a916dbfe0d804314eab99d2b3a5e17b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page