Winning Facebook Ads API

The ads worth copying are the ones advertisers keep paying for. Every ad returned by the API carries days_active, how long it has been running, and a winning_score from 0 to 100 that weighs longevity first, then the number of versions of the creative and, on the ad detail, its reach in the European Union.

Filter any ad search or advertiser’s ads with min_days_active and order them with sort=longevity to see the long-running ads of a keyword, a market or a competitor on Facebook, Instagram, Messenger and Threads. The formula is public and the fields cost nothing extra.

No credit card needed. One API key works on every endpoint.

Quick example

GEThttps://api.scrapeadlibrary.com/v1/ads/search?q=...&min_days_active=30&sort=longevity
GEThttps://api.scrapeadlibrary.com/v1/pages/{page_id}/ads?min_days_active=30&sort=longevity
curl "https://api.scrapeadlibrary.com/v1/ads/search?q=protein%20powder&country=US&min_days_active=30&sort=longevity" \
  -H "X-API-Key: sal_your_api_key"

Response

{
  "data": [
    {
      "id": "1550534860016399",
      "page": { "id": "15087023444", "name": "Nike", ... },
      "status": "active",
      "started_at": "2026-05-19T07:00:00Z",
      "ended_at": null,
      "variants_count": 4,
      ...
      "days_active": 187,
      "winning_score": 88
    }
  ],
  "has_more": true,
  "next_cursor": "c_9Xk2a8ZqLw",
  "credits_used": 1
}

Illustrative values: a real response carries the live data of the ads and advertisers you ask for.

How the winning score is calculated

days_active: whole days from started_at to ended_at, or to today (UTC) while the ad is active; null when started_at is missing (or an inactive ad has no ended_at).

winning_score adds up to three parts. Longevity weighs most because it is what the advertiser decides with real results in hand; more versions of the same creative mean the advertiser is scaling it; reach is counted only where Meta publishes it (ads delivered in the EU, on the ad detail).

  • L (longevity) = 70 × min(days_active, 90) / 90
  • V (variants) = 15 × min(variants_count − 1, 9) / 9
  • R (EU reach) = 15 × min(log10(1 + transparency.eu.reach) / 6, 1), only on the ad detail of ads delivered in the EU
  • winning_score = L + V + R when the EU reach is known, otherwise (L + V) × 100 / 85, so a missing reach never lowers it; rounded to the nearest integer (halves up); null when days_active is null

A few values: an ad live for 90 days or more in 10 or more versions scores 100; 90 days in a single version scores 82; 30 days in 4 versions scores 33; an ad that started today scores 0.

Fields

FieldTypeDescription
days_activeinteger | nullDays the ad has been running, or ran for when stopped.
winning_scoreinteger | null0-100, longevity first; null when days_active is null.
variants_countintegerHow many versions of the ad Meta grouped together.
started_at, ended_atstring | nullWhen the ad started and stopped (null while active).

Parameters

ParameterInTypeDefaultDescription
min_days_activequeryinteger-Keep only ads running for at least this many days (0-3650), within the returned page
sortqueryenumrelevancelongevity: highest days_active first, within the returned page (also relevance | impressions)
statusqueryenumactiveactive | inactive | all: with all, days_active of a stopped ad is how long it ran

min_days_active and sort=longevity apply to the ads of the returned page: the Ad Library cannot filter or sort by age, so a filtered call can return fewer than limit ads (even none) while has_more and next_cursor still lead to the next page. Same price: 1 credit per call. Every other filter of the ads search and the page ads endpoints works as usual.

What people build with it

Creative research

Pull the longest-running ads of a niche and study their hooks, formats and offers before you brief a new creative.

Competitor watch

List the ads of each competitor with min_days_active=30 and see which messages they keep paying for.

Ad spy tools

Add a winning-ads view to your own product: rank ads by winning_score without storing a history yourself.

Agency pitches

Show a prospect which ads in their market have lasted for months, and what those ads have in common.

Pricing

The winning signals are free: a call costs 1 credit and returns up to 30 ads with their days_active and winning_score, with or without the filter. Errors are free.

  • 65 free calls every month, no credit card
  • Then $5 per 1,000 calls, pay as you go
  • Only successful calls are billed: errors cost nothing
  • Credits valid for 12 months from purchase; bulk packs from 10,000 credits for $45

See all prices and bulk packs →

Also in the MCP server for AI assistants

The ScrapeAdLibrary MCP server gives Claude, Cursor and other MCP clients the same data as tools: search_ads and get_page_ads. Ask “which of this brand’s ads have been running for more than 60 days?” and the assistant filters and ranks them for you.

Run it with uvx scrapeadlibrary-mcp and your API key in SCRAPEADLIBRARY_API_KEY; the MCP server guide has the configuration for each client. Tool calls are billed like API calls.

Winning Facebook Ads API: FAQ

What is a winning Facebook ad?
An ad that keeps running. Advertisers switch off what does not pay back within days or weeks, so an ad that has been live for months, often in several versions, is very likely profitable. The Ad Library does not publish spend or results for commercial ads, so longevity is the strongest public signal.
How is winning_score calculated?
From days_active (70 points, full at 90 days), variants_count (15 points, full at 10 versions) and the EU reach when the ad detail has it (15 points, full at one million people). Without the reach the first two parts are scaled to 100, so a missing reach never lowers the score. The exact formula is on this page and in the API reference.
Does the filter cost extra credits?
No. days_active and winning_score are computed from fields every ad already has, and min_days_active and sort=longevity are applied to the page we fetch: a call costs 1 credit as usual, even when the filter leaves fewer ads.
Why can a filtered call return fewer ads than limit?
The Ad Library cannot filter or sort by age, so min_days_active and sort=longevity work on the ads of the returned page. When has_more is true, follow next_cursor to look at the next page of ads.
Does it work for Instagram ads?
Yes: every ad in the Meta Ad Library has a start date, whatever the platform. Add platforms=instagram to look only at ads that ran on Instagram.

The long-running ads of any market, as JSON

Create a free account and look for the winning ads of your niche. 65 free calls every month.