Apify example task · whoareyouanas/meta-ad-scraper

Research inactive streaming ads in Meta Ad Library

Search inactive US ads for Netflix. Review historical campaign creative, copy and available start and end dates.

Actor
Meta (Facebook) Ad Library Scraper - Fast & Reliable
Result limit
Set by the input
Estimated cost
Per result, see pricing
Run options
1 GB memory · 180 s timeout

Example updated 2026-11-20 · actor build 0.3.2 · runs in your own Apify account

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.

input.json · meta-inactive-streaming-ads
{
  "maxConcurrency": 1,
  "requestHandlerTimeoutSecs": 120,
  "searchQuery": "Netflix",
  "country": "US",
  "activeStatus": "inactive",
  "sortMode": "start_date"
}
Input fields used by this example, their values and what they control
FieldValue in this exampleWhat it controls
maxConcurrency1Number 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.
requestHandlerTimeoutSecs120Maximum 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.
searchQueryChange this"Netflix"Keyword search query (e.g. 'nike', 'adidas shoes'). This searches across all ads by keyword.
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.
activeStatusChange this"inactive"Filter by ad campaign status.
sortModeChange this"start_date"Sort metric for results.
Other inputs you can add (8)
Deployed actor input fields, types, defaults, and descriptions
FieldType / requiredDefaultPurpose
targetUrlstringNot specifiedPaste the full Facebook Ad Library URL directly. If provided, all parameter fields below are ignored. Leave empty to build the URL from parameters instead.
pageIdstring""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.
adIdstringNot specifiedNumeric ID of a specific ad to look up (e.g. 1191898553123641).
adTypestring"all"Filter by type of ads.

Options: all, political_and_issue_ads, housing, employment, credit

mediaTypestring"all"Filter by media format.

Options: all, image, video, meme

isTargetedCountrybooleanfalseIf true, only show ads specifically targeting the selected country.
contentLanguagesarrayNot specifiedFilter by content language codes (ISO 639-1, e.g. 'en', 'it', 'hi'). Leave empty for all languages.
sortDirectionstring"desc"Sort order for results.

Options: desc, asc

03 / Make it yours

Change these fields for your own research.

  1. 01 · searchQuery

    Search Query (Keyword)

    Keyword search query (e.g. 'nike', 'adidas shoes'). This searches across all ads by keyword.

    Example: "Netflix"

  2. 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"

  3. 03 · activeStatus

    Ad Status

    Filter by ad campaign status.

    Example: "inactive"

  4. 04 · sortMode

    Sort By

    Sort metric for results.

    Example: "start_date"

Run it in three steps

  1. Open the example on Apify and select Try for free to copy it into your Apify account.
  2. Replace the sample values above with your own target and keep the limit small.
  3. Start the run, then export the dataset as JSON, CSV or Excel.

04 / Output

What the results table shows.

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.

Charges follow the billable events in the pricing table below and the number of records the run returns. This example has no single total result cap, so start with it as is and check the run's charges before widening it.

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 · run and return the results
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,"searchQuery":"Netflix","country":"US","activeStatus":"inactive","sortMode":"start_date"}'

Coverage & interpretation

Check the result before relying on it.

Questions

About this example.

What does the "Research inactive streaming ads in Meta Ad Library" example collect?

Search inactive US ads for Netflix. Review historical campaign creative, copy and available start and end dates. It runs Meta (Facebook) Ad Library Scraper - Fast & Reliable, published by whoareyouanas on Apify.

Which input does this example use?

Search Query (Keyword) (searchQuery) set to "Netflix"; Country (country) set to "US"; Ad Status (activeStatus) set to "inactive"; Sort By (sortMode) set to "start_date". The full JSON input is shown on this page.

How much does it cost to run this example?

Charges follow the billable events in the pricing table below and the number of records the run returns. This example has no single total result cap, so start with it as is and check the run's charges before widening it.

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 Search Query (Keyword), Country, Ad Status, Sort By. 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.

Guides

Read more about this workflow.