Meta (Facebook) Ad Library Scraper avatar

Meta (Facebook) Ad Library Scraper

Pricing

from $0.20 / 1,000 results

Go to Apify Store
Meta (Facebook) Ad Library Scraper

Meta (Facebook) Ad Library Scraper

Scrape the Meta Ad Library by keyword, Facebook Page ID, Ad ID, or direct Ad Library URL. Extract ad copy, CTA, links, images, videos, campaign dates, and other structured data from Facebook and Instagram ads.

Pricing

from $0.20 / 1,000 results

Rating

0.0

(0)

Developer

Mikolabs

Mikolabs

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

3 days ago

Last modified

Share

Meta (Facebook) Ad Library Scraper — Facebook & Instagram Ads Extractor by Mikolabs

Scrape the Meta Ad Library (Facebook Ad Library) at scale. Extract ad copy, images, video URLs, advertiser details, and creative data from Facebook and Instagram ads — no Meta account, no API key, no approval process required. Export to JSON, CSV, or Excel in minutes.

What does Meta (Facebook) Ad Library Scraper do?

Meta (Facebook) Ad Library Scraper by Mikolabs extracts structured ad data from Meta's public Ad Library. Point it at a keyword, a Facebook Page ID, a specific Ad ID, or a raw Ad Library URL, and it returns clean, structured records — ad creative body, image and video URLs, advertiser name, CTA text and links, platform reach, and delivery dates.

Use it to research competitor Facebook and Instagram ads, monitor brand advertising trends, build ad intelligence datasets, or feed structured ad data into AI/analytics pipelines — all without a Facebook account or Meta developer approval.

Unlike the official Meta Ad Library API (limited to political/issue ads in the EU, gated behind identity verification and a 200 requests/hour cap), this scraper works on any public ad, targeted at any country, with no account required.

Two ways to run it

Option A — Direct URLs

Paste one or more complete Facebook Ad Library URLs (from facebook.com/ads/library) into startUrls. When this field is filled, every other parameter is ignored and the scraper runs exactly what you searched for in your browser.

Option B — Auto-build from parameters

Leave startUrls empty and instead supply:

  • Search Keywords (searchQueries) — e.g. "nike", "running shoes"
  • Facebook Page IDs (pageIds) — numeric IDs to pull every ad from a specific brand page
  • Specific Ad IDs (adIds) — target individual ads directly

Each keyword, Page ID, or Ad ID you provide is launched as its own search and run concurrently (controlled by maxConcurrency), so you can batch dozens of brands or keywords in a single actor run.

What data can you extract?

Every ad result includes the following structured fields:

FieldDescription
libraryIDAd Archive ID — unique identifier for historical lookup
brandAdvertiser page name
industryAdvertiser industry/category, when available
activeWhether the ad is currently running (true/false)
platformsWhere the ad runs — facebook, instagram, messenger, audience_network
totalPlatformsNumber of platforms the ad runs on
similarAdCountNumber of creative variants in the same ad group
multipleVersionstrue if the ad has multiple creative variants
bodyFull ad copy / creative text
linkTitleHeadline of the link card
linkUrlDestination URL from the ad
linkDescriptionCaption / description from the link card
ctaTextCall-to-action button text (e.g. "Shop Now", "Install Now")
ctaUrlCTA destination URL
imagesDirect URLs to all ad image creatives
videosDirect URLs to all ad video creatives
startDateAd delivery start date (Unix timestamp)
endDateAd delivery end date, or empty if still active
formatCreative format — video, image, or unknown

Filters & targeting

ParameterDescription
countryISO 2-letter country code for ad targeting (e.g. US, GB, IN) — required in Option B
activeStatusactive, inactive, or all
adTypeall, political_and_issue_ads, housing, employment, or credit
mediaTypeall, image, video, or meme
isTargetedCountryIf true, only returns ads that specifically target your chosen country
contentLanguagesRestrict results to specific languages (e.g. en, es, it)
sortModeSort by total_impressions (reach), relevance, or start_date
sortDirectiondesc (highest first) or asc

How to scrape the Meta Ad Library

Option A: Paste a Facebook Ad Library URL

  1. Visit facebook.com/ads/library and search with your desired filters (keyword, brand, or view_all_page_id=... for a specific page)
  2. Copy the URL from your browser address bar
  3. Paste it into Facebook Ad Library URLs (Direct) (startUrls) — you can add more than one
  4. Click Start

Option B: Build the search from parameters

  1. Open Meta (Facebook) Ad Library Scraper on Apify and click Try for free
  2. Enter your Target Country (country)
  3. Add one or more Search Keywords, Facebook Page IDs, or Specific Ad IDs
  4. Apply filters — ad status, ad category, media type, languages, sort order
  5. Set Maximum Ads to Scrape (maxItems)
  6. Click Start
  7. When the run finishes, click Export to download JSON, CSV, or Excel

Input example

{
"country": "US",
"searchQueries": ["nike"],
"activeStatus": "active",
"adType": "all",
"mediaType": "all",
"isTargetedCountry": false,
"sortMode": "total_impressions",
"sortDirection": "desc",
"maxItems": 100,
"maxConcurrency": 1,
"requestHandlerTimeoutSecs": 900,
"proxyConfiguration": {
"useApifyProxy": true,
"apifyProxyGroups": ["RESIDENTIAL"]
}
}

Output example

Each result is a clean, flat ad object ready for analysis:

{
"libraryID": "971661872066048",
"brand": "H&M",
"industry": "",
"active": true,
"platforms": [],
"totalPlatforms": 0,
"similarAdCount": 2,
"multipleVersions": true,
"body": "{{product.brand}}",
"linkTitle": "{{product.name}}",
"linkUrl": "http://itunes.apple.com/app/id834465911",
"linkDescription": "itunes.apple.com",
"ctaText": "Install now",
"ctaUrl": "http://itunes.apple.com/app/id834465911",
"images": [],
"videos": [],
"startDate": "1777273200",
"endDate": "1785913200",
"format": "unknown"
}

You can download the full dataset in JSON, CSV, Excel, or HTML directly from the Apify Console, or fetch it programmatically via the API.

Pricing

This actor is pay-per-result — just $0.20 per 1,000 ads scraped, with no actor start fee. You only pay for the results you actually get. The Apify Free plan includes monthly platform credits, which is enough to scrape thousands of ads at no extra cost.

How to use the API

Run this scraper programmatically to feed Meta ad data into your own apps, dashboards, or automation pipelines.

Python

from apify_client import ApifyClient
client = ApifyClient("YOUR_APIFY_API_TOKEN")
run_input = {
"country": "US",
"searchQueries": ["nike", "adidas"],
"activeStatus": "active",
"maxItems": 200,
"proxyConfiguration": {
"useApifyProxy": True,
"apifyProxyGroups": ["RESIDENTIAL"]
},
}
run = client.actor("mikolabs/meta-ads").call(run_input=run_input)
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
print(item)

JavaScript / Node.js

import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: 'YOUR_APIFY_API_TOKEN' });
const input = {
country: 'US',
searchQueries: ['nike', 'adidas'],
activeStatus: 'active',
maxItems: 200,
proxyConfiguration: { useApifyProxy: true, apifyProxyGroups: ['RESIDENTIAL'] },
};
const run = await client.actor('mikolabs/meta-ads').call(input);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);

For the full API reference, see the API tab on this actor's page.

Advanced settings

SettingDescription
maxItemsMaximum number of ads to collect. Stops immediately when reached (default: 30, minimum: 1)
maxConcurrencyNumber of parallel browser tabs (1–10). We recommend 1–2 for best stability
requestHandlerTimeoutSecsMax seconds allowed to scroll a single URL before moving on (default: 900 / 15 min, handles lists with thousands of ads)
proxyConfigurationResidential proxy config — required to reliably bypass Facebook's anti-scraping measures

Why use this instead of the official Meta Ad Library API?

FeatureMikolabs Meta (Facebook) Ad Library ScraperOfficial Meta Ad Library API
Ad typesAll ads — commercial, political, housing, employment, creditPolitical/issue ads only
CountriesAny country you targetLimited coverage, EU-focused for political ads
Rate limitNo hard limit200 calls/hour
Approval requiredNoYes — identity verification required
Meta account neededNot requiredRequired
Creative dataFull — images, videos, ad copy, CTA, linksLimited
Export formatsJSON, CSV, Excel, HTMLJSON only
Input flexibilityDirect URL, keyword, Page ID, or Ad IDQuery parameters only

Use cases

  • Competitor ad research — see exactly what creatives, copy, and landing pages competitors run on Facebook and Instagram
  • Facebook & Instagram ad spy tool — monitor any brand's Meta advertising activity without manual browsing
  • Market research — surface ad copy trends, creative formats, and messaging patterns by keyword, industry, or country
  • Ad creative inspiration — browse top-performing ads by keyword, niche, or brand
  • eCommerce & dropshipping research — find products being advertised heavily on Facebook and Instagram
  • Lead generation — identify actively advertising businesses in any niche or market
  • Political ad monitoring — track political and issue-based ads for journalism or compliance
  • Brand monitoring — track how brands present themselves across paid channels on Meta
  • AI training data — feed structured ad creative data into models for analysis or classification
  • Marketing analytics — build dashboards tracking competitor ad activity and creative rotation over time

FAQ

Do I need a Facebook account or Meta API key? No. The Meta Ad Library is publicly accessible without login. This scraper requires no Facebook credentials, Meta API keys, access tokens, or approval process.

What proxy should I use? A residential proxy is required for reliable scraping — Facebook blocks datacenter IPs. The default proxyConfiguration uses Apify's Residential Proxy group, which works reliably for most use cases.

Can I scrape ads from multiple countries at once? Yes. Run separate searches per country by setting country and re-running, or queue multiple direct URLs targeting different countries in startUrls.

Can I scrape Instagram ads? Yes. The Meta Ad Library includes ads running across Meta platforms — Facebook, Instagram, Messenger, and Audience Network. Instagram ads appear with "instagram" in the platforms field.

Can I target a specific brand directly? Yes. Provide the brand's numeric Facebook Page ID in pageIds, or paste a Page's Ad Library URL (containing view_all_page_id=...) into startUrls.

Can I look up one specific ad? Yes. Provide its numeric ID in adIds to fetch that ad directly.

What if the run is interrupted mid-scrape? Data is not lost — any ads already collected before the interruption remain available in the run's default dataset.

How many ads can I scrape per run? There's no hard cap. Set maxItems to any value; actual throughput depends on proxy quality, maxConcurrency, and Facebook's own rate limiting.

Can I use this as an unofficial Meta Ads API? Yes. Run this scraper programmatically via the Apify API and get structured ad data back in JSON — without the account, approval, and rate-limit restrictions of Meta's official API.

Support

Found a bug, got a feature request, or have a question? Open an issue on the Issues tab on this actor's page.

Built by Mikolabs — fast, reliable, production-ready Apify actors for data extraction at scale.