By Shash7. Posted under guides Posted on 23rd Jul, 2025 - Updated on 22nd Jul, 2026
By Shash7. Posted under guides Posted on 23rd Jul, 2025 - Updated on 22nd Jul, 2026
The official Meta Ad Library API lets approved developers query Meta's transparency archive. Its coverage depends on the ad type and delivery location: political and issue ads are available worldwide for seven years, while ads of any type are available when they were delivered to the UK or European Union during the past year.
This guide was technically reviewed against Meta's current Ad Library API documentation on 22 July 2026.
Contents
Meta documents two primary groups of ads that can be queried through the API:
The public Ad Library website has broader browsing use cases, including viewing active ads across Meta technologies. The API coverage rules above still apply to API requests, so an API query is not a general-purpose export of every commercial ad currently visible in the Ad Library.
For eligible ads, the official API can return the Library ID, creative text, Page name and Page ID, delivery dates and the Meta technologies where the ad appeared. Additional spend, impression, demographic, targeting, beneficiary and payer fields are limited to the ad types and regions specified in Meta's field documentation.
Meta currently documents this access process:
Meta requires an access token, but the public Ad Library API page does not promise one fixed token lifetime. Token validity depends on the token type and app configuration, and a token can expire or be revoked. Inspect the token with Meta's current developer tools instead of assuming it will remain valid for a fixed number of months.
Keep access tokens out of source control, screenshots and client-side JavaScript. The examples below use placeholders deliberately.
The official endpoint is ads_archive on the versioned Graph API. This request searches for political or issue ads containing “california” that reached the United States:
curl -G \
-d "search_terms=california" \
-d "ad_type=POLITICAL_AND_ISSUE_ADS" \
-d "ad_reached_countries=['US']" \
-d "fields=id,page_id,page_name,ad_snapshot_url,ad_creative_bodies,publisher_platforms,ad_delivery_start_time,ad_delivery_stop_time" \
-d "access_token=<META_ACCESS_TOKEN>" \
"https://graph.facebook.com/<API_VERSION>/ads_archive"
If you need structured access to ad research already saved across supported sources, use Swipekit's multi-platform Ad Library API. It is a separate Swipekit service and does not replace or impersonate Meta's official API.
A successful Meta response contains a data array and, when more results are available, a paging object:
{
"data": [
{
"id": "1234567890",
"page_id": "123456",
"page_name": "Example Page",
"publisher_platforms": ["FACEBOOK", "INSTAGRAM"],
"ad_creative_bodies": ["Example ad copy"]
}
],
"paging": {
"cursors": {
"before": "CURSOR",
"after": "CURSOR"
},
"next": "https://graph.facebook.com/<API_VERSION>/ads_archive?..."
}
}
Follow paging.next or the returned cursor instead of assuming one response contains the complete result set.
The fields you can request depend on the ad type and where it was delivered.
id: the Ad Library ID.page_id and page_name: the Facebook Page associated with the ad.ad_creative_bodies, link titles, descriptions and captions: available creative text.ad_delivery_start_time and ad_delivery_stop_time: delivery dates in UTC.publisher_platforms: Meta technologies where the ad appeared, such as Facebook or Instagram.ad_snapshot_url: a link that displays the archived ad, including its uncompressed creative. Use and storage remain subject to Meta's terms.Request only fields supported for the ad type and location you are querying. Meta may reject an incompatible field or return it without a value.
ad_reached_countries is required. Ads that did not reach the EU return only when they are about social issues, elections or politics.search_terms is limited to 100 characters. Use search_type to choose unordered keywords or an exact phrase.search_page_ids accepts up to ten Facebook Page IDs in one request.ALL, IMAGE, MEME, VIDEO and NONE.id values.Confirm that the access token is present, belongs to the correct app and remains valid. Generate or inspect tokens through Meta's current developer tooling; do not rely on an old token-lifetime assumption.
Complete identity and location confirmation, confirm the Meta developer account and app are configured, and use the Access the API flow. Access for one Facebook account or app should not be assumed to apply automatically to every other account or app.
Check the coverage rules first. A normal commercial ad outside the UK and EU will not become eligible merely because its country was included in the query. Also check dates, active status, search terms and ad_type.
Many spend, reach, targeting and demographic fields are restricted by ad type or delivery location. Remove incompatible fields, confirm the ad's coverage and retry with the smallest working field list.
Read the paging object and follow the next cursor until there is no next page. Apply your own stopping and retry rules so a failed page does not silently truncate a large export.
The two APIs solve different problems and use separate authentication.
| Capability | Official Meta Ad Library API | Swipekit API |
|---|---|---|
| Platforms covered | Meta technologies within Meta's documented ad-type and regional coverage | Saved ad research in your Swipekit workspace; the current API specification documents network filters such as Facebook, Instagram and TikTok |
| Service owner | Official Meta transparency API | Independent Swipekit service |
| Authentication | Meta app access token after the required authorization process | Swipekit workspace API key sent as a Bearer token |
| Creative and media data | Creative text and an ad snapshot URL for eligible ads, subject to Meta's field and usage rules | Available fields and saved asset references attached to records already stored in the Swipekit workspace |
| Typical user | Researchers and developers querying Meta's eligible transparency archive | Agencies and marketing teams connecting saved ad research to dashboards, automations and internal tools |
| Documentation | Meta Ad Library API | Swipekit API reference |
Use Meta's official API when your task fits its transparency coverage and fields. Use the Swipekit API when you need programmatic access to the research your team has already collected in Swipekit.
Ready to connect your saved research to an internal tool? Review the Swipekit Ad Library API documentation, create a workspace, and generate an API key from workspace settings.
Save winning ads from every major library, keep the full context, and turn scattered inspiration into reusable creative direction.
Start free trial
AG1 by Athletic Greens
Meet Your New Supplement Routine ✅
Feel Reformed
Upgrade your Matcha
HEC Wellness Center
AG1 by Athletic Greens
Meet Your New Supplement Routine ✅
Feel Reformed
Upgrade your Matcha
HEC Wellness Center