Meta Ad Library Scraper — Ad Creatives, Spend & Targeting avatar

Meta Ad Library Scraper — Ad Creatives, Spend & Targeting

Pricing

from $5.00 / 1,000 ad results

Go to Apify Store
Meta Ad Library Scraper — Ad Creatives, Spend & Targeting

Meta Ad Library Scraper — Ad Creatives, Spend & Targeting

Extract Facebook & Instagram ad creatives, spend ranges, impressions, targeting data, and landing pages from Meta Ad Library $5.00/1K. MCP/API-ready.

Pricing

from $5.00 / 1,000 ad results

Rating

0.0

(0)

Developer

Khadin Akbar

Khadin Akbar

Maintained by Community

Actor stats

1

Bookmarked

34

Total users

2

Monthly active users

3 days ago

Last modified

Share

Meta Ad Library Scraper is an Apify Actor for people who need Meta Ad Library records from Facebook, Instagram, and Messenger in a structured dataset. It accepts a keyword, multiple keywords, advertiser Page IDs, Meta Ad Library URLs, or a single ad ID. Each returned record represents one ad and can include creative text, headline, landing page, spend range, impressions, platform placement, languages, region or demographic delivery data, and enrichment fields such as ad summary, detected CTA, ad category, running days, word count, hashtag count, and emoji count. The output is ready for analysis in Apify, downstream automation, or use through Apify MCP.

Best fit and connected workflows

This Actor fits workflows where the source of truth is Meta Ad Library and the goal is to turn public ad listings into clean records.

It works well when you want to:

  • search by topic, brand, or advertiser Page ID
  • compare active and inactive ads across countries
  • review image and video creatives alongside landing pages
  • use spend, impressions, and targeting fields when a Meta access token is provided
  • enrich records for AI or MCP pipelines with summary and CTA fields
  • run a quick count first with onlyCount and then fetch the full dataset

If your workflow starts from a known Facebook Page, advertiserPageIds gives you a direct path to all ads from that advertiser. If you already have a Meta Ad Library URL, startUrls can capture the filters from the URL and reuse them in the run input.

Practical scenario

Maya is reviewing a fitness supplement brand that just launched a new campaign. She starts with the brand name in searchQuery, limits results to US, sets adStatus to ACTIVE, and keeps enrichAds enabled.

The returned record shows:

  • page_name for the advertiser identity
  • ad_creative_body and ad_creative_link_title for the message
  • landing_page_domain for the destination site
  • spend_lower and spend_upper for estimated spend
  • impressions_lower and impressions_upper for reach signals
  • ad_summary and detected_cta for quick review

Maya uses the landing page domain and CTA type to decide whether the brand is sending traffic to a product page or a lead capture flow. Her next action is to open the linked creative in ad_snapshot_url and compare it with other active ads from the same advertiser.

Input fields

FieldTypePurpose
searchQuerystringSearch one keyword or phrase in Meta Ad Library.
searchQueriesarray[string]Run several keyword searches and merge the results.
metaAccessTokenstringMeta Graph API access token with ads_read permission.
countriesarray[string]ISO country codes for ad delivery filtering. Default: ["US"].
adStatusstringALL, ACTIVE, or INACTIVE.
adTypestringAd category filter such as ALL or regulated categories.
mediaTypestringCreative format filter such as ALL, IMAGE, or VIDEO.
startDatestringInclude ads running on or after this date.
endDatestringInclude ads running on or before this date.
maxResultsintegerMaximum number of ad records to fetch.
sortBystringimpressions_desc or most_recent.
enrichAdsbooleanAdd summary and auto-analysis fields to each record.
providerFallbackEnabledbooleanUse configured public-data fallback when the primary path returns no ads.
onlyCountbooleanReturn only the total number of matching ads.
advertiserPageIdsarray[string]Fetch all ads for specific Facebook Page IDs.
startUrlsarrayPaste Meta Ad Library URLs or Facebook Page URLs.
adIdstringLook up one specific ad by Meta Ad Library ID.
contentLanguagesarray[string]Filter creative language by ISO 639-1 code.
publisherPlatformsarray[string]Filter by platform such as Facebook or Instagram.
searchTypestringKEYWORD_UNORDERED or KEYWORD_EXACT_PHRASE.
metaAccessTokensarrayToken pool for high-volume use.
proxyUrlsarrayCustom proxy URLs for web scrape mode.

Focused JSON input example

{
"searchQuery": "artificial intelligence",
"countries": ["US", "GB"],
"adStatus": "ACTIVE",
"adType": "ALL",
"mediaType": "ALL",
"startDate": "a source-provided date",
"endDate": "a source-provided date",
"maxResults": 50,
"sortBy": "impressions_desc",
"enrichAds": true,
"providerFallbackEnabled": true,
"onlyCount": false,
"publisherPlatforms": ["facebook", "instagram"],
"searchType": "KEYWORD_UNORDERED"
}

Output fields

Each dataset item represents one ad record. The live dataset contract defines these fields.

FieldTypePurpose
ad_idstring or nullMeta Ad Library ad identifier.
page_idstring or nullFacebook Page ID for the advertiser.
page_namestring or nullAdvertiser name shown in the library.
ad_creative_bodystring or nullMain ad copy.
ad_creative_bodiesarray or nullMultiple copy variants when present.
ad_creative_link_titlestring or nullHeadline or CTA card title.
ad_creative_link_captionstring or nullDomain shown on the link card.
ad_creative_link_descriptionstring or nullLink card description text.
ad_snapshot_urlstring or nullCreative preview link in Meta Ad Library.
landing_page_urlstring or nullAdvertiser destination URL.
spend_lower / spend_upperinteger or nullEstimated spend range where available.
currencystring or nullISO 4217 currency code.
impressions_lower / impressions_upperinteger or nullEstimated impression range where available.
eu_total_reachinteger or nullEU reach value where available.
delivery_start_date / delivery_stop_datestring or nullAd run dates.
ad_creation_timestring or nullAd creation timestamp.
is_activebooleanWhether the ad is currently running.
publisher_platformsarray or nullPlatforms where the ad ran.
languagesarray or nullCreative language codes.
demographic_distributionarray or nullAge and gender delivery breakdown.
delivery_by_regionarray or nullRegional delivery breakdown.
landing_page_domainstring or nullDomain extracted from the landing page.
image_urlsarray or nullDirect image URLs when available.
video_urlsarray or nullDirect video URLs when available.
cta_typestring or nullCTA button type from Meta data.
carousel_cardsarray or nullCarousel card details when present.
search_querystring or nullSearch term used for the record.
ad_summarystring or nullOne-sentence LLM-ready summary.
detected_ctastring or nullAuto-detected CTA label.
ad_categorystring or nullAuto-classified ad category.
running_daysinteger or nullNumber of days the ad has been running.
word_countintegerWord count of the ad body.
hashtag_countintegerHashtag count in the ad body.
emoji_countintegerEmoji count in the ad body.
country_filterstringCountry filter applied to the run.
data_modestringCollection mode used for the record.
scraped_atstringExtraction timestamp.

Illustrative output record

{
"ad_id": "23851234567890123",
"page_id": "123456789",
"page_name": "Nike",
"ad_creative_body": "Run faster. Train smarter. Shop now and get free shipping.",
"ad_creative_link_title": "Shop Nike Air Max 2024",
"ad_creative_link_caption": "nike.com",
"ad_snapshot_url": "https://www.facebook.com/ads/archive/render_ad/?id=23851234567890123",
"landing_page_url": "https://www.nike.com/w/new-shoes",
"spend_lower": 1000,
"spend_upper": 5000,
"currency": "USD",
"impressions_lower": 100000,
"impressions_upper": 500000,
"eu_total_reach": 250000,
"delivery_start_date": "2024-01-15T00:00:00+0000",
"delivery_stop_date": "2024-02-28T00:00:00+0000",
"is_active": true,
"publisher_platforms": ["facebook", "instagram"],
"languages": ["en"],
"landing_page_domain": "nike.com",
"cta_type": "SHOP_NOW",
"ad_summary": "Nike ad on facebook/instagram (currently running, links to nike.com): \"Run faster. Train smarter...\"",
"detected_cta": "shop_now",
"ad_category": "ecommerce",
"running_days": 45,
"word_count": 18,
"hashtag_count": 3,
"emoji_count": 2,
"country_filter": "US",
"data_mode": "graph_api",
"scraped_at": "2026-03-28T10:30:00.000Z"
}

How it works

The actor uses Meta Graph API when a valid Meta access token is supplied. In that mode, it can return spend ranges, impressions, demographics, and richer creative data.

When the native Meta Graph API or browser scrape path returns no ads because of a block, timeout, rate limit, or expired token, provider fallback can try configured public Meta Ad Library APIs from ScrapeCreators or SociaVault. The manifest also shows support for public web scraping mode and custom proxy URLs for that path.

enrichAds adds derived fields to each record, including ad_summary, detected_cta, ad_category, running_days, word_count, hashtag_count, and emoji_count. onlyCount returns the match total without downloading ad rows.

Pricing

This Actor uses pay per event pricing plus Apify platform usage. The primary event is Ad Result, charged for each ad scraped. A separate actor start event is also charged by memory allocation.

For example, a run that returns one hundred ads is billed for one hundred Ad Result events, plus the actor start event. For the current event definitions and the live Pricing tab, check the Actor page in Apify.

Use with AI agents (MCP)

This Actor is usable through Apify MCP as an Apify Actor, which lets agents call it as a tool and receive structured ad records back in the dataset.

Actor identity: khadinakbar/meta-ad-library-scraper

Tool description: search Meta Ad Library by keyword, advertiser, URL, or ad ID and return one record per ad with creative, spend, impressions, targeting, and landing-page fields.

Find active Facebook and Instagram ads for the keyword "AI productivity tools" in the US, return up to 50 results, and include enrichment fields for summary and CTA detection.

How to read the output:

  • ad_summary is the quickest LLM-ready description
  • ad_snapshot_url points to the creative in Meta Ad Library
  • landing_page_url and landing_page_domain identify the destination
  • spend_lower/spend_upper and impressions_lower/impressions_upper are ranges when available
  • publisher_platforms, languages, demographic_distribution, and delivery_by_region support targeting analysis
  • data_mode shows whether the record came from Graph API, web scrape, or a fallback provider

Scope and provenance:

  • Each dataset row represents one ad
  • scraped_at marks when the record was extracted
  • country_filter and search_query help trace the search context

Pagination and cost guidance:

  • Raise maxResults for broader coverage
  • Use onlyCount first when you want a quick estimate
  • Use sortBy: "impressions_desc" to review higher-reach ads first
  • Cost scales with returned ad results under the pay per event model

Apify API example

import { ApifyClient } from 'apify-client';
const client = new ApifyClient({
token: process.env.APIFY_TOKEN,
});
const run = await client.actor('khadinakbar/meta-ad-library-scraper').call({
searchQuery: 'AI productivity tools',
countries: ['US'],
adStatus: 'ACTIVE',
maxResults: 25,
enrichAds: true,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
const datasetItems = await client.dataset(run.defaultDatasetId).listItems();
console.log(`Returned ${datasetItems.items.length} ads`);

Best results and outcome guidance

Use searchQuery for topic discovery, advertiserPageIds for known brands, and startUrls when you already have a filtered Meta Ad Library URL. For focused review, combine countries, adStatus, mediaType, and publisherPlatforms. For AI workflows, keep enrichAds enabled so the dataset includes summary and classification fields.

Focused standalone workflow

Meta Ad Library Scraper — Ad Creatives, Spend & Targeting is designed as a focused standalone workflow for the public input and structured output contract described above.

Design note

I found that the live dataset contract includes scraped_at as a required field, while many other fields are optional and may be null depending on the collection path.

FAQ

How should I choose between searchQuery and advertiserPageIds?
Use searchQuery when you want to discover ads around a theme or brand name. Use advertiserPageIds when you already know the Facebook Page IDs and want all ads from those advertisers.

When should I use startUrls?
Use startUrls when you have a Meta Ad Library URL with filters already set in the browser and want the Actor to reuse those parameters.

What does onlyCount return?
It returns the total number of matching ads without downloading full records.

Which fields are richest with a Meta access token?
The input contract says the token unlocks spend ranges, impressions, demographics, image and video URLs, and faster scraping.

How do I narrow results to a specific market or format?
Use countries, adStatus, adType, mediaType, publisherPlatforms, and contentLanguages together.

What is the output record structure useful for?
It is built for ad creative review, targeting analysis, landing-page comparison, and AI or MCP pipelines that need one normalized record per ad.

Responsible use

Use this Actor in ways that respect Meta Ad Library access, applicable laws, and the terms that apply to your account and environment. Review public ad records carefully, especially when using spend, impression, or targeting fields, since some values are ranges or may be null depending on the data collection path and the ad type.