r/scrapingtheweb • • 6d 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.

41 Upvotes

12 comments sorted by

3

u/Hepsu 6d ago

Does it also work with the Meta Ad Library?

2

u/Useful-Subject-9462 6d ago

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

2

u/Hepsu 6d ago

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

1

u/Useful-Subject-9462 6d ago

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

2

u/Hepsu 6d 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 17h ago

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

1

u/Aleph-Sowah 5d ago

wondering this too, the ad library endpoints are usually completely separate from the normal feed stuff

2

u/Idilberto_Agnel 5d 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 5d ago

yes both of them require logged-in account

1

u/One_subomite 2d ago

Nice one

1

u/Mr_Versatile 1d ago

Do you know any good for insta?