Ad library guide
Meta Ad Library API: access, fields and what it can’t return
Meta’s Ad Library API (the Graph API ads_archive endpoint) lets you query the library from code. It is free, but it is narrower than the website: outside the EU it only returns ads about social issues, elections or politics.
By the Adlane team · Updated
What the API covers
The API returns two groups of ads: ads about social issues, elections or politics, in every country where Meta enforces those rules, and all ads delivered in the European Union, which Meta added to meet the Digital Services Act. Ordinary commercial ads that ran only in, say, the US or Australia are visible on the Ad Library website but are not returned by the API.
That gap is the most common surprise. If your research is about commercial competitors outside the EU, the website (or a tool that reads it) is the source, not the API.
Getting access
You need a Facebook account that has completed Meta’s identity confirmation, a Meta developer app, and an access token. Meta’s Ad Library API page walks through confirming identity and creating the app; after that, calls go to the ads_archive edge of the Graph API with your token.
GET https://graph.facebook.com/v21.0/ads_archive
?search_terms=solar
&ad_reached_countries=["DE"]
&ad_type=ALL
&ad_active_status=ACTIVE
&fields=page_name,ad_creative_bodies,ad_delivery_start_time,ad_snapshot_url
&access_token=YOUR_TOKENParameters and fields that matter
ad_reached_countries is required. ad_type=ALL returns all ad types, which in practice means EU-delivered ads plus political ones; POLITICAL_AND_ISSUE_ADS restricts to political ads. search_terms matches ad text, search_page_ids limits to specific Pages.
| Field | What it gives you |
|---|---|
| page_name, page_id | The advertiser |
| ad_creative_bodies, ad_creative_link_titles | Primary text and headlines (arrays, one per version) |
| ad_delivery_start_time, ad_delivery_stop_time | When the ad ran |
| ad_snapshot_url | A link that renders the ad (creative images are not returned directly) |
| publisher_platforms | Facebook, Instagram, Messenger, Audience Network, Threads |
| spend, impressions, demographic_distribution | Ranges, political and issue ads only |
| eu_total_reach, target_ages, target_gender, target_locations | EU-delivered ads |
Limits
Calls are rate limited per app and token, results are paginated, and the creative itself comes back as a snapshot link rather than image or video files. Building a reliable pipeline means handling pagination cursors, expired tokens and retries.
An alternative that covers commercial ads and four libraries
Adlane’s Pro plan includes an API and an MCP server. One call searches the Meta, TikTok, LinkedIn and Google libraries, including commercial Meta ads outside the EU, and returns normalised ads with copy, media URLs, dates, placements and landing pages. It counts against your plan’s monthly searches, so the cost is fixed.
Questions, answered
Is the Meta Ad Library API free?
Yes. It needs identity confirmation and a developer app, but there is no charge.
Why does the API return nothing for a brand I can see on the website?
Outside the EU the API only returns ads about social issues, elections or politics. Commercial ads delivered only outside the EU are on the website but not in the API.
Does the API return images and videos?
No. It returns ad_snapshot_url, a page that renders the ad.
Sources
Keep reading
- Meta Ad Library search: filters, exact phrases and what the dates meanHow to use the Meta (Facebook) Ad Library search well: keyword versus advertiser search, exact phrases, filters, ad versions, “started running” dates and the limits that trip people up.
- How to see competitor ads on Meta, Google, LinkedIn and TikTokEvery major ad platform publishes a free library of the ads running on it. Here is how to find a competitor’s ads on each one, what to look for, and how to keep watching them.