Meta Ad API & Facebook Ad Library API: Complete Developer Guide (2026)
Every Meta Ad API endpoint, parameter, response field, rate limit and code sample. Official Graph ads_archive + managed Meta Ad API options for commercial ads.
If you are a developer looking for a Meta Ad API or Facebook Ad Library API, this guide is for you. We cover both the official Meta Graph ads_archive endpoint and the managed third-party Meta Ad API options, with working code, real rate limits, and the trade-offs nobody documents. By the end, you will know which Meta Ad API fits which use case — and how to ship in a day.
The official Meta Ad API (Graph ads_archive)
Meta's official ad API lives under the Graph API at graph.facebook.com/v19.0/ads_archive. It is the only Meta Ad API endpoint Meta itself ships, and it is restricted: the Meta Ad API only returns issue, election and political ads — never commercial ads.
To call the official Meta Ad API you need:
- A Meta developer account with identity verification
- A long-lived access token with the
ads_archivepermission - To agree to Meta's political-ad data terms
curl -G "https://graph.facebook.com/v19.0/ads_archive" \
-d "access_token=YOUR_TOKEN" \
-d "ad_type=POLITICAL_AND_ISSUE_ADS" \
-d "ad_reached_countries=['US']" \
-d "search_terms=climate" \
-d "fields=ad_creative_bodies,ad_delivery_start_time,page_name"The Meta Ad API response is JSON, paginated by cursor, capped at 5,000 results per query, and rate-limited per app (typically ~200 calls/hour for new tokens, more for verified apps).
Meta Ad API: every parameter that matters
| Parameter | Required | What it does |
|---|---|---|
| access_token | Yes | Long-lived app token with ads_archive permission |
| ad_type | Yes | Always POLITICAL_AND_ISSUE_ADS on the public Meta Ad API |
| ad_reached_countries | Yes | Array of ISO country codes, e.g. ['US','GB'] |
| search_terms | No | Free-text search across ad copy |
| search_page_ids | No | Restrict to specific Page IDs |
| ad_active_status | No | ACTIVE, INACTIVE or ALL |
| ad_delivery_date_min | No | ISO date — start of window |
| ad_delivery_date_max | No | ISO date — end of window |
| fields | No | Comma list of return fields |
| limit | No | Page size, max 5,000 across the cursor |
Meta Ad API response shape
{
"data": [
{
"id": "1234567890",
"page_id": "987654321",
"page_name": "Example Org",
"ad_creative_bodies": ["Vote yes on Proposition 1..."],
"ad_delivery_start_time": "2026-04-12",
"ad_delivery_stop_time": "2026-04-30",
"impressions": { "lower_bound": "10000", "upper_bound": "49999" },
"spend": { "lower_bound": "1000", "upper_bound": "4999" },
"currency": "USD"
}
],
"paging": { "cursors": { "after": "..." }, "next": "..." }
}The Meta Ad API exposes banded spend and impressions for political ads only — never exact numbers, and never for commercial ads.
For commercial ads: the managed Meta Ad API route
Since the official Meta Ad API is political-only, every team that needs commercial ad data uses a third-party Meta Ad API that scrapes the Facebook Ad Library on your behalf. There are two practical paths.
Path A — Build your own Meta Ad API
The Facebook Ad Library renders results client-side. To build your own Meta Ad API you need:
- A headless browser cluster (Playwright or Puppeteer)
- A residential proxy pool to avoid IP blocks
- A DOM parser that survives Meta's near-quarterly UI changes
- A queue + worker system to handle pagination
- Storage + a query layer (Postgres + an indexer)
Expect 2–3 weeks to ship v1 of your own Meta Ad API, then a week per quarter on maintenance.
Path B — Use a managed Meta Ad API
AdScrape's public Meta Ad API handles scraping, proxies and schema. A typical call to the managed Meta Ad API looks like:
const res = await fetch("https://api.adscrape.in/v1/search", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({
brand: "Nike",
country: "US",
active: true,
limit: 50,
}),
});
const { ads } = await res.json();Meta Ad API rate limits and pricing reality
| Route | Rate limit | Setup time | Cost |
|---|---|---|---|
| Official Meta Ad API (Graph) | ~200 calls/hr/app | 1–2 days | Free (political only) |
| DIY Meta Ad API | Proxy-dependent | 2–3 weeks | $200+/mo proxies |
| Managed Meta Ad API (AdScrape) | Plan-dependent | 5 minutes | From $0 |
Official Meta Ad API vs Facebook Ad Library API vs managed
Marketers ask whether the "Facebook Ad Library API" and "Meta Ad API" are the same thing. They are — both names refer to the Graph ads_archiveendpoint. The renaming followed Meta's 2021 corporate rebrand. The Facebook Ad Library API and the Meta Ad API are identical: same URL, same params, same political-only scope.
When to use which Meta Ad API
- Political research / journalism → official Meta Ad API.
- Side project / one-off study → managed Meta Ad API on a free tier.
- Production analytics product → managed Meta Ad API on a paid plan; DIY only if compliance forces it.
Common Meta Ad API errors
(#10) Application does not have permission— your app is not approved for the Meta Ad API; submit App Review with theads_archivepermission.Invalid OAuth access token— your token expired; long-lived tokens last 60 days for the Meta Ad API.(#17) User request limit reached— Meta Ad API rate limit; back off and retry with exponential delay.
Meta Ad API FAQ
Is there an official Meta Ad API?
Yes — Meta exposes graph.facebook.com/v19.0/ads_archive. The official Meta Ad API returns issue, election and political ads only.
Is the Facebook Ad Library API the same as the Meta Ad API?
Yes. After Meta's 2021 rebrand, the Facebook Ad Library API and Meta Ad API became two names for the same endpoint.
Can I get commercial ads through the Meta Ad API?
Not through the official Meta Ad API. For commercial ads, use a managed Meta Ad API provider like AdScrape that scrapes the public Facebook Ad Library on your behalf.
Is the Meta Ad API free?
The official Meta Ad API is free but limited to political ads. Managed Meta Ad APIs typically offer a free tier (e.g. AdScrape gives 100 searches/month free) and paid plans for higher volume.
What is the Meta Ad API rate limit?
The official Meta Ad API rate limit starts around 200 calls/hour/app and scales with App Review verification. Managed Meta Ad APIs publish per-plan limits.
Put this into practice with AdScrape
Search every active Meta ad, compare brands side-by-side, and pull it all through a clean REST API. Free to start, no credit card required.