r/WebScrapingInsider • • 15d ago

Facebook Scraper : Free & Open-Source

https://github.com/XD-MHLOO/facebook-gql-scraper

Scrape Facebook data without an API key.

It's lightweight as it doesn't use a headless browser and doesn't rely on fragile HTML parsing.

It currently supports:

  • 👤 Profiles: Profile Details, followers, following, friends, photos, reels
  • 📝 Posts: Post details, reactions
  • 📝 MediaPosts: MediaPost details, reactions
  • 💬 Comments: Comments details, nested replies & comment reactions
  • 👥 Groups: Group details, posts & members
  • 🛍️ Marketplace: Listings details
  • 🔍 Search: Search for profiles, posts, groups, Marketplace listings and Advertisements.
  • 📢 Advertisements: Ad details, advertiser information, creatives, and collations.

(Edit: The library now supports Facebook Advertisements, including fetching ad details and searching the Ad Library)

If anyone is interested, feel free to try it out and Contributions are welcome.

12 Upvotes

6 comments sorted by

2

u/Champak-Mottot 14d ago

curious how youre handling the login checkpoints and 2fa prompts. burner accounts get flagged so quickly now if the browser fingerprint isnt completely dialed in.

1

u/Useful-Subject-9462 14d ago

I never get hit with login checkpoints or 2FA prompts, but I can't be certain whether that would happen or not. From my experience, if you have enabled 2fa on your account, you are less likely getting ban.
Until now I could say that the only thing would happen is they would invalidate your session (a force logout), so you have to login again to get a valid session but this normally wouldn't trigger if you didn't scrap too aggressively, like straight multiple hours.

2

u/Michael_Dementii 14d ago

Looks interesting, I’ll test it out.

1

u/[deleted] 14d ago

[removed] — view removed comment

1

u/Useful-Subject-9462 14d ago

desktop ones. I do have thoughts on having both desktop and mobile, so when one fails another will work as fallback. But that requires another whole lot of work to do, unless you are interested to help lol

1

u/Useful-Subject-9462 14d ago

And true, it used to be painful to maintain but not much for now. Because i notice they often update the graphql internal relay args ( basically just new internal args added for graphql, without adding them correctly the server will reject), and somehow i was able to extract them on demand, instead of hardcoding it and updating it everytime.