Facebook Ads Library Scraper avatar

Facebook Ads Library Scraper

Pricing

Pay per event

Go to Apify Store
Facebook Ads Library Scraper

Facebook Ads Library Scraper

Scrape Facebook Ad Library by keyword, advertiser, or country. Extract ad creatives, copy, links, images, videos, platforms, spend, and more. Flattened output — ready for spreadsheets. No login required.

Pricing

Pay per event

Rating

0.0

(0)

Developer

Stas Persiianenko

Stas Persiianenko

Maintained by Community

Actor stats

0

Bookmarked

9

Total users

2

Monthly active users

a day ago

Last modified

Categories

Share

Scrape ads from the Facebook Ad Library at scale. Search by keyword, advertiser page URL, or browse by country. Extract ad creatives, copy, destination links, images, videos, spend data, and more — all in a flat, spreadsheet-ready format. No Facebook login required.

What does Facebook Ads Library Scraper do?

This actor searches the Facebook Ad Library and extracts structured data from every ad it finds. It uses a real browser (Playwright) to load the Ad Library page, intercepts the server-side rendered data, and outputs clean, flattened records you can immediately use in spreadsheets, databases, or downstream workflows.

Each search query returns up to 30 ads from the initial page of results. To collect more ads, use multiple search keywords or advertiser page URLs — the actor processes each one separately and combines all results into a single dataset.

Who is Facebook Ads Library Scraper for?

  • Digital marketers — Research competitor ad strategies, discover winning ad creatives, and find inspiration for your own campaigns.
  • Competitive intelligence teams — Monitor what competitors are advertising, how much they spend, and which platforms they target.
  • Brand monitoring professionals — Track unauthorized use of your brand in ads, or monitor how partners represent your brand.
  • Agencies — Audit client competitors' ad presence across Facebook, Instagram, Messenger, and Audience Network.
  • Researchers & journalists — Analyze political advertising, track ad transparency, and study advertising trends at scale.

Why use Facebook Ads Library Scraper?

  • No login required — The Facebook Ad Library is publicly accessible. No Facebook account needed.
  • Structured output — All ad data is flattened into clean rows with consistent field names. Ready for Google Sheets, Excel, Airtable, or any database.
  • Multiple search modes — Search by keyword, advertiser page URL, or both. Filter by country, ad status (active/inactive), and media type.
  • Rich media extraction — Get direct URLs for ad images, videos, and video preview thumbnails.
  • Spend and impressions data — When available, includes estimated spend ranges and impression counts.
  • Platform breakdown — See which platforms each ad runs on (Facebook, Instagram, Messenger, Audience Network).

What data can you extract?

FieldTypeDescription
adArchiveIdstringUnique Ad Library ID
adLibraryUrlstringDirect link to the ad in Ad Library
pageIdstringFacebook page ID of the advertiser
pageNamestringName of the advertiser page
pageUrlstringURL of the advertiser's Facebook page
pageProfilePictureUrlstringAdvertiser's profile picture URL
pageCategoriesarrayCategories of the advertiser page
pageLikeCountnumberNumber of page likes
isActivebooleanWhether the ad is currently running
startDatestringDate the ad started running (YYYY-MM-DD)
endDatestringDate the ad stopped running (YYYY-MM-DD)
platformsarrayPlatforms where the ad runs (facebook, instagram, messenger, audience_network)
bodyTextstringMain ad copy / body text
titlestringAd headline / title
ctaTextstringCall-to-action button text (e.g., "Shop Now")
ctaTypestringCall-to-action type identifier
linkUrlstringDestination URL the ad links to
linkCaptionstringDisplay URL caption
linkDescriptionstringLink description text
displayFormatstringAd format (e.g., "image", "video", "carousel")
imageUrlsarrayDirect URLs to ad images
videoUrlsarrayDirect URLs to ad videos (HD preferred)
videoPreviewUrlsarrayVideo thumbnail/preview image URLs
categoriesarrayAd categories (e.g., "EMPLOYMENT", "HOUSING")
containsAiMediabooleanWhether the ad contains AI-generated media
impressionsstringImpression count text (when available)
spendobjectEstimated spend range (lowerBound, upperBound)
currencystringCurrency code for spend data
gatedTypestringGated content type (if applicable)
collationCountnumberNumber of ad variations in this collation group
cardsCountnumberNumber of carousel cards

How much does it cost to scrape Facebook ads?

Facebook Ads Library Scraper uses pay-per-event pricing. You only pay for what you use — no monthly minimums.

Charge eventPrice (Bronze)Description
Run started$0.005One-time charge per actor run
Ad scraped$0.0005/adPer ad extracted

Volume discounts are available on higher Apify plans:

PlanPer-ad priceDiscount
Free$0.000575
Bronze (Starter)$0.0005Baseline
Silver (Scale)$0.0003922% off
Gold (Business)$0.000340% off
Platinum (Enterprise)$0.000260% off
Diamond (Enterprise+)$0.0001472% off

Example cost: Scraping 30 ads from one search query costs approximately $0.005 + (30 x $0.0005) = $0.02 on the Bronze plan.

How to scrape Facebook ads

  1. Go to Facebook Ads Library Scraper on Apify Store.
  2. Click Try for free to open the actor in Apify Console.
  3. Enter your search keywords (e.g., "running shoes", "shopify") or advertiser page URLs.
  4. Optionally set the country code (default: US), ad status filter, and media type filter.
  5. Click Start and wait for the run to finish.
  6. Download your data as JSON, CSV, Excel, or connect to any integration.

Input parameters

ParameterTypeDefaultDescription
searchQueriesarray of stringsKeywords to search for in the Ad Library
pageUrlsarray of stringsFacebook page URLs to scrape all ads from specific advertisers
countrystring"US"ISO country code (e.g., "US", "GB", "DE") or "ALL" for all countries
activeStatusenum"all"Filter by status: "all", "active", or "inactive"
mediaTypeenum"all"Filter by media: "all", "image_and_meme", or "video"
maxAdsinteger30Max ads per search query (up to 30 per search from the first page)

Tip: You must provide at least one search keyword or advertiser page URL. You can use both — results from all sources are combined into one dataset.

Output example

{
"adArchiveId": "123456789012345",
"adLibraryUrl": "https://www.facebook.com/ads/library/?id=123456789012345",
"pageId": "987654321",
"pageName": "Shopify",
"pageUrl": "https://www.facebook.com/shopify/",
"pageProfilePictureUrl": "https://scontent.xx.fbcdn.net/...",
"pageCategories": ["E-commerce website"],
"pageLikeCount": 4200000,
"isActive": true,
"startDate": "2025-11-15",
"endDate": null,
"platforms": ["facebook", "instagram"],
"bodyText": "Start your online store today. No coding required.",
"title": "Free Trial — Start Selling Online",
"ctaText": "Sign Up",
"ctaType": "SIGN_UP",
"linkUrl": "https://www.shopify.com/free-trial",
"linkCaption": "shopify.com",
"linkDescription": "Try Shopify free for 3 days.",
"displayFormat": "image",
"imageUrls": ["https://scontent.xx.fbcdn.net/..."],
"videoUrls": [],
"videoPreviewUrls": [],
"categories": [],
"containsAiMedia": false,
"impressions": null,
"spend": null,
"currency": "USD",
"gatedType": null,
"collationCount": 1,
"cardsCount": 0
}

Tips for best results

  • Use specific keywords — Broad terms like "shoes" return many results. Try "Nike running shoes" or "Allbirds" for more targeted ads.
  • Search by advertiser page URL — If you know the exact advertiser, use their Facebook page URL for precise results.
  • Combine search modes — Use both keywords and page URLs in a single run to collect ads from multiple angles.
  • Use multiple keywords for more data — Each keyword search returns up to 30 ads. Run 10 related keywords to get up to 300 ads across different queries.
  • Filter by status — Use "active" to see only currently running ads, or "inactive" to study past campaigns.
  • Filter by media type — Use "video" to focus on video ads or "image_and_meme" for static creatives.
  • Check different countries — The same advertiser may run different ads in different markets. Try US, GB, DE, etc.

Integrations

Connect Facebook Ads Library Scraper to your existing tools:

  • Google Sheets — Automatically export scraped ads to a spreadsheet for team review.
  • Slack — Get notifications when new competitor ads are detected.
  • Airtable — Build a competitive ad library with rich media attachments.
  • Zapier / Make / n8n — Trigger downstream workflows when new ads are found.
  • Webhooks — Send results to your own API endpoint for custom processing.
  • Google BigQuery / Snowflake — Load ad data into your data warehouse for analysis.

Example workflows

  • Competitor monitoring: Schedule daily runs with competitor brand names. Compare new ads against previous runs to spot new campaigns.
  • Ad creative research: Search for product categories ("protein powder", "SaaS tools") to build a library of ad inspiration.
  • Brand protection: Search for your brand name to detect unauthorized ads using your trademark.
  • Market research: Compare ad strategies across countries for the same advertiser.

Using the Apify API

You can start and retrieve results programmatically using the Apify API.

Node.js

import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: 'YOUR_API_TOKEN' });
const run = await client.actor('automation-lab/facebook-ads-library').call({
searchQueries: ['shopify'],
country: 'US',
maxAds: 30,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);

Python

from apify_client import ApifyClient
client = ApifyClient('YOUR_API_TOKEN')
run = client.actor('automation-lab/facebook-ads-library').call(run_input={
'searchQueries': ['shopify'],
'country': 'US',
'maxAds': 30,
})
items = client.dataset(run['defaultDatasetId']).list_items().items
print(items)

cURL

# Start a run
curl -X POST "https://api.apify.com/v2/acts/automation-lab~facebook-ads-library/runs?token=YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"searchQueries": ["shopify"], "country": "US", "maxAds": 30}'
# Get results (replace RUN_ID with the actual run ID)
curl "https://api.apify.com/v2/datasets/DATASET_ID/items?token=YOUR_API_TOKEN"

Use with AI agents via MCP

Facebook Ads Library Scraper is compatible with the Model Context Protocol (MCP). This allows AI agents (Claude, GPT-4, etc.) to call the actor as a tool and analyze the results.

Example use case: Ask an AI agent to "find all active Facebook ads from Nike in the US and summarize their messaging strategy." The agent calls this actor, receives structured ad data, and generates insights.

The Facebook Ad Library is a public transparency tool created by Meta to provide public access to all ads running across Facebook, Instagram, Messenger, and Audience Network. It was created in response to regulatory requirements for ad transparency.

  • The Ad Library is publicly accessible without a Facebook account.
  • All data in the Ad Library is intentionally made public by Meta.
  • This actor accesses only publicly available data from the Ad Library.

Always review and comply with Meta's Terms of Service and applicable laws in your jurisdiction before using this actor.

FAQ

Q: How many ads can I scrape per run? Each search query returns up to ~30 ads from the first page of Ad Library results. To get more ads, use multiple search keywords in a single run — each keyword runs a separate search.

Q: Can I scrape all ads from a specific advertiser? Yes. Enter the advertiser's Facebook page URL (e.g., https://www.facebook.com/nike) in the "Advertiser page URLs" field. The actor will extract ads specifically from that page.

Q: Does it support pagination beyond the first page? Currently, the actor extracts ads from the initial server-side rendered page (up to ~30 ads per search). For broader coverage, use multiple related search keywords.

Q: Do I need a Facebook account? No. The Facebook Ad Library is publicly accessible. No login or authentication is needed.

Q: What countries are supported? All countries available in the Facebook Ad Library are supported. Use the ISO country code (e.g., "US", "GB", "DE", "BR", "IN") or "ALL" to search globally.

Q: Why are some fields null? Not all ads have all data. Spend and impression data are only available for ads about social issues, elections, or politics. Some ads may not have video URLs, CTA buttons, or link descriptions.

Q: The actor returned 0 ads. What should I do?

  • Check that your search keyword matches ads in the Facebook Ad Library directly.
  • Try a broader keyword or different country.
  • If searching by page URL, make sure the URL is a valid Facebook page URL.

Q: Can I filter by date range? The actor currently uses the Ad Library's default date handling. You can filter active vs. inactive ads using the activeStatus parameter. Post-processing the startDate and endDate fields lets you filter by any date range.

Q: How often can I run this actor? As often as you need. There are no built-in rate limits. However, very frequent runs against the same search terms may trigger Facebook's anti-bot measures.

Other marketing scrapers from Automation Lab