Facebook Ad Library Scraper: Options, Limits and a Simpler Way
How Facebook Ad Library scrapers work in 2026: the GitHub scripts, Apify actors and the official API, what breaks, the legal line, and when to skip scraping entirely.
By the AdEye team
July 2026 · 10 min read
Public ad-library data only. Nothing behind a login.
ads found · showing top creatives
A Facebook Ad Library scraper is any script or service that pulls ad data out of the Meta Ad Library in bulk instead of by hand. In 2026 you have three real options: open-source scrapers on GitHub, hosted actors on platforms like Apify, and Meta's own official Ad Library API. All three work, but each has a catch: the API returns almost no US commercial ads, GitHub scripts break whenever Meta changes its markup, and hosted scrapers cost per run and can violate Meta's terms. For most marketers, the honest answer is that you do not need to scrape at all.
This guide covers each method in plain terms, what actually breaks, where the legal line sits, and why a research feed usually beats a raw scrape for competitor work. Last updated July 2026.
The three ways to scrape the Facebook Ad Library
Every approach is a version of the same task: the ads are already public, so you are collecting data that anyone can already see. They differ in effort, cost and how long they keep working.
| Method | Best for | What you get | The catch |
|---|---|---|---|
| Official Meta Ad Library API | Political and issue ads, EU/UK commercial ads | Structured, permitted data straight from Meta | Almost no US commercial ads; access approval required |
| GitHub scraper scripts | Developers who want full control and no fees | Raw ad HTML you parse yourself | Breaks on every Meta layout change; against Meta terms |
| Hosted actors (Apify and similar) | Non-developers who want a quick bulk pull | A CSV or JSON export per run | Costs per run; still a terms-of-service gray area |
Method 1: the official Meta Ad Library API
Meta publishes a real Ad Library API, and it is the only method Meta actually sanctions. You register for access, agree to the terms, and query ads programmatically. For anyone studying political and issue advertising, or commercial ads inside the EU and UK, it is genuinely good and completely above board.
The problem for US marketers is coverage. The API returns political and social-issue ads broadly, but for regular commercial ads it is limited to the EU and UK transparency requirements. If you are trying to pull what a US ecommerce brand is running on Facebook and Instagram, the official API mostly will not show it to you. That single gap is why so many people go looking for a scraper in the first place. We covered the exact boundaries in the Meta Ad Library API guide, and they have not moved: sanctioned, structured, and largely empty for US commercial research.
Method 2: open-source scrapers on GitHub
Search GitHub and you will find a dozen Facebook Ad Library scrapers, usually Python with Selenium or Playwright driving a headless browser through the public library pages. They work by loading the same URLs you would in a browser, then parsing the returned HTML for advertiser names, ad text, media URLs and run dates.
Two things make these fragile. First, the Ad Library is a JavaScript-heavy page, so the scraper has to render it, scroll to trigger lazy loading, and handle rate limiting, which is slow and easy to get blocked on. Second, and this is the real killer, Meta changes its front-end markup often, and the moment a class name or DOM structure shifts, the parser returns garbage or nothing. A scraper that worked last quarter frequently needs a rewrite this quarter. If you have a developer who enjoys that maintenance, it is free; if you do not, it is a recurring fire drill.
Method 3: hosted scrapers and Apify actors
Platforms like Apify host pre-built Facebook Ad Library actors that do the browser automation for you. You paste in a search term or advertiser, run the actor, and get a CSV or JSON file back. For a non-developer who needs a one-time bulk pull, this is the path of least resistance, and you pay per run or per compute unit rather than maintaining code.
The trade-offs are cost and terms. Runs add up if you are pulling large advertiser sets regularly, and the same maintenance risk exists, it is just someone else's problem until the actor breaks and you wait for its author to fix it. You are also still automating access to Meta's service, which sits against Meta's terms of use the same way a self-hosted scraper does.
Is it legal to scrape the Facebook Ad Library?
Scraping public ad-library data occupies a gray area, not a clear yes. US courts have generally held that scraping publicly accessible data is not itself a computer-crime violation, and the ads in the library are public by design. But that is separate from Meta's own terms of service, which prohibit automated collection, and from what you do with the data afterward. Reading and studying public ads is fine. Automating bulk collection can breach Meta's terms even when it is not illegal, and re-publishing a competitor's actual creative as your own ad is copyright infringement regardless of how you obtained it. The safe posture is to treat scraped ads as research inputs, never as assets to reuse, and to prefer a method that does not fight Meta's terms.
What do you actually do with scraped ad data?
This is the question that reframes the whole project. Most people who set out to scrape the Ad Library do not want a database of raw HTML. They want to answer a marketing question: which competitors are scaling, what hooks and angles are working in a niche, and which creatives have been running long enough to be proven. A scrape gets you a pile of unstructured rows; the analysis is still ahead of you. If the goal is a live pipeline feeding your own dashboards, you also have to keep the data flowing and clean, and moving it reliably between your apps and databases is its own ongoing job on top of the scraping.
For competitor research specifically, that overhead rarely pays off. You spend engineering time keeping a scraper alive and a pipeline clean, and you still have to tag every ad by hook and angle and figure out which ones matter. The data was never the hard part; reading it is.
The simpler way: a research feed instead of a scraper
If your goal is competitor research rather than building a data product, a maintained ad-research tool removes the entire scraping problem. AdEye reads the same public ad-library data and pulls competitor live ads from the Meta Ad Library plus Google, TikTok and YouTube into one feed, AI-tagged by hook, angle and format, with run length and variation count on every ad. There is no script to maintain, nothing that breaks when Meta reshuffles its markup, and no terms-of-service tightrope, because the collection and upkeep are handled for you.
The practical difference is where your time goes. With a scraper, your time goes into keeping the scraper working. With a feed, your time goes into the actual research: comparing angles, spotting the ad a competitor has funded for four months, and saving the winners into a searchable swipe file you can filter by brand or angle later. For agencies watching many competitor sets at once, that gap is the difference between a working system and a maintenance project.
Can you get a list of all ads from one advertiser?
Not cleanly through scraping. The native library has no bulk export, and a scraper has to page through results while dodging rate limits, so a full, reliable dump of one advertiser's ads is harder than it sounds and often incomplete. An ad-research tool that indexes advertisers solves this directly: you search the competitor once and get their live public creatives in a feed you can filter and save from, which is the outcome most people were chasing when they went looking for a scraper.
The short version
For US commercial research, the official Meta Ad Library API mostly will not have the ads you want, GitHub scrapers break on Meta's frequent markup changes and cut against its terms, and hosted actors cost per run with the same terms risk. Scraping is legal-ish but never clean, and the data is only the start of the work. If you are building a data product, a maintained pipeline is the honest path, and a cross-platform ad library API gets you there without owning the collection layer. If you just want to know what competitors are running, an ad library search that reads the public libraries for you skips the whole problem and hands you tagged, searchable ads instead of raw HTML.
See what your competitors are running with AdEye
Type any brand and watch their live ads stream into one feed from Meta, Google, TikTok and YouTube, each AI-tagged with its hook, angle and a working signal. Public ad-library data only.
Popular ad spy use cases