Facebook & Instagram

Meta Ad Library Scraper

Give it a competitor’s page or a keyword and it returns their live Facebook and Instagram ads, copy and creative included. I mostly use it to find the offers a brand keeps repeating, which tells you more than any single ad.

On JMLP: 1 credit per result, from $0.025 per 1,000 results. Free shared proxies included. Start with 500 free credits.

Ways to use this scraper.

Three examples to start from.

Prepare a competitor creative brief

Say you run a subscription brand. Each Monday, pull the new ads from five competitors and sort them by the problem they address and the offer they lead with. After a few weeks, the angles that keep coming back are the ones worth testing.

A Google Sheet of creatives sorted by hook, and a shortlist of tests to propose.

Follow a seasonal promotion

Run it daily in the weeks around a big sale. New ad IDs and copy changes show you the day a competitor starts discounting, and what they lead with.

A dated timeline of who launched what, with your notes beside it.

Find advertisers you haven’t been following

Search a category, say running shoes, and you’ll find advertisers that aren’t on your list yet. Check each page before it goes on the weekly watchlist, because keyword searches pull in a few unrelated pages.

A longer competitor list, ranked by who you want to look at first.

Your first run.

  1. Open the Actor on Apify and go to the Input tab. Switch to the JSON editor if you’d rather paste a configuration.
  2. In the JSON editor, replace the entire input with the example. Change ZARA to your page name or numeric page ID. In the form editor, also clear the prefilled pageID so you do not collect a second advertiser.
  3. Start with one country, active ads and a limit of 50. Keep the residential proxy enabled. Leave dates blank for this first check, then add a date window after you confirm the page match.
  4. Start the run and keep an eye on the log. If it comes back empty, check which targets and filters were read before you conclude there’s nothing there.
  5. Open Storage → Dataset and read a few records. Export CSV for a quick look in a spreadsheet, or JSON if you need the nested fields.
First-run configuration
{
  "pageIDs": ["ZARA"],
  "country": "GB",
  "activeStatus": "active",
  "maxAds": 50,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": ["RESIDENTIAL"]
  }
}

Paste this into the Actor’s JSON input editor. Replace the example targets with yours before running.

Check the current input form on Apify

Ways to search.

Choose a page when you know the advertiser, or a keyword when you want to discover ads around a topic. These are separate searches: a keyword does not automatically narrow every page you entered.

Search methodWhen to use itWhat changes
Advertiser or brand nameWhen to use itYou have a competitor watchlist.What changesProvide numeric page IDs, names, usernames or Facebook page links. Names are resolved first: verified matches win; multiple unverified exact matches can expand into several pages.
Keyword discoveryWhen to use itYou want to find relevant results before choosing specific targets.What changesSeveral topic searches sharing the same country, dates and match type. They share one maxAds cap, so overlapping results are deduplicated rather than counted twice.
Ad Library URLsWhen to use itYou already configured the search on the source website.What changesPaste page, keyword-search or individual-ad URLs. A search URL’s country, dates and status override global settings; a single-ad URL fetches that ad without those filters.

Worth knowing

Start of a delivery window, using YYYY-MM-DD. Ads started earlier can still match if they ran during the window. Equal start and end dates are widened by one day.

Compare the related scraper

What each input does.

In JSON, use the field names exactly as written below. In Apify’s form, add list items one at a time and keep numbers and true/false values as they are.

A default is what the Actor uses when you leave a setting out, and some settings have none. A prefill is an example Apify has already typed into the form, and it runs unless you change it. Check the prefilled targets and limits before you start; you always need at least one target of your own.

Targets and search inputs6
adLibraryUrls
List

Paste page, keyword-search or individual-ad URLs. A search URL’s country, dates and status override global settings; a single-ad URL fetches that ad without those filters.

adLibraryUrl
Text

The single-URL version of adLibraryUrls. Use one field or the other for clarity. Ordinary Facebook page links use your global filters.

pageIDs
List

Provide numeric page IDs, names, usernames or Facebook page links. Names are resolved first: verified matches win; multiple unverified exact matches can expand into several pages.

pageID
TextForm prefill: 15087023444

One page, using the same forms as pageIDs. Clear the form’s prefilled page when you only want a keyword search, otherwise both targets are collected.

keyword
Text

Find ads mentioning one topic across advertisers. This is separate from page lookup and runs alongside any page targets you left in the input.

keywords
List

Several topic searches sharing the same country, dates and match type. They share one maxAds cap, so overlapping results are deduplicated rather than counted twice.

Markets, dates and filters5
searchType
TextDefault: keyword_unordered

keyword_unordered matches words in any order. keyword_exact_phrase requires them together in that order. It only affects keyword searches; a pasted URL’s search_type takes precedence.

Suggested JSON values
keyword_unordered keyword_exact_phrase
minDate
Text

Start of a delivery window, using YYYY-MM-DD. Ads started earlier can still match if they ran during the window. Equal start and end dates are widened by one day.

maxDate
Text

Inclusive end of the delivery window. Together with minDate, it selects ads running during the period, not only ads first created during it.

activeStatus
TextDefault: allForm prefill: active

active collects currently running ads; inactive collects stopped ads; all includes archive history. The form starts with active, but omitting this field uses all.

Suggested JSON values
all active inactive
country
TextDefault: ALL

One country code or name, or ALL for every market. Unrecognized countries fall back to ALL with a warning, so check the log if your market filter seems too broad.

Suggested JSON values
ALL US GB DE FR ES IT BR MX CA AU IN AF AX AL DZ AS AD AO AI AQ AG AR AM AW AC AT AZ BH BD BB BY BE BZ BJ BM BT BO BQ BA BW BV IO VG BN BG BF BI KH CM CV KY CF TD CL CN CX CC CO KM CK CR HR CU CW CY CZ CD DK DJ DM DO EC EG SV GQ ER EE SZ ET FK FO FM FJ FI GF PF TF GA GM GE GH GI GR GL GD GP GU GT GG GN GW GY HT HM HN HK HU IS ID IR IQ IE IM IL CI JM JP JE JO KZ KE KI XK KW KG LA LV LB LS LR LY LI LT LU MO MG MW MY MV ML MT MH MQ MR MU YT MD MC MN ME MS MA MZ MM NA NR NP NL NC NZ NI NE NG NU NF KP MK MP NO OM PK PW PS PA PG PY PE PH PN PL PT PR QA CG RE RO RU RW BL KN LC MF PM VC WS SM ST SA SN RS SC SL SG SX SK SI SB SO ZA GS KR SS LK SH SD SR SJ SE CH SY TW TJ TZ TH BS TL TG TK TO TT TN TR TM TC TV UG UA AE UM VI UY UZ VU VA VE VN WF EH YE ZM ZW
Limits, details and proxies6
proxyConfiguration
ObjectDefault: {"useApifyProxy":true,"apifyProxyGroups":["RESIDENTIAL"]}Form prefill: {"useApifyProxy":true,"apifyProxyGroups":["RESIDENTIAL"]}

Use an Apify residential proxy. Datacenter exits are often challenged. Keep useApifyProxy true and apifyProxyGroups set to RESIDENTIAL for a normal run.

maxConcurrency
IntegerDefault: 4

1-6 parallel sessions. Several targets and large date ranges can run together. Use 1 for strict ranking order or when captchas appear; the default is 4.

maxAds
IntegerForm prefill: 100

A hard cap on unique ads across the whole run, including all targets and markets. Start with 50. Leaving it empty removes this cap; a broad search can then become much larger.

maxPages
Integer

Limits pages in each date shard, not the whole run. Useful for testing; clear it for fuller coverage. Zero or empty means unlimited.

delayMs
IntegerDefault: 300

Pause between page requests, in milliseconds. Increase it when the source throttles you; reducing it does not remove network delays or the source’s rate limits.

pageSize
IntegerDefault: 30

The requested batch size, not a guaranteed result count. Meta actually paginates about 10 ads at a time; raising this value will not remove that limit.

Advanced settings and recovery8
raw
True or falseDefault: false

Returns the source structure rather than the normalized presentation. Keep false for consistent analysis columns; use true when you need the source payload for debugging or your own transformations.

proxyRotations
IntegerDefault: 3

Retries refused work with a new proxy session. More retries can recover temporary blocks but add time and traffic. Keep the default until the log shows a reason to change it.

resume
True or falseDefault: true

Saves progress about every 30 seconds so an Apify restart or migration can continue the current run. Leave it on for normal use.

continueFromLastRun
True or falseDefault: false

Continues unfinished work from the previous run with matching input. Earlier results remain in that run’s dataset. Keep false for a fresh collection or a recurring snapshot.

shardSplitThreshold
IntegerDefault: 1500

Large date ranges are split when their reported ad count exceeds this threshold. It matters only with maxConcurrency above 1. Keep 1500 unless tuning large archive runs; values below 100 become 100.

docId
Text

An internal request-document override. Leave empty: the Actor detects and refreshes stale IDs automatically. It is not an advertiser or ad ID.

proxySessionId
Text

Pins a proxy session for debugging. Leave empty for routine collection. Parallel jobs need their own sessions, so this setting is ignored when parallelism prevents a single fixed session.

impersonate
TextDefault: chrome146

The browser identity used for requests. Keep the Actor’s default unless you are diagnosing immediate blocks. It changes the request fingerprint, not the data you ask for.

This reference follows the Actor’s published input fields. Check the live form before changing a production workflow. Check the current input form on Apify.

Three setups to copy.

Each one is a separate run. Swap in your own targets, countries and dates, start small, and widen it only once the first results look right.

A weekly competitor watchlist

Collect active UK ads from two brands, with 100 unique ads across the whole run. Schedule a fresh run each week, append a collection date in Sheets and compare new creative IDs with last week’s snapshot.

A weekly competitor watchlist
{
  "pageIDs": ["ZARA", "H&M"],
  "country": "GB",
  "activeStatus": "active",
  "maxAds": 100,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": ["RESIDENTIAL"]
  }
}

Find a repeated offer

This finds active US ads, from any advertiser, that use the exact phrase “free shipping”. Swap in your own offer. If the form has a page prefilled, clear it first, or that advertiser gets collected as well.

Find a repeated offer
{
  "keywords": ["free shipping"],
  "searchType": "keyword_exact_phrase",
  "country": "US",
  "activeStatus": "active",
  "maxAds": 50,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": ["RESIDENTIAL"]
  }
}

Review a past campaign window

This collects every ad ZARA ran in the UK during September 2026, whether it’s still active or not. Change the page and both dates for your own question. The dates match any ad that was running inside the window, so some of them started earlier.

Review a past campaign window
{
  "pageIDs": ["ZARA"],
  "country": "GB",
  "activeStatus": "all",
  "minDate": "2026-09-01",
  "maxDate": "2026-09-30",
  "maxAds": 100,
  "maxConcurrency": 4,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": ["RESIDENTIAL"]
  }
}

After the first run.

Join on page and creative IDs and keep the source links, ad text, media and dates with every record. Blank spend and reach are normal for commercial ads. If you run it weekly, BigQuery plus a dbt model to flatten the media arrays gives you a clean feed for a Looker Studio view of new creatives.

  1. Look at the dataset and the run’s SUMMARY record. Did you hit your cap? Were any inputs skipped? Open a few source links to make sure the records are what you think they are.
  2. Whatever you save, keep the original IDs and add collected_at and run_id. CSV is fine for flat columns; keep the JSON when arrays or nested details matter.
  3. Once a configuration works, save it as an Apify Task and schedule it. Leave continueFromLastRun false for repeated snapshots, and deduplicate by source ID without throwing away the dates you saw each record.
  4. In Make or n8n, trigger on a successful run, fetch the dataset and map the fields into Sheets or your warehouse. Looker Studio works best from a reporting table, and dbt is the place to flatten and test the warehouse models.
  5. The same JSON works with Apify’s API. With Claude and the Apify MCP server, name this Actor, have Claude check the live schema first, and give it explicit targets, markets and limits.

Resume is not a fresh snapshot

resume protects the current run if Apify restarts it. continueFromLastRun picks up an earlier run with the same configuration, and the earlier records stay in the earlier dataset, so you combine the two to get everything. If that run hit its cap, raise the cap before continuing. For a picture of what changed today, start fresh.

Follow the Sheets, Claude, Looker and BigQuery setup guides
Run this Actor from the API

Save one configuration above as input.json. Set APIFY_TOKEN to your Apify API token in your terminal, then send the file as the request body.

Start the run
curl --fail-with-body --request POST \
  --url "https://api.apify.com/v2/actors/jmlp~meta-ad-library-scraper/runs" \
  --header "Authorization: Bearer $APIFY_TOKEN" \
  --header "Content-Type: application/json" \
  --data-binary @input.json

The response contains a run ID and defaultDatasetId, not finished results. Wait for the run to succeed, set DATASET_ID to that dataset ID, then fetch its items. For large datasets, use limit and offset to page through the export.

Fetch the dataset
curl --fail-with-body \
  --url "https://api.apify.com/v2/datasets/$DATASET_ID/items?format=json" \
  --header "Authorization: Bearer $APIFY_TOKEN"

Apify’s run and export API reference
Dataset export options

If something looks off.

Change one setting at a time and keep the cap small. The run summary usually tells you what went wrong.

The results belong to the wrong advertiser.

Provide numeric page IDs, names, usernames or Facebook page links. Names are resolved first: verified matches win; multiple unverified exact matches can expand into several pages.

The source keeps returning empty pages or access errors.

Use an Apify residential proxy. Datacenter exits are often challenged. Keep useApifyProxy true and apifyProxyGroups set to RESIDENTIAL for a normal run.

Should I change the advanced request settings?

An internal request-document override. Leave empty: the Actor detects and refreshes stale IDs automatically. It is not an advertiser or ad ID.

The run succeeded but returned nothing

Succeeded only means the Actor finished, not that the source sent anything back. Look at SUMMARY.inputProblem, SUMMARY.problem and the log for missing targets, unsupported filters or refused requests, then try one target you know has data, with fewer filters.

Fewer records than expected

Usually it’s a limit: the global cap, a per-search or per-page cap, or what the platform covers. Deduplication also removes records that several searches found, and a site’s headline count can include records its public pages never show. Check for unfinished jobs before you call the dataset complete.

Call it as an API on RapidAPI.

The same scraper is also a REST API on RapidAPI, so you don’t need an Apify account. Subscribe with your RapidAPI key, send a request and get JSON back. The free plan is enough for a first test.

  1. Open the API on RapidAPI and pick a plan. The free Basic plan is enough to try it.
  2. Copy your key from the RapidAPI playground. It lists every parameter and turns your request into code for Python, JavaScript and more.
  3. Call GET /ads with a keyword, an advertiser page or an Ad Library URL. One call returns up to 100 ads (20 on the free plan), usually within a minute.
  4. For more ads, send the same parameters to POST /jobs. A job collects up to 5,000 ads on Pro and 20,000 on Ultra, and you read them page by page.

What counts toward your plan

Each scrape you start counts as one call, and each ad counts as one result the first time an answer returns it. Checking a job, reading a page again and failed scrapes are free.

Your first call
curl --request GET \
  --url 'https://meta-ad-library-api-facebook-instagram-ads.p.rapidapi.com/ads?keyword=running%20shoes&country=US&limit=10' \
  --header 'x-rapidapi-host: meta-ad-library-api-facebook-instagram-ads.p.rapidapi.com' \
  --header 'x-rapidapi-key: YOUR_RAPIDAPI_KEY'
Collect more with a job

A job answers at once with a jobId. Ask for its status with GET /jobs/JOB_ID?wait=60, which holds the answer until the job ends, for up to a minute. Status checks are free.

Start a job
curl --request POST \
  --url 'https://meta-ad-library-api-facebook-instagram-ads.p.rapidapi.com/jobs' \
  --header 'x-rapidapi-host: meta-ad-library-api-facebook-instagram-ads.p.rapidapi.com' \
  --header 'x-rapidapi-key: YOUR_RAPIDAPI_KEY' \
  --header 'Content-Type: application/json' \
  --data '{"page": "ZARA", "activeStatus": "all", "limit": 2000}'

Then read the results 1,000 at a time, raising offset until you have the total. Pages can be read while the job is still running.

Read the results
curl --request GET \
  --url 'https://meta-ad-library-api-facebook-instagram-ads.p.rapidapi.com/jobs/JOB_ID/results?offset=0&limit=1000' \
  --header 'x-rapidapi-host: meta-ad-library-api-facebook-instagram-ads.p.rapidapi.com' \
  --header 'x-rapidapi-key: YOUR_RAPIDAPI_KEY'

Plans and prices

PlanPriceIncluded each monthBeyond that
BasicPriceFreeIncluded each month20 calls and 100 adsBeyond thatStops at the limit
ProPrice$19 a monthIncluded each month1,000 calls and 25,000 adsBeyond that$0.015 a call and $0.00025 an ad
UltraPrice$89 a monthIncluded each month5,000 calls and 150,000 adsBeyond that$0.014 a call and $0.00022 an ad

RapidAPI bills in US dollars. Its pricing page always has the current plans.

Parameters9

GET calls take these as query parameters. POST /jobs takes them as JSON fields, where lists can be arrays.

keyword
Text

Words to look for in every advertiser’s ads, the way the Ad Library search box works.

page
Text

One advertiser: its numeric page ID, its name as the Ad Library shows it, its @username or its facebook.com link.

url
Text

An Ad Library URL copied from your browser: a page, a keyword search or a single ad. Its own country, dates and status take priority over the other parameters.

country
Text

Where the ads ran: a two-letter code such as US or GB, or a country name. Leave it out for every country.

activeStatus
TextDefault: active

active returns ads that are running now, inactive the ones that have stopped, and all returns both.

Accepted values
active inactive all
searchType
Text

keyword_unordered matches the words anywhere in the ad. keyword_exact_phrase needs them together and in order.

Accepted values
keyword_unordered keyword_exact_phrase
minDate
Text

The start of the date window, as YYYY-MM-DD. Returns ads that were delivering on or after that day.

maxDate
Text

The end of the date window, as YYYY-MM-DD. The day itself is included.

limit
Integer

The most ads to return. One call returns up to 100 (20 on the free plan), and 25 when you leave it out.

Use the results in your tools.

Google Sheets

Have Make or n8n add each successful run to the sheet, dropping duplicates by ad_archive_id and stamping collected_at. Leave a couple of empty columns for your own hook and offer notes.

Read the setup

Claude + MCP

Ask Claude for a capped set of ads from one advertiser, grouped by theme, with the ad_archive_id next to each point. Open a few of the creatives yourself before the brief goes anywhere.

Read the setup

Looker Studio

Chart ad counts by advertiser and start date from a sheet or BigQuery table, and label them as ads observed in the library so nobody reads them as spend.

Read the setup

BigQuery + dbt

Save each run’s raw JSON with its collection date. A dbt model can unpack the snapshot field into a creative table keyed by ad_archive_id.

Read the setup
Copy a prompt for Claude
Prompt for Claude + Apify MCP
Use jmlp/meta-ad-library-scraper to collect up to 50 active ads for ZARA in GB. First check the Actor input schema. Group the creative messages by hook and offer, cite the original ad IDs, and propose three testable campaign hypotheses. Do not infer spend or conversion performance.

The fields you’ll get.

Keep the collection time and original IDs with your records. You’ll need them to check where a result came from or compare it with a later run.

Before you draw conclusions

Meta publishes spend and reach mainly for political and social-issue ads, so commercial ads usually come without them. An ad that has run for months is worth a look, but how long it ran tells you nothing about whether it paid off.

ad_archive_id
Stable ad identifier for deduplication and original-library references.
page_id / page_name
The advertiser behind the record.
is_active / start_date / end_date
Observed activity and delivery dates; dates are Unix seconds.
publisher_platform
Facebook, Instagram and other reported Meta surfaces.
snapshot
Creative copy, headline, CTA, landing-page and media information.
collation_id / collation_count
Identifiers and counts for related ad variants.

Common questions.

Can I use it without a Facebook login?

Yes. It reads the public Ad Library, so no Facebook account is involved. You only need an Apify account to run it.

Can I see which ads are winners?

Not really. You can see which messages keep coming back and which creatives run for months, which is a decent hint. Calling an ad a winner takes conversion data, and the library doesn’t have it.

Can I use it without an Apify account?

Yes. It’s also a REST API on RapidAPI: subscribe with a RapidAPI key and call it like any other API. The free plan is enough for a first test.

Source and current product details: JMLP’s Meta Ad Library Actor on Apify.

Need a scraper or a pipeline built for you?

Send me the sites you’re interested in and the question behind them. I’ll tell you whether scraping is the right way to answer it, and what it would take.