Facebook Ad Library
GET /v1/ad-library/facebook/ad-details

Facebook Ad Details API

One Meta ad by ID — same creative as search, plus delivery breakdowns when Meta publishes them. Flat 2 credits.

2 credits per request
TL;DR
One Meta ad by ID — same creative as search, plus delivery breakdowns when Meta publishes them. Flat 2 credits. The Facebook Ad Details API (Facebook Ad Library) is a single authenticated GET request to /v1/ad-library/facebook/ad-details that responds with clean JSON and costs 2 credits. Pass cache=true for a free 24h cache hit; default is always fresh. Start with 100 free credits — no credit card.

What is the Facebook Ad Details API?

Paste a Meta Ad Library ad URL or archive ID and get that creative as clean JSON. Creative fields (text, headline, cta, landingUrl, images[], videos[], advertiser) match a search hit for the same id — use this for ID lookup without paging search. media[] is the canonical URL list (one primary asset per creative, including DCO cards) — resizedUrl and video posters live on images[] / videos[], which fill from cards when Meta leaves the typed arrays empty. DCO {{product.*}} tokens fall back to cards[0] and set textIsFromCard. mediaUrlsExpireAt is the earliest Meta CDN oe= stamp (~5 days). caption is Meta's display domain line under the creative (e.g. blogs.groovewriters.com), not ad copy — text / headline / linkDescription hold the copy. advertiser.id is the Ad Library page id; advertiser.profileId is the facebook.com/{digits} namespace when it differs (url is built from profileId); advertiser.location is keyed null when Meta withholds it. Delivery extras when Meta publishes them (mostly political/issue and EU AAA ads): publisherPlatforms, demographicDistribution[], regionDistribution[], ageCountryGenderReachBreakdown / euTransparency, variantCount (collation), isAaaEligible, spendRange {raw, currency, min, max} (max null on open-ended bands like >$1M). Meta publishes spend and impression ranges only for political and issue ads in regions that require disclosure; commercial advertisers omit both. There is no platforms twin. On commercial ads Meta often withholds those breakdowns — keys stay present as null so the schema is stable. Always 2 credits — native and fallback share one price. fetchPath is native | fallback.

What you get

  • ID lookup without paging Ad Library search
  • publisherPlatforms when Meta lists them (no platforms twin)
  • demographicDistribution[] + regionDistribution[] when published
  • EU AAA: euTransparency + ageCountryGenderReachBreakdown
  • variantCount (collation) + isAaaEligible + spendRange
  • Stable null keys when Meta withholds delivery extras; flat 2 credits

Try it

Open in Playground

Fill in the parameters below and copy a ready-to-run request, or open the live Playground to run it against your account (no API key paste).

Parameters

Sign in to run live
curl "https://api.captapi.com/v1/ad-library/facebook/ad-details?url=https%3A%2F%2Fwww.facebook.com%2Fads%2Flibrary%2F%3Fid%3D317161109571794" \
  -H "Authorization: Bearer capt_live_..."
# or: -H "x-api-key: capt_live_..."

Edit the parameters and the code updates instantly. Switch languages and hit copy.

Example response

{
  "success": true,
  "data": {
    "platform": "facebook_ad_library",
    "id": "317161109571794",
    "url": "https://www.facebook.com/ads/library/?id=317161109571794",
    "text": "The Voting Information Center—one-tap voting registration information from election experts and authorities in one place.",
    "headline": "Voting Information Center",
    "cta": "Learn more",
    "landingUrl": "http://facebook.com/votinginformationcenter",
    "adFormat": "VIDEO",
    "firstShown": "2020-09-22T07:00:00.000Z",
    "lastShown": "2020-10-05T07:00:00.000Z",
    "impressions": ">1M",
    "spend": ">$1M",
    "country": "US",
    "advertiser": {
      "id": "108824017345866",
      "name": "Meta",
      "url": "https://www.facebook.com/Meta/",
      "logo": "https://scontent-dfw5-2.xx.fbcdn.net/v/t1.6435-9/119568341_200337161527884_7846459746434232698_n.png?stp=dst-png_s60x60&_nc_cat=100&ccb=1-7&_nc_sid=c53f8f&_nc_ohc=ZqrAiU5uA1sQ7kNvwHsXpf9&_nc_oc=AdqVVq_tCCm9QfdHEQa5d82UKJTt9DT4LxrW9m95vTx7VJLcyuQH74gIZv0WeiJgIfo&_nc_zt=23&_nc_ht=scontent-dfw5-2.xx&_nc_gid=oKi5rqU7-78Y6XFLpAVqvA&_nc_ss=79289&oh=00_AQDIgONmGu5lj1i0jpr_nH9fjb7afatDtlB-wsXtBQNtZQ&oe=6A8F324E"
    },
    "media": [
      "https://video-dfw5-1.xx.fbcdn.net/o1/v/t2/f2/m412/AQNN757NtitUcJnpv0ODeMH6fXo-yFM-X90P2W82Zsrc70oOzST9lrKgscKf21SHBUtZ9pdKMclY8s32B0eRJ7o.mp4?_nc_cat=106&_nc_sid=ef5aa3&_nc_ht=video-dfw5-1.xx.fbcdn.net&_nc_ohc=DeBVZh2ChkAQ7kNvwELM_GV&efg=eyJ2ZW5jb2RlX3RhZyI6Inhwdl9wcm9ncmVzc2l2ZS5WSV9VU0VDQVNFX1BST0RVQ1RfVFlQRS4uQzMuMzQwLmFzaWNfaHExX3NkX3Byb2dyZXNzaXZlIiwieHB2X2Fzc2V0X2lkIjo4MzE0MTAwMzMxNDk2MzYsImFzc2V0X2FnZV9kYXlzIjoyNDEsInZpX3VzZWNhc2VfaWQiOjEwNjgwLCJkdXJhdGlvbl9zIjoxNSwidXJsZ2VuX3NvdXJjZSI6Ind3dyJ9&ccb=17-1&_nc_gid=oKi5rqU7-78Y6XFLpAVqvA&_nc_ss=79289&_nc_zt=28&oh=00_AQB-CUR53tb21BEWdlRLg5BhAauE3-hDDO9zmz06SvSAdg&oe=6A6D9B48",
      "https://scontent-dfw5-1.xx.fbcdn.net/v/t39.35426-6/120065387_2711663819108220_8472417301728012411_n.jpg?_nc_cat=105&ccb=1-7&_nc_sid=c53f8f&_nc_ohc=JCEJHIw0engQ7kNvwEcgh1o&_nc_oc=Ado6Dn6wrEd2aZKTiM6OLVJyx_BYbHRC0Bmv70xAZp21Pm2Enab2l80KoUSxQZAs1Ow&_nc_zt=14&_nc_ht=scontent-dfw5-1.xx&_nc_gid=oKi5rqU7-78Y6XFLpAVqvA&_nc_ss=79289&oh=00_AQAw5ZEVUbeJYpBcx6Qa4wV6V-hZRjNvtI487nUdgq8UZA&oe=6A6D850A"
    ]
  }
}

Billing metadata is returned in response headers: X-Captapi-Credits (credits charged), X-Captapi-Cache (hit or miss), and X-Captapi-Source. Failed requests (4xx/5xx) are never charged. See the full list of error codes in the error reference.

Response structure

A successful call returns success and a data object with the following fields:

Top-level fields

  • platformPlatform identifier for this response (matches the endpoint's platform).
  • idStable platform ID for the item.
  • urlCanonical URL of the item.
  • textBody copy of the creative. DCO {{product.*}} tokens fall back to cards[0] (textIsFromCard).
  • headlineAd headline / title when Meta exposes it. Not a profile headline. DCO tokens fall back to cards[0].
  • ctaCall-to-action label (e.g. Learn more).
  • landingUrlClick-through URL from the creative.
  • adFormatCreative format Meta labelled (IMAGE, VIDEO, …).
  • firstShownMeta delivery-start date as YYYY-MM-DD (Pacific calendar day).
  • lastShownMeta delivery-end date as YYYY-MM-DD (Pacific calendar day).
  • impressionsImpression band when Meta publishes it. Commercial usually null.
  • spendSpend band when Meta publishes it (political/issue ads). Commercial usually null.
  • countryISO market when Meta publishes one on the detail page. Not a popular-creators feed market.
  • mediaCanonical URL list — one primary asset per creative, including DCO cards. Use images[] / videos[] for resizedUrl and posters.

Advertiser

The advertiser object contains:

  • idAd Library page id (view_all_page_id). The one identity to join on.
  • namePage display name.
  • urlPage URL — built from profileId when Meta exposes that namespace.
  • logoPage profile picture URL.

Parameters

NameTypeRequiredDescription
urlstringYesMeta Ad Library ad URL or ad ID. The URL platform must match this endpoint's platform. Do not pass cross-platform URLs, e.g. YouTube to TikTok, Instagram to Facebook, LinkedIn to X/Twitter, or Pinterest to Rumble.
cachebooleanNoSet true to serve from the 24h response cache (0 credits on hit). Default false — always fetch fresh.

Authentication: send your key as Authorization: Bearer capt_live_.... A typical call costs 2 credits. Pass cache=true for a free 24h cache hit; default is always fresh.

Using an AI agent? This endpoint is the MCP tool facebook_ad_library_ad_details via @captapi/mcp. Set it up →

How it works

  1. 1. Sign up — get 100 free credits, no card required.
  2. 2. Create a key from your dashboard.
  3. 3. Send one request to /v1/ad-library/facebook/ad-details and parse the JSON response.

Use cases

Analytics

Track views, likes, and engagement over time.

Competitor Monitoring

Benchmark the performance of other creators.

Dashboards

Power reporting and BI with real metadata.

Content Curation

Filter and rank videos by performance.

Frequently asked questions

What does the Facebook Ad Details API do?+

The Facebook Ad Details API lets you fetch full metadata and key stats from a public Facebook Ad Library ad using one GET request to /v1/ad-library/facebook/ad-details. It returns clean JSON — no OAuth or infrastructure setup required.

How many credits does the Facebook Ad Details API cost?+

Each successful call costs 2 credits. Pass cache=true to serve from the 24h cache (0 credits on hit); default is always fresh. Selected profile endpoints also accept cacheMaxAge=1d|3d|7d|14d|30d. Failed or empty results are never charged.

Do I need a Facebook Ad Library API key or OAuth?+

No. A single Captapi key works across every platform Captapi supports — YouTube, TikTok, Instagram, Facebook, Twitter/X, Reddit, Threads, Bluesky, Pinterest, LinkedIn, Rumble, Spotify, Kwai, and more. We handle proxies, rate limits, retries, and authentication for you.

Why did one call cost 17 credits?+

That was a billing bug, not a second price. Native hits billed 2; a native miss fell through to the extended actor and hardcoded 17 — the same PH-8 leftover as popular-hashtags charging 18. Both paths are 2 credits now. fetchPath is native | fallback so you can see which path ran; it does not change the price.

Why is media.length 2 on a single-creative ad?+

It isn't anymore. media used to flatten the primary asset with its variant (images[].resizedUrl, or the video poster). media is now one URL per creative. images[] / videos[] still pair url with resizedUrl / previewUrl.

Is caption the ad copy?+

No. caption is the display domain Meta shows under the creative (blogs.groovewriters.com). text, headline, and linkDescription are the copy.

Why does advertiser have two ids?+

id is the Ad Library page id (view_all_page_id) — join on that. profileId is the facebook.com/{digits} profile namespace when it differs; advertiser.url is built from profileId. Both are keyed on this endpoint (profileId is null when they are the same or unknown).

Is the Facebook Ad Details API suitable for production use?+

Yes. It is a stable REST endpoint with predictable JSON and automatic retries. Pass cache=true to serve from the 24h cache (0 credits on hit); default is always fresh. Selected profile endpoints also accept cacheMaxAge=1d|3d|7d|14d|30d. Use it for analytics, monitoring, and content automation.

More Facebook Ad Library APIs

Ready to use the Facebook Ad Details API?

Sign up, grab your key, and make your first call in 60 seconds.

Facebook Ad Details API | Captapi — Captapi