Facebook Ads Library Scraper — Competitor Ad Intelligence avatar

Facebook Ads Library Scraper — Competitor Ad Intelligence

Pricing

Pay per usage

Go to Apify Store
Facebook Ads Library Scraper — Competitor Ad Intelligence

Facebook Ads Library Scraper — Competitor Ad Intelligence

Facebook Ads Library scraper — extract competitor ads, ad creatives, spend data, and advertiser info. Ad scraper for marketing intelligence. No login needed. Pay per result: $0.005/ad. Monitor competitor ads across Facebook, Instagram, Messenger.

Pricing

Pay per usage

Rating

0.0

(0)

Developer

Web Data Labs

Web Data Labs

Maintained by Community

Actor stats

0

Bookmarked

15

Total users

9

Monthly active users

2 hours ago

Last modified

Share

Facebook Ads Library Scraper

Extract ads from Meta's public Facebook Ad Library at scale using browser automation. No Facebook account, no API token, no developer approval required.

Search any keyword across 6 countries and get structured ad data — advertiser names, ad copy, date ranges, platform targeting, status, and direct library links. Perfect for competitive intelligence, market research, and ad monitoring workflows.

Key Features

  • No authentication needed — scrapes the publicly available Facebook Ad Library directly
  • Structured output — clean JSON with advertiser info, ad copy, dates, platforms, and status
  • Multi-country support — search ads in the US, UK, Australia, Canada, Germany, and France
  • Up to 200 ads per run — collect large datasets with a single API call
  • Automatic cookie/consent handling — no manual intervention required
  • Debug screenshots — built-in diagnostics to troubleshoot extraction issues
  • Pay-per-result pricing — only pay for ads successfully extracted

Use Cases

1. Competitive Ad Intelligence

Monitor what ads your competitors are running across Facebook and Instagram. Track their messaging changes, promotional offers, and seasonal campaigns to stay ahead.

2. Market Research & Trend Analysis

Discover advertising trends in any industry by searching relevant keywords. Identify common value propositions, pricing strategies, and calls-to-action across hundreds of advertisers.

3. Ad Creative Swipe File

Build a curated library of high-performing ad copy and creative formats. Search by product category or brand to collect proven messaging frameworks for your own campaigns.

4. Political Ad Monitoring

Track political advertising spend and messaging. The Facebook Ad Library includes all political and issue ads — monitor campaign messaging, spending patterns, and targeting across regions.

5. Brand Protection & Compliance

Detect unauthorized use of your brand name in Facebook ads. Set up regular scrapes to catch trademark infringement, misleading claims, or counterfeit product advertising.

6. Agency Pitch Preparation

Research a prospect's current ad strategy before pitching. Show them exactly what their competitors are doing and identify gaps in their advertising approach.

7. Academic & Journalism Research

Study advertising practices across industries for research papers, investigative journalism, or regulatory analysis. Export structured data for statistical analysis.

8. E-commerce Competitor Tracking

Monitor competitor product launches, sales events, and promotional strategies by tracking their Facebook and Instagram ad activity in real-time.

Input Parameters

ParameterTypeRequiredDefaultDescription
searchTermsstringNo"shopify"Keywords to search for in the Ad Library. Supports brand names, product categories, or any search phrase.
countrystringNo"US"Country where ads are shown. Options: US (United States), GB (United Kingdom), AU (Australia), CA (Canada), DE (Germany), FR (France).
maxAdsintegerNo5Maximum number of ads to collect per run. Range: 1–200. Higher values require more scrolling and may take longer.

Input Example

{
"searchTerms": "meal kit delivery",
"country": "US",
"maxAds": 50
}

Output Format

Each successfully extracted ad produces a JSON object with the following fields:

FieldTypeDescription
advertiserNamestringName of the business or page running the ad
advertiserUrlstringLink to the advertiser's Facebook page
adTextstringThe primary ad copy / creative text
libraryIdstringUnique Facebook Ad Library ID for the ad
dateRangestringActive period (e.g., "Mar 10, 2026 - Mar 28, 2026")
statusstringActive or Inactive
platformsstringWhere the ad runs — Facebook, Instagram, Messenger, Audience Network
snapshotUrlstringDirect URL to the ad snapshot in the Ad Library
rawTextPreviewstringFirst 600 characters of the raw card text (for debugging)
countrystringCountry code used for the search
searchTermsstringKeywords used in the search
scrapedAtstringISO 8601 timestamp of when the data was collected

Sample Output

{
"advertiserName": "HelloFresh",
"advertiserUrl": "https://www.facebook.com/HelloFresh",
"adText": "Get 16 FREE meals + first box ships free! America's #1 meal kit.",
"libraryId": "987654321",
"dateRange": "Mar 10, 2026 - Mar 28, 2026",
"status": "Active",
"platforms": "Facebook, Instagram",
"snapshotUrl": "https://www.facebook.com/ads/library/?id=987654321",
"rawTextPreview": "HelloFresh · Active · Library ID: 987654321 ...",
"country": "US",
"searchTerms": "meal kit delivery",
"scrapedAt": "2026-03-28T12:00:00.000Z"
}

Code Examples

Python

from apify_client import ApifyClient
client = ApifyClient("YOUR_API_TOKEN")
run = client.actor("cryptosignals/facebook-ads-library-scraper").call(run_input={
"searchTerms": "project management software",
"country": "US",
"maxAds": 30,
})
for ad in client.dataset(run["defaultDatasetId"]).iterate_items():
print(f"[{ad['status']}] {ad['advertiserName']}: {ad['adText'][:80]}...")
print(f" Platforms: {ad['platforms']} | Library ID: {ad['libraryId']}")
print()

Compare ads across countries:

from apify_client import ApifyClient
client = ApifyClient("YOUR_API_TOKEN")
for country in ["US", "GB", "DE"]:
run = client.actor("cryptosignals/facebook-ads-library-scraper").call(run_input={
"searchTerms": "CRM software",
"country": country,
"maxAds": 10,
})
ads = list(client.dataset(run["defaultDatasetId"]).iterate_items())
print(f"\n{country}: {len(ads)} ads found")
for ad in ads[:3]:
print(f" - {ad['advertiserName']}: {ad['adText'][:60]}...")

Node.js

import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: 'YOUR_API_TOKEN' });
const run = await client.actor('cryptosignals/facebook-ads-library-scraper').call({
searchTerms: 'project management software',
country: 'US',
maxAds: 30,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
for (const ad of items) {
console.log(`[${ad.status}] ${ad.advertiserName}: ${ad.adText?.slice(0, 80)}...`);
console.log(` Platforms: ${ad.platforms} | Library ID: ${ad.libraryId}`);
}

cURL (Apify API)

Start a run:

curl -X POST "https://api.apify.com/v2/acts/cryptosignals~facebook-ads-library-scraper/runs?token=YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"searchTerms": "meal kit delivery",
"country": "US",
"maxAds": 20
}'

Fetch results (replace DATASET_ID from the run response):

$curl "https://api.apify.com/v2/datasets/DATASET_ID/items?token=YOUR_API_TOKEN&format=json"

Integrations

Connect this scraper to 5,000+ apps via Apify's built-in integrations:

  • Zapier — trigger workflows when new ads are found
  • Make (Integromat) — build automated competitive monitoring pipelines
  • Google Sheets — export ad data directly to spreadsheets for team analysis
  • Slack / Email — get alerts when competitors launch new campaigns
  • Webhooks — send results to any HTTP endpoint in real-time
  • Amazon S3 / Google Cloud Storage — archive ad data for long-term analysis

Pricing

This actor uses pay-per-result pricing. You only pay for ads successfully extracted — no charge for failed runs or empty results.

TierEstimated Cost
1–50 ads~$0.50–$2.50 (depending on platform compute)
100 ads~$3–$5
200 ads (max per run)~$5–$10

Costs include Apify platform compute time. Using residential proxies (recommended for reliability) adds to the total. Check the Apify pricing calculator for exact estimates based on your usage.

Free tier available: Apify's free plan includes $5/month in platform credits — enough to test the scraper with smaller runs.

How It Works

  1. Opens the Facebook Ads Library in a headless Chromium browser via Playwright
  2. Searches for your keywords in the specified country
  3. Handles cookie consent dialogs automatically
  4. Scrolls through results to load ad cards dynamically
  5. Extracts structured data from each ad card in the DOM
  6. Charges per result and pushes data to the Apify dataset

No login, no API token, no rate-limited official API — browser-based scraping of the publicly available Ad Library.

Tips for Best Results

  • Use residential proxies — Facebook actively blocks datacenter IPs. Residential proxies are essential for reliable extraction. We recommend configuring Apify's residential proxy group.
  • Keep batch sizes reasonable — 20–50 ads per run is the sweet spot for reliability. Larger batches (100–200) work but may encounter more loading issues.
  • Check the debug screenshot — every run saves a debug-screenshot.png to the key-value store, useful for diagnosing extraction problems.
  • Be specific with search terms — more specific queries (e.g., "organic meal kit subscription") return more relevant results than broad terms.
  • Schedule recurring runs — set up daily or weekly runs via Apify Schedules to build a historical ad database over time.

Frequently Asked Questions

Do I need a Facebook account to use this scraper?

No. The Facebook Ad Library is publicly accessible. This scraper requires no login, no API key, and no Facebook developer account.

How many ads can I extract per run?

Up to 200 ads per run. For larger datasets, schedule multiple runs with different search terms or countries.

What countries are supported?

Currently: United States (US), United Kingdom (GB), Australia (AU), Canada (CA), Germany (DE), and France (FR). More countries can be added on request.

Why are some runs returning zero results?

Facebook may block requests from datacenter IPs. Ensure you're using residential proxies. Also check the debug-screenshot.png in the run's key-value store for visual diagnostics.

Can I scrape ads from a specific advertiser?

Yes — use the advertiser's name as your searchTerms input. For example, set searchTerms to "Nike" to find all active Nike ads.

How often does the Ad Library update?

Facebook updates the Ad Library in near real-time. New ads typically appear within hours of going live. Schedule regular runs to catch new campaigns quickly.

Can I export results to CSV or Excel?

Yes. Apify datasets support export to JSON, CSV, Excel, XML, and RSS formats. Use the dataset export buttons in the Apify console or append ?format=csv to the API endpoint.

Is this scraper compliant with Facebook's terms of service?

The Facebook Ad Library is a public transparency tool required by regulation. This scraper accesses only publicly available data. Users are responsible for ensuring their use case complies with applicable laws and platform policies.

How do I handle rate limiting or CAPTCHAs?

Use residential proxies and keep maxAds at reasonable levels (20–50 per run). If you encounter CAPTCHAs frequently, try spacing runs apart or reducing batch size.

Can I monitor specific keywords automatically?

Yes. Use Apify Schedules to run the scraper on a daily, weekly, or custom schedule. Combine with integrations (Slack, email, webhooks) to get notified of new results.

Limitations

  • Maximum 200 ads per run (Facebook lazy-loads content and may stop rendering beyond this)
  • Results depend on Facebook's current page structure — DOM changes may require actor updates
  • Some ads with heavy video or carousel content may have partial text extraction
  • Country selection is limited to 6 countries (US, GB, AU, CA, DE, FR)
  • Political ad spend data is not currently extracted (only ad content and metadata)

Support

Found a bug or have a feature request? Reach out through Apify's messaging system on the actor page, or leave a review with your feedback.