We’re live on Product HuntSupport us

Downloading Meta Ad Library Ads With Python: The Truth

DownloadsAugust 18, 20267 min readBy Klipio team
Downloading Meta Ad Library Ads With Python: The Truth

A Meta Ad Library Python download sounds like the obvious engineer's move: hit the official API, loop through the results, save the ads. The truth is the official API will not give you commercial competitor ads at all, and it never returns creative files — so most Python routes end in either scraping or disappointment.

This post walks through what each programmatic option actually returns, so you can decide in ten minutes instead of losing a weekend to it.

If you just want the ad files and don't care how, the short answer is a browser extension: our free Meta Ad Library Downloader adds a download button to every ad in the library and a bulk mode that ZIPs an entire search. But if you're technical and want to know why the API path fails, read on.

What does the official Ad Library API return in Python?

Less than almost everyone expects. The official Ad Library API only covers ads about social issues, elections, and politics — plus, since the DSA, all ads shown in the EU. A normal ecommerce brand's US ads are simply not in it.

That is not a permissions problem you can fix. It's the designed scope of the API. We covered the access setup and endpoints in detail in the Meta Ad Library API explained, but the scope limitation is the part that kills most projects on day one.

And even for the ads it does cover, look at what the fields are:

You wantThe API gives you
The video fileNothing — no creative file field
The imageA preview link that renders the ad in a browser, not a file URL
Ad copyYes — ad_creative_bodies and friends
PerformanceSpend and impressions as broad ranges, political ads only
Run datesYes — delivery start and stop times
All competitor adsOnly if they're political/issue ads or EU-served

So a Python script against the official API is a metadata pipeline for political and EU ads. Useful for researchers and journalists. Nearly useless if what you want is a folder of a competitor's video ads.

Does the AdDownloader Python package solve this?

Partly, and it's worth describing honestly. AdDownloader is an open-source Python project on GitHub, built by academic researchers, that wraps the Ad Library API and then goes one step further: it takes the ad snapshot URLs from the API response and pulls the media files from the rendered ad previews.

That two-step design is clever. The API supplies the ad list and metadata; the media step fetches what the API itself won't hand over. Per its documentation, it offers both a command-line interface and a Python API, and it can download images and videos for the ads it retrieves.

The catches, as of August 2026:

  • It inherits the API's scope, so the ad list is still political/issue ads plus EU-served ads. It cannot enumerate a US ecommerce brand's ads the API doesn't return.
  • The media-fetching step depends on how Meta renders ad snapshot pages. When Meta changes that markup, the download step breaks until the project updates. That's the nature of the approach, not a criticism of the maintainers.
  • You still need an approved Meta developer app and an access token, plus identity confirmation for political-ad access in some regions.

If your project is genuinely about political or EU ad transparency — an academic study, a journalism dataset — AdDownloader is a sensible starting point. For competitor creative research on commercial brands, it hits the same wall as raw API calls.

Why does scraping the Ad Library keep breaking?

Because you're parsing a page that was never meant to be parsed. The Ad Library front end is a React application with generated class names, infinite scroll, and markup that shifts between releases. Every headless-browser scraper is a bet that today's selectors survive next week's deploy. Frequently, they don't.

The practical failure modes we see people hit:

  1. Selector rot. Meta ships a UI change, your extraction returns empty lists, and you spend an evening re-inspecting the DOM.
  2. Rate limiting and checkpoints. Scroll too fast from a datacenter IP and you get challenge pages instead of ads. Running it logged in risks flags on the account.
  3. Video URLs are the hard part. The playable file URL lives in network responses, not the visible markup. You end up intercepting XHR traffic — the same data you could grab manually once via the devtools method, industrialized.
  4. Silent partial results. Infinite scroll plus lazy loading means your script can exit cleanly having captured 60 of 240 ads, and you won't know unless you count by hand.

None of this is impossible. People do maintain working scrapers. But it's an ongoing maintenance job, not a script you write once, and Meta's terms prohibit automated collection without permission — see our honest read in is it legal to download Facebook ads (not legal advice).

decision
Q: Should you build the Python route?
Studying political or EU ads at scale -> Official API or AdDownloader
Need commercial competitor creatives -> Browser extension
Enjoy maintaining scrapers weekly -> Headless browser, accept breakage
The honest decision tree for programmatic Ad Library access.

When is a browser extension simply the saner route?

When the goal is the creative itself. A browser extension runs inside the page you're already viewing, with your session and your connection, so it downloads exactly what you can see — including every commercial ad the API will never list. No token, no app review, no selector maintenance.

That's what our free extension does. One click on any ad saves the video in original HD, the image, or the full carousel with every card. The "Find all ads" bulk mode scrolls a whole search and packs everything into one ZIP with a searchable index.html and a CSV — which, if you're a Python person, is the structured output you wanted anyway. Feed the CSV to pandas and you've got your dataset without writing a scraper. It's free, no account, no limits. The full workflow is in how to bulk-download a whole Ad Library search, and there's a broader comparison of extension options in Facebook Ad Library Chrome extensions.

FAQ

Can you use the Facebook Ad Library API to download competitor ads?

Not for normal commercial ads. The official API returns only political and social-issue ads, plus ads served in the EU under the DSA, and even for those it returns metadata rather than creative files. A regular competitor's US ads won't appear in any API response.

Is there a Python library for the Meta Ad Library?

Yes — AdDownloader is the best-known open-source option, built by academic researchers. It wraps the official API and can fetch media from ad preview pages, but it inherits the API's political/EU scope and its media step can break when Meta changes its page markup.

Meta's terms prohibit automated collection without written permission, so scraping carries account and access risk even though the data is public. Viewing and saving individual public ads for research is standard industry practice. This isn't legal advice — if it matters commercially, ask a lawyer.

How do I get the actual video files from the Ad Library?

The API won't give them to you for commercial ads. Either extract a single video manually through the browser's Network tab, or use a free extension like Klipio's Meta Ad Library Downloader, which saves videos in original HD, full carousels, and whole searches as one ZIP with a CSV.

Save the ads you research — free

The Klipio extension adds a download button to every ad in the Meta Ad Library: one click per ad, or bulk-save a whole search as a ZIP with a searchable swipe file inside. Free, no sign-up.

Get the free extension