Platforms/Facebook/Ad

Meta Ad Library Ad API

GET ยท 1 credit

Send an ad's Ad Library id or link, and get its advertiser, text, headline, link, media, platforms and dates.

GET /v1/facebook/ad-library/ads

What people use it for

  • Creative research: save competitors' ad text, headlines and videos to study what they test.
  • Landing page tracking: see where each ad sends people with link_url.
  • Run time: compare started_at and ended_at to see which ads an advertiser keeps running.

How it works with other endpoints

Ad ids come from Ad search and Company ads. The advertiser's page_id goes to Company ads for the rest of its ads.

Limits

  • One ad a call.
  • An ad that's no longer in the Ad Library answers 404 NOT_FOUND.

Example request

const url = `${process.env.API_URL}/v1/facebook/ad-library/ads?ad_id=1255232986092838`;

const response = await fetch(url, {
  headers: { "x-api-key": process.env.API_KEY },
});

const { data } = await response.json();
console.log(data);

Parameters

ParameterRequiredDescription
ad_idNoAn ad's id in the Ad Library: the digits after id= in its link. Give ad_id or url.
urlNoAn ad's link in the Ad Library: facebook.com/ads/library/?id=<id>. Give ad_id or url.

Example response

{
  "data": {
    "id": "1255232986092838",
    "url": "https://www.facebook.com/ads/library/?id=1255232986092838",
    "page_id": "15087023444",
    "page_name": "Nike",
    "page_url": "https://www.facebook.com/nike",
    "page_picture": "https://scontent.xx.fbcdn.net/v/t39.30808-6/nike-picture.jpg",
    "active": true,
    "started_at": "2026-11-10T00:00:00Z",
    "ended_at": null,
    "platforms": [
      "FACEBOOK",
      "INSTAGRAM"
    ],
    "format": "VIDEO",
    "text": "Made for the miles you haven't run yet.",
    "title": "New running shoes",
    "link_url": "https://www.nike.com/running",
    "cta": "Shop now",
    "image": "https://scontent.xx.fbcdn.net/v/t39.30808-6/ad-thumbnail.jpg",
    "video_url": "https://video.xx.fbcdn.net/v/t42.1790-2/ad.mp4",
    "versions": 3
  },
  "page": null,
  "meta": {
    "platform": "facebook",
    "endpoint": "ad",
    "params": {
      "ad_id": "1255232986092838"
    },
    "request_id": "sp_req_1f8c2d3e4a5b6c7d",
    "api_version": "v1",
    "fetched_at": "2026-11-29T09:30:00Z",
    "cached": false
  }
}

An illustrative answer: live answers have the same shape, with the page's current data.

Every field, with its type, is in the API reference, and every error code in Errors.

Price

Each call costs 1 credit, a not-found answer too. Cached answers and other errors cost nothing, and credits never expire. New accounts start with 100 free credits. See pricing for the packs.

FAQ

Does it give spend or reach?

No. It gives the ad's advertiser, text, headline, link, button, image or video, platforms, format and dates.

What does versions mean?

How many ads the Ad Library groups under this one: the same ad, run several times.

Where do ad ids come from?

From the digits after id= in an Ad Library link, or from Ad search and Company ads.

Works with

On other platforms

Start free

Your first 100 credits are on us

Sign up, create a key and make your first call in a few minutes.

No credit card required