meta-ad-library-scraper
Scrape Facebook and Instagram ads from Meta's Ad Library by keyword or advertiser page. Extract ad text, headlines, CTAs, links, media URLs, formats, platforms, run dates into one flat row per ad.
Instructions
Meta Ad Library Scraper. Scrape Facebook and Instagram ads from Meta's Ad Library by keyword or advertiser page: ad text, headline, call to action, link, image and video URLs, format, platforms and run dates. One flat row per ad, with a hard cap. Export data, run via API, schedule runs.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "meta-ad-library-scraper"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| adType | No | 🗳️ Ad type — All ads, or only the political and social-issue shelf. Meta publishes spend, impressions and reach for that shelf and for nothing else, so the spend, impressionsText and reachEstimate columns only carry numbers here. | all |
| maxAds | No | 💯 Maximum ads — Hard cap for the whole run. It is checked before every request, so the run stops at this number and never bills you past it. | |
| country | No | 🌍 Country — Two-letter country code of the audience the ads were shown to, for example US, GB, DE. Meta indexes ads per country, so this changes which ads exist, not just how they are filtered. | US |
| endDate | No | 📅 Ads started before — Only ads that began running on or before this date, as YYYY-MM-DD. | |
| pageIds | No | 📄 Facebook page IDs — Numeric page IDs to pull every ad of one advertiser, instead of searching by keyword. The ID is the number in an ad's Ad Library link, and it is also returned as pageId on every row. | |
| queries | No | 🔍 Search keywords — Words or brand names to search the Ad Library for, one per line. Every ad whose text, advertiser or link matches is returned. | |
| mediaType | No | 🖼️ Media type — Keep only ads of one format. Meta applies this itself, so it changes which ads are fetched and therefore what you pay for. | all |
| platforms | No | 📱 Platforms — Limit to ads shown on particular Meta surfaces. Leave empty for all of them. | |
| startDate | No | 📅 Ads started after — Only ads that began running on or after this date, as YYYY-MM-DD. | |
| activeStatus | No | 🟢 Ad status — Whether to return ads that are still running, ads that have stopped, or both. | active |
| maxAdsPerQuery | No | Maximum ads per keyword or page — Optional per-target cap, so one broad keyword cannot eat the whole run. | |
| proxyConfiguration | No | Proxy — Meta serves the Ad Library to residential addresses only; from a datacentre address it answers with an empty response. Leave this on the default unless you know why you are changing it. |