kyamasam/facebook-ad-library-scraper — explained in plain English
Analysis updated 2026-05-18
Pull ads for a keyword and country into a CSV for competitor or market research.
Save HTML snapshots while scraping so ads can be reparsed later without a browser.
Build a custom research pipeline using the Python API's build_url, scrape, and parse functions.
| kyamasam/facebook-ad-library-scraper | a-bissell/unleash-lite | abhiinnovates/whatsapp-hr-assistant | |
|---|---|---|---|
| Stars | 1 | 1 | 1 |
| Language | Python | Python | Python |
| Setup difficulty | moderate | hard | hard |
| Complexity | 3/5 | 4/5 | 3/5 |
| Audience | developer | researcher | developer |
Figures from each repo's GitHub metadata at analysis time.
Requires Google Chrome installed locally, parsing may break if Facebook changes its page markup.
facebook-ad-library-scraper is a Python tool that automates pulling ad data out of Facebook's public Ad Library search results. Instead of manually browsing and copying information, you give it a search term and a country, and it builds the right Facebook Ad Library URL, opens it in a real Chrome browser using undetected-chromedriver, and scrolls down to load more results the way a person would. As it scrolls, the tool can save snapshots of the raw HTML pages to disk, which is useful if you want to reparse the data later without opening a browser again. It then reads through the ad cards on the page and pulls out details for each one: the advertiser page name and URL, the ad body text, any images, the call to action button and headline, the destination link the ad points to, and whether the ad shows a WhatsApp contact option. Duplicate ads are automatically removed before the results are saved. Results can be exported as a JSON file, a CSV file, or both, along with the saved HTML snapshots in their own folder. The project is available both as a command line tool, where you pass search filters like query, country, active status, media type, and date range as flags, and as a Python library, where functions like build_url, scrape, parse_ads, and parse_from_dir let you build the same workflow into your own scripts. Setup requires Python and Google Chrome installed locally, and the package will usually detect the right Chrome driver version automatically. Because the scraper depends on reading Facebook page structure directly, the README notes that its parsing logic may need updates if Facebook changes how its Ad Library pages are built.
A Python tool that scrapes Facebook's public Ad Library search results into JSON and CSV files.
Mainly Python. The stack also includes Python, Selenium, undetected-chromedriver.
Setup difficulty is rated moderate, with roughly 30min to a first successful run.
Mainly developer.
This repo across BitVibe Labs
Verify against the repo before relying on details.