Facebook Ads API: What You Can Actually Pull

Searching for Facebook ads API documentation lands you on two entirely different products with similar names. The Marketing API reads and writes campaigns inside ad accounts you already have access to; the Ad Library API returns public ads, but only political and social-issue ones.
The gap between them is where most projects die, so here is what each actually returns before you spend a week finding out.
Is there a Facebook Ads API?
There are two, and picking the wrong one is the usual mistake.
| Marketing API | Ad Library API | |
|---|---|---|
| Covers | Ad accounts you have access to | Public ads, political only |
| Returns creative | Yes, for your own ads | Limited, political ads |
| Returns spend | Yes, for your own ads | Ranges, political ads |
| Competitor commercial ads | No | No |
| Approval needed | Yes, app review | Access token, ID verification |
Neither one returns a competitor's product ads. That sentence saves more engineering time than anything else on this page. The public Ad Library website shows commercial ads; its API does not.
What does the Marketing API actually do?
Everything Ads Manager does, programmatically, for accounts you have permission on.
The realistic use cases:
- Reporting. Pull insights — spend, impressions, ROAS, breakdowns by placement or age — into a warehouse or a client dashboard on a schedule.
- Bulk campaign operations. Create, duplicate, pause, or rename hundreds of ad sets without touching the interface.
- Creative uploads. Push video and image assets and build ads against them.
- Custom audiences. Sync customer lists in and out.
It sits on the Graph API, is versioned, and Meta deprecates versions on a roughly annual cycle. Anything you build needs a maintenance budget for that alone.
What does the Ad Library API return?
Public ads about social issues, elections, or politics — plus, in the EU, a wider set of ads under the Digital Services Act.
For those ads you get advertiser name, ad copy, start and stop dates, spend ranges, impression ranges, and some demographic delivery data. It is genuinely rich, and completely irrelevant if you sell skincare.
The verification step catches people out too: to query it you confirm your identity and location with Meta, and access is granted per-country. The full walkthrough is in the Meta Ad Library API.
Why is there no competitor ads API?
Because the Ad Library was built as a political transparency obligation, and commercial ad disclosure was added to the website rather than to the data pipeline.
Meta shows commercial ads publicly — you can browse any brand's live creative at facebook.com/ads/library without an account. It just does not serve that same data through an endpoint. The website is the interface, and the interface is the whole product.
The EU is the partial exception. Under the DSA, EU-delivered ads carry more disclosure, including inactive ads and some reach and targeting detail, and that surfaces in both the site and the API. Setting your country filter to an EU market is a real research technique for that reason, covered in the Ad Library in the EU vs the US.
What breaks once it is in production?
Three things, reliably, and none of them appear in the documentation's happy path.
Version deprecation. Graph API versions have a shelf life of roughly a year. Fields get renamed, removed, or split, and a call that worked in one version returns an error in the next. Anything you build needs a scheduled review, not a one-off deploy.
Rate limits. The Marketing API throttles per app and per ad account, and insights calls with many breakdowns are expensive. Pulling a year of daily data by placement across thirty client accounts hits limits fast. The fix is asynchronous insights jobs and a queue, which is more engineering than most teams budget for.
Attribution drift. Numbers pulled today for last week will not always match numbers pulled next month for the same week. Meta restates conversion data as attribution windows settle, and a dashboard that caches the first answer quietly disagrees with Ads Manager. The underlying behaviour is explained in Facebook ads attribution.
What do people build instead?
Scrapers, mostly, and they work until they do not.
The library is a normal web app, so the usual approaches apply: a headless browser walking search results, or reading the JSON the page itself fetches. Downloading from the Meta Ad Library with Python walks through what that involves.
Three things to know before you start:
- The markup changes. Class names are generated, and a selector-based scraper breaks on Meta's schedule, not yours.
- Infinite scroll is the hard part. Results load in batches, and getting a complete set means driving the scroll reliably.
- Video URLs expire. Grabbing a link and fetching it later frequently returns nothing.
For that scale, our free Meta Ad Library Downloader covers it from inside the library: a download button on every ad, a bulk mode that packs a whole search into one ZIP, and every export carrying a CSV of each ad's advertiser, copy, and dates. Original HD video, full carousels, no account, and it runs on your own connection.
If you specifically need structured rows rather than files, exporting Facebook ads to CSV covers the options, and Ad Library API alternatives compares the third-party providers that resell scraped data.
Which should you use?
Use the Marketing API when the data is yours and the volume justifies the setup — client reporting across many accounts, or automation that would otherwise be hours of clicking. Skip it for a single account you check twice a week; the export button in Ads Manager is faster than an OAuth flow.
Use the Ad Library API only if you work on political or EU transparency data. For anything commercial it will return an empty set and you will assume you have a bug.
And for competitor research, accept early that the answer is the Ad Library website, not an endpoint. The workflow around that is in the Meta Ad Library guide.
FAQ
Is there a Facebook Ads API?
Two of them. The Marketing API manages and reports on ad accounts you have access to, and the Ad Library API returns public political and social-issue ads plus wider EU coverage under the DSA.
Can I get competitor ads through the Facebook API?
No. Commercial competitor ads are visible on the public Ad Library website but are not served through any API. Only political, social-issue, and EU-disclosed ads are available programmatically.
What is the difference between the Marketing API and the Ad Library API?
The Marketing API is authenticated access to your own ad accounts, with full spend and performance data. The Ad Library API is public transparency data limited to political and social-issue advertising.
Do I need approval to use the Meta Marketing API?
Yes for production. You need a Meta app, business verification, the relevant ads permission, and an app review. Development access works only against accounts your app's admins already own.
How do I export Facebook ad data without an API?
For your own ads, Ads Manager has a built-in export. For competitor ads, use the Ad Library interface and a downloader extension that exports the creative plus a CSV of the ad text and dates.
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

