Meta Ad Library API: Graph v27.0 Query Guide
Use Meta’s Ad Library API to query archived ads by country, interpret reach and spend fields, and build a reproducible export with curl or Python.

The Meta Ad Library API searches archived ads with the Graph API endpoint GET /v27.0/ads_archive. Meta’s coverage page lists worldwide social issue, electoral and political ads from the past seven years and ads of any type delivered in the EU or UK in the past year. Pick the country and ad category first because they determine which records and metrics can be returned. Meta API coverage · Graph API reference
AdMapix Research · Reviewed November 23, 2026
Which API fields can you use?
| Evidence needed | Request fields | Coverage |
|---|---|---|
| Ad identity and delivery window | id, page_id, page_name, ad_delivery_start_time, ad_delivery_stop_time | Archived records matching the query |
| Ad creative and placement | ad_creative_bodies, ad_snapshot_url, publisher_platforms | Fields populated on matching ad records |
| Spend and impressions ranges | spend, currency, impressions | Eligible political, electoral and social issue ads |
| Estimated ad reach | eu_total_reach, total_reach_by_location | Use the locations and estimates returned for that record. eu_total_reach is specific to the EU. |
| EU beneficiaries and payers | beneficiary_payers | Ads delivered in the EU with the field available |
Archive filters and output fields describe different things. For example, ad_reached_countries=["FR"] selects records that reached France, while eu_total_reach describes estimated reach across the EU for each returned ad. Use the advertiser’s own reporting for exact spend, conversions or ROAS. Meta fields and restrictions · How to interpret competitor spend
Authorize your app and run a first query
Follow Meta’s identity and location confirmation process, then create a developer account and app through the Ad Library API access page. Generate an access token for the authorized app. Use your runtime’s secret store to set META_AD_LIBRARY_TOKEN. Meta’s versioning page lists v27.0 as current and its release schedule lists September 24, 2026 as the expiration date for v20.0. Meta API access setup · Current Graph API version · Version lifecycle
The example looks for the French term casque in ads that reached France. It starts with one EU market to make the request easy to verify. Change the term to match the language of the ads you want. The reference and coverage pages describe different levels of detail about the UK, so test GB explicitly if that market is part of your research.
curl --fail-with-body --get 'https://graph.facebook.com/v27.0/ads_archive' \
--data-urlencode "access_token=${META_AD_LIBRARY_TOKEN:?set META_AD_LIBRARY_TOKEN}" \
--data-urlencode 'ad_reached_countries=["FR"]' \
--data-urlencode 'ad_type=ALL' \
--data-urlencode 'ad_active_status=ALL' \
--data-urlencode 'search_terms=casque' \
--data-urlencode 'fields=id,page_name,ad_delivery_start_time,ad_delivery_stop_time,eu_total_reach' \
--data-urlencode 'limit=25'
The Python equivalent prints ad IDs, page names and the EU estimate when supplied. It preserves missing estimates as None. Both examples follow the documented request shape. Run them with an authorized token to verify results returned to your app.
import json
import os
from urllib.parse import urlencode
from urllib.request import urlopen
params = {
"access_token": os.environ["META_AD_LIBRARY_TOKEN"],
"ad_reached_countries": json.dumps(["FR"]),
"ad_type": "ALL",
"ad_active_status": "ALL",
"search_terms": "casque",
"fields": "id,page_name,ad_delivery_start_time,ad_delivery_stop_time,eu_total_reach",
"limit": 25,
}
url = "https://graph.facebook.com/v27.0/ads_archive?" + urlencode(params)
with urlopen(url, timeout=30) as response:
archive = json.load(response)
for record in archive["data"]:
print(record["id"], record.get("page_name"), record.get("eu_total_reach"))
Capture a reproducible export
- Keep the API version, query date, ad type, country, dates and requested field list with every export. Use
search_page_idsif you have verified the advertiser’s Page ID. Meta documents a maximum of ten IDs per query. - Follow
paging.nextwhile Meta supplies it. Stop when the next page is absent or the API returns emptydata. Keep the original query definition and deduplicate records by Library ID. - Preserve the disclosed lower and upper bounds and the currency for eligible spend records. Keep missing fields distinct from zero. Do not sum reach for multiple ads as unique people.
- Check the authorized app, API version, country and requested fields if an API call fails. Use the current Meta documentation and the API’s returned error code. Keep token-bearing URLs out of shared logs and exports.
When to use the browser library
Use the public web library for a quick check of currently active ads. Use the archived API for reproducible queries within its documented coverage. For broader creative studies, retain each tool’s network, dates and sample definition when combining findings. Official Meta Ad Library · AdMapix research methodology
Turn these observations into your next creative study
Open the creative library and select samples for your market, network and research question.
Related Articles

How to Use Facebook Ads Library: Filters, Fields & Competitor Research
Use the official Meta Facebook Ads Library with a repeatable workflow for market and category filters, evidence capture, field limits, weekly competitor tracking, and lawful creative research.

How to Spy on Instagram, YouTube & Native Ads (2026 Field Guide)
A reference-book spoke covering the three ad channels that most spy guides skip: Instagram, YouTube, and native. Free workflows, paid tools, 2026 updates.

Meta Ad Library Video Downloader: Free Methods & Troubleshooting
Free methods for saving accessible Meta Ad Library videos, troubleshooting failed downloads and missing audio, and preserving source information for creative research.