Ads

Meta Ad Library API

Also known asMeta 广告库meta adsmeta 广告facebook ad libraryfacebook 广告库

5 endpoints read Meta Ad Library: ad library, advertisers. From $0.0020 a call. No Meta Ad Library login and no cookie; a failed call is free.

Endpoints5 endpointsin 2 groups, one response shape
PriceFrom $0.0020per call. Failed calls are free
When an upstream failsRetried for youChecked every day with real calls · 4 days on record
DataFetched liveat the moment of the call

One call, as it came back

A recorded call, fields already tidied up: ready for an AI or a spreadsheet.
Recorded
GET/v1/meta/ads/get$0.0020
FieldValue
formatimage
first_shown_at2025-04-07 07:00 UTC
last_shown_at2026-10-12 07:00 UTC

The first 3 rows of a response recorded 2026-10-12 21:45 UTC.

Run it in the Playground · $0.0020
Recorded response
{
  "code": "ok",
  "request_id": "f8a22e1e-fee2-4b69-9e5c-446621ff8b56",
  "data": {
    "item": {
      "id": "1058286942402074",
      "url": "https://www.facebook.com/ads/library/?id=1058286942402074",
      "format": "image",
      "title": "Start weekend hiking with the kit made for beginners",
      "text": "Start weekend hiking with the kit made for beginners",
      "landing_url": "https://www.pineandoak-home.com/fall?utm_source=meta",
      "advertiser": {
        "id": "124244511652870",
        "name": "Pine & Oak Home",
        "url": "https://www.facebook.com/profile.php?id=124244511652870",
        "avatar_url": "https://scontent.xx.fbcdn.net/v/t39.30808-1/419991773_116184846204048_n.jpg"
      },
      "images": [
        "https://scontent.xx.fbcdn.net/v/t39.35426-6/433783216_111510700877970_n.jpg",
        "https://scontent.xx.fbcdn.net/v/t39.35426-6/464959343_128562597021179_n.jpg",
        // … 4 more
      ],
      "first_shown_at": "2025-04-07T07:00:00.000Z",
      "last_shown_at": "2026-10-12T07:00:00.000Z"
    }
  },
  "warnings": [],
  "meta": {
    "capability": "meta.ads.get",
    "result_status": "complete",
    "fetched_at": "2026-10-12T21:45:40.000Z",
    "cached": false,
    "replayed": false,
    "unavailable": {},
    "billing": {
      "amount": "0.002",
      "currency": "USD",
      "balance_after": "9.998"
    }
  }
}

From a response recorded 2026-10-12 21:45 UTC. Names, text and IDs are examples, and so are the links: none is the recorded one (the page shows no one's personal data); the figures are as recorded. Long lists are cut. The request ID, cursor and balance are made up.

What you can get

Each row is an endpoint: what it returns and what one call costs.

EndpointPathReturnsPrice
Ad library3
Meta Ad Library searchGET/v1/meta/ads/searchAd list$0.0020
Meta ad detailGET/v1/meta/ads/getAd$0.0020
Meta ad video transcriptGET/v1/meta/ads/transcript/getTranscript$0.0020
Advertisers2
Meta advertiser searchGET/v1/meta/advertisers/searchAdvertiser list$0.0020
Meta advertiser's adsGET/v1/meta/advertisers/ads/listAd list$0.0020
Prices are the prices in force. A call that fails, or whose result is uncertain, costs nothing.Meta Ad Library API pricing →Meta Ad Library data in your AI →See live status →

What people build with it

Ready-made tasks your AI can run on Meta Ad Library data. Each is a few calls under a spending cap.

Ask about Meta Ad Library right inside Claude or Cursor

Add the DataXAPI MCP server and the AI finds the Meta Ad Library endpoint it needs and calls it; answers link back to the source. You pay for the calls it makes.

Meta Ad Library MCP setup →
https://api.dataxapi.com/mcp

Start in three steps

The call shown here is Meta ad detail. Every other Meta Ad Library endpoint is called the same way and answers in the same envelope.

Get a key

Sign in with an emailed code or Google. Free trial, no card needed.

Call it, or let your AI call it

One GET from your code. Or paste this prompt into your agent with your key in it: it sets itself up, then finds and calls these endpoints by itself.

Read https://dataxapi.com/agents.md and set up DataXAPI in this agent. My API key is dx_live_…; use it for every DataXAPI call.

Sign in to copy it with your key

Read the same shape every time

Items are in data.items (one object in data.item), the next page in page.next_cursor, the charge in meta.billing.amount. A failed call is not charged.

Read the quickstart →
curl -G "https://api.dataxapi.com/v1/meta/ads/get" \
  --data-urlencode "id=1466307095509411" \
  -H "Authorization: Bearer $DATAXAPI_API_KEY"
from dataxapi import DataXAPI

dx = DataXAPI()  # reads DATAXAPI_API_KEY
result = dx.meta.ads.get(id="1466307095509411")
print(result["data"]["item"])
import { DataXAPI } from "@dataxapi/sdk";

const dx = new DataXAPI(); // reads DATAXAPI_API_KEY
const result = await dx.meta.ads.get({ id: "1466307095509411" });
console.log(result.data.item);
dataxapi call meta.ads.get id=1466307095509411
{
  "mcpServers": {
    "dataxapi": {
      "type": "http",
      "url": "https://api.dataxapi.com/mcp",
      "headers": {
        "Authorization": "Bearer ${DATAXAPI_API_KEY}"
      }
    }
  }
}

Add this to your MCP client, then ask your agent to call meta.ads.get.

Edge cases

What the Meta Ad Library endpoints do at their edges, and what to check when a call does not return what you expected.

Page sizes
A list returns 15 to 30 items a page, depending on the endpoint. 2 of the 3 lists go on to a next page: page.next_cursor, passed back as cursor, each page a call of its own. The others return one page only.
Fields it cannot give
2 of the 5 endpoints cannot fill every field of the object they return. Each endpoint's page lists which, and every answer repeats them in meta.unavailable: a missing field is never a silent zero.
A missing object that reads as empty
Meta advertiser's ads: an object that does not exist cannot be told from one with nothing under it, so the answer is an empty result, not a 404, and is charged as an empty result is.
Preview structures
4 endpoints return a preview structure whose fields may still change; the others return a standard object, the same on every platform.
Running ads only
Search and an advertiser's ads return the ads running now.
The advertiser ID is a Page ID
An advertiser is a Facebook Page: find its ID with the advertiser search by name, then list its ads by that ID.
Library ID or link
One ad is read by its Library ID or its link (facebook.com/ads/library/?id=<ID>).
Empty is not “not found”
An advertiser that does not exist and one with no ads running both return an empty list, charged as an empty result.
Not every ad has words
An ad without a video, or a video in which nothing is transcribed, reads as not found and is not charged.

Questions about the Meta Ad Library API

Short answers. The details are on each endpoint's page.

How is the Meta Ad Library API priced?

Per call, no subscription. All 5 endpoints cost $0.0020 a call. You are charged when data comes back; a failed call costs nothing.

Do I need a Meta Ad Library account or a cookie?

No. One DataXAPI key is all you hold: no Meta Ad Library login, no cookie, no device to keep alive. The endpoints return publicly visible data only.

Is the data live?

A call fetches from Meta Ad Library at that moment, and meta.fetched_at says when. A result is kept for 24 hours, so a retry with the same Idempotency-Key is not charged again.

Is an empty result charged?

A list that comes back empty is charged its price: the search was run. Reading one object that does not exist answers not_found and is free.

What happens when Meta Ad Library changes something?

A call that fails is not charged, whatever the reason. An endpoint that is paused answers capability_paused, also free, and GET /v1/catalog/status says what is up right now.

Related

Call Meta Ad Library with one key.

Free trial on sign-up: up to 50 calls at $0.0020. No card. No Meta Ad Library login, no cookie, no subscription. A failed call is free.

Start free