Facebook Ad Library

Facebook Ad Library Search API

Search Meta Ad Library by keyword — active/inactive, media type, date range, platforms, cursor, and spend/impressions when Meta publishes them.

Search Meta's Ad Library and get competitor creatives as clean JSON — filters: status (default ACTIVE), media_type, platforms, ad_type, search_type (exact phrase), sort_by (total_impressions|relevancy_monthly_grouped), start_date/end_date, cursor, trim. One call reads Meta's first result page (~30 ads); a limit above 30 also scrolls the library for more, up to ~70–80 ads per call (those calls take ~45–60s instead of ~25s). Cursor pages that fetched batch via nextCursor (not Meta's multi-thousand POST cursor). hasMore is true only when nextCursor is present; when that batch is spent but Meta reports more ads past it, hasMore is null and truncatedReason is library-page — never a false no-more-ads (truncatedReason is null otherwise). searchResultsCount is Meta's upstream match count (can be thousands); retrievableCount is how many ads this cursor walk can actually return (the fetched HTML batch, typically ~30–50) — publish both; the big number is not walkable. Same advertiser id collapses to one name within a response (name normalisation, not dedup). Collation siblings share collationId and each consume a limit slot — group on that key if you want one row per creative; collationId is always keyed (null when Meta omits it) and siblings in one collated_results group inherit a missing id. Each ad: text/headline/cta/ctaType/landingUrl, media[] (canonical URL list) plus typed images/videos + cards[], isActive, publisherPlatforms (not a platforms twin), pageLikeCount/pageCategories/pageEntityType, politicalCountries, reachEstimate, spend/impressions when Meta publishes them. Meta publishes spend, impressions, reach, and the paid-for-by extras (byline, disclaimerLabel, brandedContent, pageEntityType, totalActiveTime) only for political and issue ads in regions that require disclosure; commercial advertisers omit them — politicalCountries: [] is the signal, not a scrape miss. DCO creatives substitute cards[0] when text/headline/linkDescription are {{product.*}} tokens and set textIsFromCard (leftover tokens keep isTemplated). images[]/videos[] are filled from cards when Meta leaves the typed arrays empty. mediaUrlsExpireAt is the earliest Meta CDN oe= stamp (~5 days). variantCount is always keyed (null when Meta omits it). advertiser is {id,name,url,logo,location,profileId?} — id is the Ad Library page id; profileId is the facebook.com/{digits} namespace when it differs; identical pageId/advertiserId aliases are not emitted. advertiser.location is null in practice on search: Meta's search results carry no advertiser location (the key stays for the shared ad-library schema). firstShown/lastShown are calendar days (YYYY-MM-DD) in Pacific — Meta's date, not an 8 a.m. UTC instant. Row-level country is omitted when Meta does not publish a per-ad market (the envelope country is the query). Envelope fetchMs / parseMs / totalMs survive the customer-trace strip so a ~13s call is attributable. Native fetch is capped at 110s. Flat 2 credits on the native path.

Docs: https://captapi.com/apis/facebook-ad-library-search

get/v1/ad-library/facebook/search

Request

  • Base URL: https://api.captapi.com
  • URL: https://api.captapi.com/v1/ad-library/facebook/search
  • Auth: one of:
    • HTTP bearer
    • API key in header X-API-Key

Query parameters

qstring required

Keyword, brand, or advertiser to search Meta Ad Library (min 2 characters).

countrystring

Two-letter ISO country code (e.g. US, GB, DE). Default US. Non-ISO codes are a definitive 400 INVALID_COUNTRY — Meta would otherwise ignore the code and search globally while echoing it back as if the filter worked.

limitinteger

Max items to return (default 20, max 200). Flat 2 credits per call.

status'ALL' | 'ACTIVE' | 'INACTIVE'

Ad delivery status: ACTIVE (default), INACTIVE, or ALL. Use ACTIVE for "what are they running now?".

media_type'ALL' | 'IMAGE' | 'VIDEO' | 'MEME' | 'IMAGE_AND_MEME' | 'NONE'

Creative filter: ALL (default), IMAGE, VIDEO, MEME, IMAGE_AND_MEME, or NONE.

platformsstring

Comma-separated publisher platforms to keep: FACEBOOK, INSTAGRAM, MESSENGER, AUDIENCE_NETWORK, THREADS.

ad_type'all' | 'political_and_issue_ads'

all (default) or political_and_issue_ads. Spend/impressions are typically only filled for political/issue ads.

search_type'keyword_unordered' | 'keyword_exact_phrase'

keyword_unordered (default) or keyword_exact_phrase.

sort_by'total_impressions' | 'relevancy_monthly_grouped'

Meta sort mode: total_impressions or relevancy_monthly_grouped.

start_datestring

Only ads with delivery start on/after this date (YYYY-MM-DD).

end_datestring

Only ads with delivery start on/before this date (YYYY-MM-DD).

cursorstring

Pagination cursor from a previous nextCursor. Pages through the current Meta HTML result batch.

trimboolean

When true, omit cards/images/videos typed arrays (media[] stays). Captapi payloads are already lean vs Meta nested snapshots.

cacheboolean

Set true to serve from the 24h response cache (0 credits on hit). Default false — always fetch fresh.

Response

Success. The data object for this endpoint.

successunknown required

Changes

No recorded changes to this operation across all 3 revisions of this API.