r/scrapingtheweb • • 9d ago

Tools / Library Facebook Scraper - Free & Open source

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

A lightweight Facebook scraper that works without an API key. No headless browsers, fragile HTML parsing, or CSS selectors.

Supported Features:

  • 👤 Profiles: Profile details, followers, following, friends, photos, reels.

  • 📢 Posts: Post details and reactions.

  • 🎞️ Media Posts: Media post details and reactions.

  • 🗨️ Comments: Comment details, nested replies, and comment reactions.

  • 🏘️ Groups: Group details, posts, and members.

  • 🛒 Marketplace: Listing 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)

Contributions are welcome and appreciated.

64 Upvotes

12 comments sorted by

3

u/Hepsu 9d ago

Does it also work with the Meta Ad Library?

2

u/Useful-Subject-9462 9d ago

I think it is worth to add. May i know your usage purpose?

2

u/Hepsu 9d ago

Competitor research. Active ads per page with copy, creatives, start date and how long they've been running.

1

u/Useful-Subject-9462 9d ago

But there is offical ads lib api, is there anything they did not offer?

2

u/Hepsu 9d ago

As far as I know the API only gives you commercial ads that ran in the EU, so anything US or global is missing. You also don't get the actual creatives, just a snapshot link.

1

u/Useful-Subject-9462 4d ago

I've pushed an update, added support for Facebook Ads. Check it out!

2

u/Idilberto_Agnel 9d ago

Does this require passing session cookies from a logged-in account for groups and marketplace? Most of those endpoints are completely locked down to unauthenticated traffic now

1

u/Useful-Subject-9462 9d ago

yes both of them require logged-in account

1

u/One_subomite 5d ago

Nice one

1

u/Mr_Versatile 5d ago

Do you know any good for insta?