Facebook Ad Library API on GitHub: The Repos That Matter, Checked One by One

Facebook Ad Library API GitHub repos checked one by one: Meta's script repo, Python scrapers and MCP servers, last commits, what they do and where they break.

The short answer

The best-known Facebook Ad Library API GitHub repo is Meta's own Ad-Library-API-Script-Repository (349 stars, last commit February 2025, hardcoded to Graph API v14.0). The rest split into official-API clients that inherit its EU-only rule for commercial ads, scrapers that use internal Meta endpoints and break when they change, and MCP servers that wrap one or the other. None returns spend, a winner signal or transcripts; the Ad Radar Data API does, over REST and MCP.

In this article8 sections

The short answer

Search "facebook ad library api github" and you land on a few dozen repos that do one of three things: call Meta's official ads_archive API, scrape the public web Library, or wrap either one in an MCP server for Claude and other agents. We opened the ones that matter in November 2026 and recorded their stars, their last push, what they do and where they break.

The pattern is consistent. Official-API clients are stable but inherit Meta's coverage rule, so they return nothing for US-only commercial ads. Scrapers cover those ads but depend on internal endpoints that change without notice. And every repo, whatever its method, returns raw ads: no spend for commercial ads, no winner signal, no transcripts, no tags. At the end there is a ready-made alternative with a short code example.

349

stars on Meta's official script repo

Feb 2025

its last commit

v14.0

the Graph API version its client defaults to

2,761

ranked winning Meta ads in the Ad Radar Data API

Facebook Ad Library API GitHub repos, at a glance

Stars and last push are from the GitHub API on November 19, 2026.

RepoStarsLast pushMethodWhat it does
facebookresearch/Ad-Library-API-Script-Repository349Feb 2025Official APIMeta's Python scripts and CLI for ads_archive
facebookresearch/Radlibrary73Jan 2024, archivedOfficial APIR package for the Ad Library API
minimaxir/facebook-ad-library-scraper147Nov 2019Official APIPython script for political ads to three clean CSVs
Paularossi/AdDownloader37Jul 2026Official APIPython package and CLI that downloads ads and their media
promisingcoder/MetaAdsCollector112Nov 2026Internal web endpointspip package, CLI and MCP server, no API key
athm793/meta-ads-scraper65Aug 2026Headless browserSelf-hosted research tool with a SQLite swipe file
proxy-intell/facebook-ads-library-mcp331Nov 2026ScrapeCreators APIMCP server with Gemini video analysis
RamsesAguirre777/facebook-ads-library-mcp302Aug 2026Headless browserTwo-tool MCP server that parses Library cards
thenavidm/facebook-ad-library-mcp-cli14Nov 2026MCP and CLIAd Library tools for Claude Code and Codex

Stars measure attention, not reliability. Two of the four most-starred official-API repos haven't been touched in years.

Official API clients

These repos call https://graph.facebook.com/<version>/ads_archive with your access token. You need a confirmed identity and a Meta developer app first; the setup is in our Meta Ad Library API guide.

facebookresearch/Ad-Library-API-Script-Repository

This is Meta's own repo, and the one most tutorials point to. It is a set of Python scripts plus a CLI. The README's example:

python fb_ads_library_api_cli.py -t {access_token} \
  -f 'page_id,ad_snapshot_url,funding_entity,ad_delivery_start_time' \
  -c 'CA' -s '.' -v count

The CLI has four actions: count, save, save_to_csv and start_time_trending, with flags for fields, country, search term, Page IDs, active status, start date, batch size and retries.

Where it breaks:

  • Stale version. The client class sets default_api_version = "v14.0", a Graph API version from 2022, and the CLI has no flag to change it. To use a current version you edit the source.
  • Slow maintenance. The last commit is from February 2025, and 22 issues are open, including "Meta Ad Library API does not return any ad for some page and also not return same data as it shows on ads library" (May 2024) and "Ads do not show with link provided by ad_snapshot_url" (January 2025).
  • The coverage rule. Meta's ads_archive reference says: "Ads that did not reach any location in the EU will only return if they are about social issues, elections or politics." No code change fixes that.

Read it to learn the API. For production code, the 60-line client in our Facebook Ad Library API with Python tutorial is easier to keep current.

Radlibrary and minimaxir/facebook-ad-library-scraper

Radlibrary is Meta's R package for the same API, archived since January 2024. minimaxir/facebook-ad-library-scraper, by Max Woolf, is a clean Python script that writes fb_ads.csv plus demographic and region breakdowns, built for political ads; its last push was in 2019. Both are good references for how the data is shaped. Neither is something to build on in 2026.

Paularossi/AdDownloader

AdDownloader is the most complete official-API package still maintained: a Python library and CLI that queries the API, downloads each ad's images and videos, and adds analysis on top, with an accompanying paper in SoftwareX. Its issue history shows the weak spot of any media pipeline built on the Library: "Missing images & videos" (November 2024) and "No media were downloaded for every ad in the search" (January 2026), each followed by a fix release. Media extraction breaks whenever Meta changes how the ad snapshot renders.

Scrapers of the web Library

Scrapers exist because of the coverage rule: the web Library shows US commercial ads that the API won't return. The price is fragility.

promisingcoder/MetaAdsCollector is the most active, with a PyPI package (meta-ads-collector), a CLI that writes CSV, JSON or JSONL, and an MCP extra with background jobs. Its README is direct about the risk: "MetaAdsCollector uses internal Meta endpoints. Meta can change or restrict access, so network, proxy, verification, or rate-limit failures can occur. An empty query result does not establish that no matching ads exist."

athm793/meta-ads-scraper drives a headless Playwright browser against the public Library and stores everything in a local SQLite file, with keyword and advertiser search, filters and a swipe file. It is a full local app, which means it is also a full local app to keep running.

That last sentence from MetaAdsCollector is the honest summary of every scraper: when it returns nothing, you can't tell whether there were no ads or the scraper broke.

MCP servers

MCP servers let Claude, ChatGPT or Cursor query the Library directly. They wrap one of the two methods above, so they inherit its limits.

  • proxy-intell/facebook-ads-library-mcp, MIT licensed, has tools such as get_meta_platform_id, get_meta_ads, analyze_ad_image and analyze_ad_video. It doesn't scrape on its own: you bring a ScrapeCreators key, which its README prices at "about $1.88 per 1,000 calls," and a Gemini key for video analysis. The README also discloses an anonymous usage ping on each tool call (turn it off with PROXY_TELEMETRY=0) and periodic tips promoting the maintainers' hosted version.
  • RamsesAguirre777/facebook-ads-library-mcp has two tools, search_ad_library and scrape_ad_library_url, and renders the Library page in a headless browser. Its README notes the first paint is "only ~20–26 cards" and more need extra scroll rounds of 2.5 seconds each.
  • MetaAdsCollector and thenavidm/facebook-ad-library-mcp-cli add MCP on top of their own collectors.

An agent connected to any of these gets raw cards and has to guess which ads matter. Ask it for "the best-performing ads in this niche" and it can only rank by what the Library shows: start dates and ad counts.

Where every GitHub tool breaks

FailureWho it hitsWhat you see
EU-only rule for commercial adsEvery official-API clientEmpty results for US-only brands
Internal endpoint or page changesEvery scraper and scraper-based MCPEmpty or half-filled results, with no error
Throttling and login checksScrapers at volumeTimeouts, login walls, proxy bills
Expiring media URLsEveryoneVideo links that stop working, missing media
One maintainerMost reposFixes arrive when that person has time, or never
No spend, winner signal, transcripts or tagsEvery repoA pile of raw ads you still have to rank

The last row is the one no pull request will fix. Meta doesn't publish spend for commercial ads, the Library has no notion of a winner, and transcripts and tags have to be produced by your own pipeline: daily snapshots, media storage, speech-to-text, a spend model, a tagging pass. That is months of work, laid out in how to build an ad spy tool, and the history you didn't record can't be recovered later.

A ready-made alternative: the Ad Radar Data API

The Ad Radar Facebook ads API is what these repos would become after that pipeline was built and run every day: the best database of winning Meta ads, over REST and MCP. 2,761 Meta ads with $50k+ estimated spend from 734 brands, Facebook and Instagram, built from the public Meta Ad Library and refreshed daily. US commercial brands included.

Every ad has brand, headline, body, CTA, the full video transcript, spendEstimate (estimated spend in USD, from the ad's public engagement), metrics.score and tier (winner = top 10% by score and live 21+ days, or rising), days running, variants, tags on ten dimensions (hook pattern, hook mechanism, narrative angle, awareness, proof level, production format, video type, landing page type, niche, CTA type) and public poster and video URLs.

The code: 15 lines instead of a repo

import os
import requests

r = requests.get(
    "https://app.ad-radar.dev/api/v1/ads/search",
    params={"q": "skillet", "tier": "winner", "format": "video",
            "sort": "spend", "limit": 20},
    headers={"Authorization": f"Bearer {os.environ['AD_RADAR_KEY']}"},
    timeout=30,
)
r.raise_for_status()
for ad in r.json()["data"]:
    tags = ", ".join(t["label"] for t in ad["tags"][:3])
    print(f"${ad['spendEstimate']:,}  {ad['brand']}  [{tags}]")
    print("   ", (ad.get("transcript") or "")[:100])

q searches headline, body, brand and transcript, so you can find ads by what is said in the video. Results are cursor-paginated (pagination.nextCursor), up to 100 per page, and one page is one request. The OpenAPI 3.1 spec is at https://app.ad-radar.dev/api/v1/openapi.json, so you can generate a typed client instead of maintaining one. Every endpoint and parameter is in the API reference.

The MCP server: one command

claude mcp add --transport http ad-radar \
  https://app.ad-radar.dev/api/mcp \
  --header "Authorization: Bearer $AD_RADAR_KEY"

It is hosted, so there is nothing to clone, no headless browser and no third-party scraping key. The tools are search_ads, get_ad, winning_patterns, advertiser_hooks, get_swipe_prompt and list_taxonomy, and each tool call counts as one request. Setup for Claude Desktop, claude.ai and ChatGPT is on the MCP page.

GitHub repos vs the Data API

Official API reposScraper and MCP reposAd Radar Data API
US commercial adsNoYes, while the scraper worksYes
Only ads that are workingNoNoYes, $50k+ estimated spend
SpendPolitical ads onlyNoEstimated, on every ad
TranscriptsNoNo, or a paid add-onFull script, searchable
TagsNoNoTen dimensions
MaintenanceYou, on a stale clientYou, every time Meta changesNone on your side
Plan (billed every 4 weeks)PriceRequestsWhat you get
Builder$29910,000REST and MCP, use inside your product and show the data to your users, the web app included
Scale$79950,000Everything in Builder, plus /feed for incremental sync and a higher rate limit
ResellerFrom $2,000CustomFull NDJSON /export, resale and white-label, by request

Over quota you get a 429 with an upgrade link, never an overage charge. All plans are on the pricing table.

The verdict

The Facebook Ad Library API repos on GitHub are worth reading: Meta's script repository teaches the API, AdDownloader and MetaAdsCollector show what a working collector looks like in 2026. But each one hands you raw ads and a maintenance job. The official clients can't see US commercial ads, the scrapers break when Meta changes its endpoints, and none of them knows which ads are winning.

The Ad Radar Data API gives you the finished result: ranked winners with estimated spend, transcripts and tags, in one REST call or one MCP tool call. Start on Builder at $299 every 4 weeks and step up to Scale for the incremental feed. If you'd rather browse than code, the same winners are in the Ad Radar app. For the broader landscape of scrapers, see our Facebook Ad Library scraper roundup.

Figures marked as estimated spend come from Ad Radar's model of engagement on public Meta Ad Library ads. They are estimates, labeled as such, and are best used to rank ads against each other. How the board is built.

FAQ

Questions

Is there an official Facebook Ad Library API repo on GitHub?

Yes. Meta's research team publishes facebookresearch/Ad-Library-API-Script-Repository: Python scripts and a CLI (fb_ads_library_api_cli.py) with count, save, save_to_csv and start_time_trending actions. As of November 2026 it has 349 stars, its last commit is from February 2025, it has 22 open issues and its client defaults to Graph API v14.0.

Is there a Facebook Ad Library MCP server on GitHub?

Several. proxy-intell/facebook-ads-library-mcp (about 330 stars) calls the ScrapeCreators API, which its README prices at about $1.88 per 1,000 calls, and uses Gemini for video analysis. RamsesAguirre777/facebook-ads-library-mcp (about 300 stars) drives a headless browser through the public Library. promisingcoder/MetaAdsCollector ships an MCP extra. The Ad Radar Data API has a hosted MCP server that returns ranked winners.

Why does the official API return no ads for US brands?

Meta's ads_archive reference says ads that did not reach any location in the EU only return if they are about social issues, elections or politics. So every GitHub client of the official API, including Meta's own script repository, returns nothing for a US-only commercial ad, even though the ad is visible in the web Library.

Which GitHub Facebook Ad Library scraper works without an API key?

promisingcoder/MetaAdsCollector (Python, CLI and MCP, updated November 2026), athm793/meta-ads-scraper (TypeScript and Playwright, self-hosted with SQLite) and RamsesAguirre777/facebook-ads-library-mcp all read the public web Library without a Meta token. MetaAdsCollector's own README warns that it uses internal Meta endpoints that Meta can change or restrict.

Can I get ad spend from a GitHub Ad Library tool?

Only for political and issue ads, which Meta publishes as ranges. For commercial ads no repo can return spend because Meta doesn't publish it. The Ad Radar Data API returns an estimated spend in US dollars on every ad, along with the full video transcript and tags on ten dimensions.

Ad data and APIs

Keep reading

All 22 articles in Ad data and APIs

Build on ads that are already winning.

Skip the scraping, storage, transcription and tagging. Query the corpus from your code or your agent.

Builder: 10,000 requests every 4 weeks over REST and MCP, $299. Scale and Reseller for bigger volumes.