Apify example task · whoareyouanas/meta-ad-scraper
Export Meta Ad Library ads by Facebook Page ID
Export up to 10 active Meta Ad Library ads from one advertiser Page ID. Review ad copy, media links, CTA, dates, and platforms in the dataset, then download CSV or JSON.
- Actor
- Meta (Facebook) Ad Library Scraper - Fast & Reliable
- Result limit
- 10 (maxAds)
- Estimated cost
- Up to $0.06
- Run options
- 1 GB memory · 180 s timeout
Example updated 2026-11-23 · actor build 0.3.2 · runs in your own Apify account
From public source to spreadsheet
Use the advertiser’s Facebook Page ID, country, and status to pull a bounded sample from Meta Ad Library. Open the Apify dataset and export CSV for a spreadsheet or JSON to retain nested media fields.
- Confirm the advertiser in Meta Ad Library. Enter its Page ID and select the country and status for this snapshot.
- Keep maxAds at 10 for the first run. Compare a few returned ads against the Library with the same filters.
- Export the dataset. Keep the Library IDs as text and record the capture date and filters. Reuse those filters when you compare next week’s export.
The overview includes libraryID, brand, body, ctaText, linkUrl, startDate, images, and videos when available. Creative URLs may expire. The filters and public source coverage determine what appears in the export.
01 / About the actor
Meta (Facebook) Ad Library Scraper - Fast & Reliable
Export public Facebook and Instagram ads from Meta Ad Library by advertiser Page ID, keyword, or saved search URL. Download CSV or JSON with ad copy, creative links, CTAs, platforms, and dates.
Two ways to start
Paste a saved Ads Library search URL, or set a country and search by Page ID or keyword.
Creative research
Keep copy, advertiser identity, destination links, images, videos, and format together.
Search controls
Choose status, media type, language, and sorting through the deployed input fields.
02 / Input
The exact input this example runs.
A direct targetUrl takes precedence over the search parameters. For a keyword or Page ID search, set country and start with maxAds set to 10. Review the returned rows before increasing the cap.
{
"maxConcurrency": 1,
"requestHandlerTimeoutSecs": 120,
"pageId": "108047081396228",
"country": "US",
"activeStatus": "active",
"sortMode": "start_date",
"maxAds": 10
}| Field | Value in this example | What it controls |
|---|---|---|
| maxConcurrency | 1 | Number of browser tabs to run in parallel. Keep at 1 for stability. Increase to 2-3 only if you need faster scraping and have sufficient memory. Higher values increase memory usage. |
| requestHandlerTimeoutSecs | 120 | Maximum time to wait for a page to load and scrape all ads. Pages with 200+ ads need 600-900 seconds. Default of 900 seconds (15 minutes) handles large datasets. |
| pageIdChange this | "108047081396228" | Numeric Facebook Page ID to view all ads from a specific page (e.g. 108047081396228). You can find this in the URL when viewing a page's ads. |
| countryChange this | "US" | ISO 3166-1 alpha-2 country code for ad targeting (e.g. US, IN, IT, GB). Required when not using a direct URL. |
| activeStatus | "active" | Filter by ad campaign status. |
| sortMode | "start_date" | Sort metric for results. |
| maxAdsChange this | 10 | Stop after this many ads. Defaults to 100. Raise it (up to 10,000) to collect more; each ad is a billed result. |
Other inputs you can add (8)
| Field | Type / required | Default | Purpose |
|---|---|---|---|
| targetUrl | string | Not specified | Paste the full Facebook Ad Library URL directly. If provided, all parameter fields below are ignored. Leave empty to build the URL from parameters instead. |
| searchQuery | string | Not specified | Keyword search query (e.g. 'nike', 'adidas shoes'). This searches across all ads by keyword. |
| adId | string | Not specified | Numeric ID of a specific ad to look up (e.g. 1191898553123641). |
| adType | string | "all" | Filter by type of ads. Options: all, political_and_issue_ads, housing, employment, credit |
| mediaType | string | "all" | Filter by media format. Options: all, image, video, meme |
| isTargetedCountry | boolean | false | If true, only show ads specifically targeting the selected country. |
| contentLanguages | array | Not specified | Filter by content language codes (ISO 639-1, e.g. 'en', 'it', 'hi'). Leave empty for all languages. |
| sortDirection | string | "desc" | Sort order for results. Options: desc, asc |
03 / Make it yours
Change these fields for your own research.
01 · pageId
Facebook Page ID
Numeric Facebook Page ID to view all ads from a specific page (e.g. 108047081396228). You can find this in the URL when viewing a page's ads.
Example: "108047081396228"
02 · country
Country
ISO 3166-1 alpha-2 country code for ad targeting (e.g. US, IN, IT, GB). Required when not using a direct URL.
Example: "US"
03 · maxAds
Max Ads
Stop after this many ads. Defaults to 100. Raise it (up to 10,000) to collect more; each ad is a billed result.
Example: 10
Run it in three steps
- Open the example on Apify and select Try for free to copy it into your Apify account.
- Replace the sample values above with your own target and keep the limit small.
- Start the run, then export the dataset as JSON, CSV or Excel.
04 / Output
What the results table shows.
- One dataset item represents an extracted ad. Creative links point to source hosting and may expire.
- The dataset overview selects common fields; full JSON can retain additional media and metadata.
Columns in the “Overview” view
libraryID
Library ID
brand
Brand
industry
Industry
active
Active
platforms
Platforms
totalPlatforms
Total Platforms
similarAdCount
Similar Ad Count
multipleVersions
Multiple Versions
body
Body
linkTitle
Link Title
linkUrl
Link URL
linkDescription
Link Description
ctaText
CTA Text
ctaUrl
CTA URL
images
Images
videos
Videos
startDate
Start Date
endDate
End Date
format
Format
A view selects columns for the table. The full JSON export keeps every field, including nested arrays and objects.
05 / Cost
What this example costs to run.
At most about $0.06: up to 10 results at $0.006 each (ad). Fewer results cost less. The live Pricing tab on Apify is authoritative.
ad
$0.006 per event
Prices checked 2026-11-24. Set a run spending limit in Apify when you widen the input.
06 / API
Run the same input from your code.
This call starts a billable run of Meta (Facebook) Ad Library Scraper - Fast & Reliable with this example's input and returns the dataset items when it finishes. Synchronous calls wait up to five minutes; for longer runs, POST to /runs instead and read the run's default dataset when it succeeds. Keep the token in an environment variable.
curl --request POST \
'https://api.apify.com/v2/acts/whoareyouanas~meta-ad-scraper/run-sync-get-dataset-items?format=json' \
--header "Authorization: Bearer $APIFY_TOKEN" \
--header 'Content-Type: application/json' \
--data '{"maxConcurrency":1,"requestHandlerTimeoutSecs":120,"pageId":"108047081396228","country":"US","activeStatus":"active","sortMode":"start_date","maxAds":10}'Coverage & interpretation
Check the result before relying on it.
- Source access, pagination, and filters determine the returned sample; no complete-inventory or accuracy percentage is guaranteed.
- Public creative data does not establish ad spend, conversions, revenue, or ROAS.
Questions
About this example.
What does the "Export Meta Ad Library ads by Facebook Page ID" example collect?
Export up to 10 active Meta Ad Library ads from one advertiser Page ID. Review ad copy, media links, CTA, dates, and platforms in the dataset, then download CSV or JSON. It runs Meta (Facebook) Ad Library Scraper - Fast & Reliable, published by whoareyouanas on Apify.
Which input does this example use?
Facebook Page ID (pageId) set to "108047081396228"; Country (country) set to "US"; Max Ads (maxAds) set to 10. The full JSON input is shown on this page.
How much does it cost to run this example?
At most about $0.06: up to 10 results at $0.006 each (ad). Fewer results cost less. The live Pricing tab on Apify is authoritative.
How do I change it for my own research?
Open the example on Apify and select Try for free to copy it into your account, then edit Facebook Page ID, Country, Max Ads. Keep the result limit small for the first run and check the output before scaling up.
Can I run it from the API or on a schedule?
Yes. Send the same JSON input to the Meta (Facebook) Ad Library Scraper - Fast & Reliable run endpoint with your Apify API token, or save the copied task in your Apify account and add a schedule. Results land in the run's default dataset as JSON, CSV or Excel.
More examples
Related tasks you can copy.
Find active Adidas video ads on Meta
Search the US Meta Ad Library for active Adidas video ads. Review available creative URLs, ad copy, calls to action and start dates.
View exampleReview German-language furniture ads on Meta
Find active Meta ads matching Möbel in Germany and filter for German ad content. Review the available copy, images and campaign links.
View exampleResearch inactive streaming ads in Meta Ad Library
Search inactive US ads for Netflix. Review historical campaign creative, copy and available start and end dates.
View exampleFind fitness app ad creatives in India
Search active India Meta ads for fitness app creative. Review hooks, available media and destination links for a local campaign brief.
View exampleAI Ad Analyzer
Score an ad creative with your own AI API key
Analyze one sample image ad for hooks, visible text, creative attributes and improvement suggestions. Add your own OpenAI API key in the secret apiKey field before running. Provider charges apply in addition to Apify usage; AI scores are not measured ad performance.
View exampleFacebook Group & Page Scraper
Collect images and video links from ESA Facebook posts
Sample public ESA Facebook posts with media extraction enabled. Review available image links, video links and source post URLs.
View exampleGuides
Read more about this workflow.
How to Export Meta Ads from Facebook Ads Library for Competitor Research
Export public Meta Ad Library ads to CSV by Facebook Page ID, check the fields, and compare dated competitor snapshots.
Is That Meta Ad Still Running? Check an Ad Library ID
Look up a saved Facebook or Instagram ad, distinguish inactive ads from failed lookups, and build a status history you can trust.
Top 7 Web Scrapers for Competitor Research in 2026
Compare the best web scrapers for competitor ad research, social listening, lead generation, and market research across Meta, Google, TikTok, Reddit, websites, and Facebook Groups.
Top 5 Facebook Scrapers in 2026
Compare the best Facebook scrapers for Meta ads, Facebook groups, public pages, and single-ad status checks. Use the right tool for the data you actually need.