# Facebook & Instagram Ad Library Scraper \[NO COOKIES] ✅ (`unseenuser/meta-ads`) Actor

Extract every active ad across Meta - Facebook and Instagram. Pull full creatives, copy, CTAs, run dates, and EU spend/impression data. No Meta account, no Marketing API, no developer app required. Built for growth marketers, agencies, and e-commerce brands.

- **URL**: https://apify.com/unseenuser/meta-ads.md
- **Developed by:** [Unseen User](https://apify.com/unseenuser) (community)
- **Categories:** Social media, Developer tools, Lead generation
- **Stats:** 36 total users, 16 monthly users, 100.0% runs succeeded, 4 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

$5.00 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## Facebook & Instagram Ad Library Scraper

The only meta ad library scraper that covers **all 6 Meta surfaces** in one tool: Facebook, Instagram, Messenger, Audience Network, Threads, and Meta's partner network. Scrape facebook ads, instagram ads, and everything in between - no Meta Business Manager, no app review, no Marketing API credentials needed.

### Free plan limit

Free Apify users get up to **50 results per run**. Paying users are not affected and receive results normally.

This limit was set by the Actor developer, not by Apify. To remove it and receive unlimited results, upgrade to any paid Apify plan: https://apify.com/pricing

When a free plan run hits the cap, the Actor finishes successfully (status `SUCCEEDED`) and the run's status message explains what happened. No error is raised, so the first 50 results are fully usable as normal.

### Why this scraper instead of Meta's official API?

| | This Scraper | Meta Marketing API |
|---|---|---|
| Setup time | 30 seconds | Days (app review + business verification) |
| Business Manager required | No | Yes |
| App review required | No | Yes |
| Surfaces covered | All 6 (FB, IG, Messenger, AN, Threads, Partners) | Ad Library API only |
| Competitor ads | Yes - any advertiser | Only your own accounts |
| Political ad spend/impressions | Yes (where Meta publishes it) | Limited |
| Rate limits | Managed for you | You manage tokens + rate limits |
| EU DSA transparency data | Yes | Manual compliance |

### What you can do with it

| Use case | How |
|---|---|
| **E-commerce competitor spy** | Search by keyword or brand to see every ad your competitors run, with creative, copy, CTA, and landing URL |
| **Agency creative briefs** | Pull winning ad formats (single image, video, carousel, collection) as structured JSON for your creative team |
| **Ad-format benchmarking** | Compare display formats (IMAGE, VIDEO, DPA, DCO, MEME) across competitors at scale |
| **Political ad research** | Track political ad spending, impression ranges, and demographic breakdowns for journalism or academic research |
| **EU DSA compliance** | Access transparency data Meta publishes under the Digital Services Act |
| **Brand-safety monitoring** | Detect counterfeit or unauthorized ads using your brand name or trademarks |
| **Influencer vetting** | Verify if claimed brand partnerships actually have running ads |
| **Swipe-file automation** | Pipe ad creatives into Airtable, Google Sheets, or Notion via Apify integrations |

### Four modes

| Mode | What you get |
|---|---|
| **Find ads by keyword** | Keyword search across every advertiser on Meta. Cursor-paginated. Returns ad copy, images, videos, CTA, landing URL. |
| **Get all ads from a brand / page** | Every active (or inactive) ad for a specific Facebook page. Supports brand-name auto-resolve. |
| **Look up a brand's page ID** | Company-to-page-ID lookup. Returns name, category, likes, verification status, Instagram handle + followers. |
| **Get full details for a specific ad** | Complete detail for one ad, including all creative variants (carousel cards), link URL, CTA, and optional video transcript. |

### How to use it

1. Pick a **mode** from the dropdown.
2. Paste your **search terms** - one per line (keywords, brand names, page IDs, or ad URLs depending on the mode).
3. Optionally select countries, status, or max items.
4. Click **Start**.

Everything else is in the collapsed **Advanced** section with sensible defaults.

### Example inputs

**Keyword search - find facebook ads by topic**
```json
{
    "searchMode": "search_ads",
    "searchTerms": ["running shoes", "trail runners"],
    "countries": ["US"],
    "maxItems": 500
}
````

**Scrape all instagram ads from a brand**

```json
{
    "searchMode": "company_ads",
    "searchTerms": ["Nike"],
    "countries": ["US"]
}
```

**Look up a company's Facebook page ID**

```json
{
    "searchMode": "search_companies",
    "searchTerms": ["nike", "lululemon", "on running"]
}
```

**Get full ad details with video transcript**

```json
{
    "searchMode": "ad_details",
    "searchTerms": ["702369045530963"],
    "getTranscript": true
}
```

### Output by ad format

The JSON structure varies by ad format. Here's what to expect:

**Single image ad** - `snapshot.display_format: "IMAGE"`, creative in `snapshot.images[]`

**Video ad** - `snapshot.display_format: "VIDEO"`, creative in `snapshot.videos[]` with HD/SD URLs + preview image. Optional `transcript` field when `getTranscript: true`.

**Carousel ad** - `snapshot.display_format: "MULTI_IMAGES"` or `"DCO"`, each slide in `snapshot.cards[]` with its own body, title, image, link\_url, and CTA.

**Dynamic Product Ad (DPA)** - `snapshot.display_format: "DPA"`, product cards in `snapshot.cards[]` with individual product URLs, prices in `link_description`, and product images.

**Collection ad** - `snapshot.display_format: "DCO"`, mix of video + image cards in `snapshot.cards[]`.

Every item includes a `_meta` field for traceability:

```json
"_meta": {
    "searchMode": "search_ads",
    "query": "running shoes",
    "country": "US",
    "page": 2,
    "scrapedAt": "2026-05-07T12:00:00.000Z"
}
```

Null values, empty strings, and empty arrays are automatically stripped from output for clean, compact data.

### FAQ

**Q: Does this return EU spend and impression data?**
A: Yes. For ads targeting EU countries, Meta publishes spend ranges, impression ranges, and demographic breakdowns under DSA requirements. This data appears in the `aaa_info` field (ad-details mode) or the `impressions_with_index` / `spend` fields (list modes) when Meta makes it available.

**Q: What data varies by country?**
A: Political ad transparency data (spend, impressions, audience demographics) is only available in countries where Meta is legally required to publish it (US, EU, UK, Canada, Australia, others). Non-political ads show creative + metadata everywhere but no spend/impression data.

**Q: Does it flag AI-generated content?**
A: Yes. Meta's `contains_digital_created_media` boolean field indicates whether the ad was flagged as containing AI-generated or digitally manipulated content.

**Q: Can I access the actual media files (images/videos)?**
A: The output includes direct CDN URLs to images (`original_image_url`, `resized_image_url`) and videos (`video_hd_url`, `video_sd_url`). These are temporary Meta CDN links - download them promptly or they may expire.

**Q: What's the maximum number of results?**
A: The keyword search (GET) caps at ~1,500 results per query due to cursor size limits. For larger sweeps, narrow by country, date range, or more specific keywords and run multiple jobs.

### Integration ideas

- **Slack alerts** - Use Apify's Slack integration to get notified when a competitor launches new ads
- **Airtable swipe file** - Pipe ad creatives directly into an Airtable base for your creative team to browse
- **Make / n8n / Zapier** - Trigger workflows when new ads match your keywords
- **Google Sheets** - Auto-export to a shared spreadsheet for weekly competitor reports
- **Custom dashboards** - Feed the Apify dataset API into your BI tool of choice

### Cost & limits

- The actor itself is a thin wrapper - Apify compute usage is minimal.
- **All data is billed by ScrapeCreators**, not Apify.
- The `search_ads` GET endpoint caps at ~1,500 results per query. For wider sweeps, use narrower filters and run multiple jobs.
- Use `maxItems` and `maxItemsPerTerm` to keep costs predictable.

### Related scrapers

Full cross-platform ad spy - track competitors everywhere they advertise:

- [LinkedIn Ad Library Scraper](https://apify.com/unseenuser/LinkedIn-ads) - B2B ad intelligence
- [Google Ads Transparency Scraper](https://apify.com/unseenuser/Google-ads) - Search, YouTube, Display, Shopping
- [Reddit Scraper + Ads Library](https://apify.com/unseenuser/Reddit-Scraper) - Reddit content + ads

[See all 16 scrapers by unseenuser](https://apify.com/unseenuser)

***

### Terms of Service

**By running this Actor, you accept the Terms below.**

***

#### Apify Actor - Terms of Service

**Version:** 4.0
**Effective Date:** May 5, 2026

##### 0. ACCEPTANCE BY USE - IMPORTANT

These Terms of Service ("Terms") form a binding legal agreement between you ("User," "you," "your") and UnseenUser, the Publisher of this Apify actor ("UnseenUser," "the Publisher," "we," "us," "our").

**0.1 How You Accept These Terms**

You accept these Terms by any of the following actions:

(a) Running the Actor - Initiating any execution of the Actor on the Apify platform
(b) Using any output returned by the Actor for any purpose
(c) Continuing to access the Actor's listing or documentation after these Terms are visible

**0.2 Continuing Acceptance**

Each time you run the Actor or use its outputs, you reaffirm your acceptance of the then-current Terms. If you do not agree, you must stop using the Actor immediately.

**0.3 No Anonymous Acceptance**

You cannot disclaim acceptance by failing to read these Terms, running the Actor through automated systems, or sharing your Apify account with others. By running the Actor on Apify, you bind yourself, your organization, and any individuals or systems acting on your behalf.

**0.4 If You Do Not Accept**

If you do not agree to these Terms, you must not run the Actor. No use is authorized without acceptance.

***

##### PREAMBLE - UNDERSTANDING THE ARCHITECTURE

**The Data Flow**

```
You (User) -> Apify Platform -> Actor (software) -> Scrape Creators API -> Meta Ad Library
                                                          |
You (User) <- Apify Platform <- Actor (software) <- Scrape Creators API
```

**What Each Party Does**

- **You (the User):** Run the Actor on the Apify platform with input parameters you choose
- **Apify:** Operates the cloud infrastructure that hosts and executes Actors
- **The Publisher (us):** Publishes software code (the Actor) on Apify's platform. The Actor is a thin wrapper that translates your input into requests to a third-party API and returns the API's responses to you. The Publisher does not operate scraping infrastructure, store data, or see/log/process personal data in Actor outputs.
- **Third-Party API Provider:** Scrape Creators (https://scrapecreators.com). An independent third-party company that operates scraping infrastructure and returns data from source platforms.
- **Source Platform:** Meta (Facebook, Instagram). The platform whose publicly visible Ad Library data is accessed.

These Terms operate alongside but do not replace: Apify's Terms of Service, Scrape Creators Terms of Service, Meta's Terms of Service, and applicable law in your jurisdiction.

***

##### 1. NATURE OF THE SERVICE

**1.1 What the Actor Is**

The Actor is a software program that: (a) Accepts structured input from you; (b) Translates that input into HTTP requests to Scrape Creators' API; (c) Receives HTTP responses; (d) Returns the response data to you on the Apify platform.

**1.2 What the Actor Is Not**

The Actor is not: (a) A scraping tool - the Publisher does not operate scraping infrastructure; (b) A direct connection to Meta; (c) A data storage or retention service; (d) A licensed access channel to Meta/Facebook/Instagram; (e) Affiliated with, endorsed by, or authorized by Meta.

**1.3 The Publisher's Limited Role**

The Publisher is a software vendor - similar to a developer who publishes an app on an app store. The Publisher is not a data provider, data broker, data processor, or data controller for purposes of GDPR, CCPA, Israel's Privacy Protection Law, or equivalent.

***

##### 2. WHO MAY USE THE ACTOR

You may use the Actor only if: (a) You are at least 18 years old; (b) You have legal capacity to enter contracts; (c) You are not in a sanctioned country; (d) You are not on any prohibited persons list.

***

##### 3. PERMITTED USES

The Actor may be used for any lawful purpose, including: market research, competitive analysis, academic research, journalism, business intelligence, brand monitoring, and building products that further process publicly available information lawfully.

***

##### 4. PROHIBITED USES

**4.1 Illegal Activity** - Activity illegal under any applicable law.

**4.2 Harassment, Stalking, and Personal Targeting** - Compiling profiles for harassment, stalking, or doxxing. Tracking individuals without their knowledge. Building profiles of vulnerable populations for retaliatory purposes.

**4.3 Discrimination** - Using outputs for discriminatory decisions based on protected characteristics.

**4.4 Spam and Unsolicited Commercial Communication** - Sending unsolicited marketing in violation of CAN-SPAM, CASL, GDPR, PECR, Israeli Anti-Spam Law, or equivalent. Building "lead lists" without consent. Reselling contact data for spam.

**4.5 Fraud and Deception** - Identity theft, fake reviews, election interference, securities fraud.

**4.6 Source Platform Abuse** - Circumventing technical protections, creating fake accounts, engagement manipulation, building competitive substitutes for source platforms.

**4.7 Reselling the Actor's Service** - Reselling raw outputs as your own data product. Sharing credentials for third-party access. Building competing APIs.

**4.8 AI Training Without Authorization** - Using outputs as training data for commercial AI/ML models without licensing from the source platform.

**4.9 Sensitive Targeting** - Targeting or profiling based on health, sexual orientation, religion, politics, or other sensitive characteristics. Targeting children under 16.

**4.10 Privacy Law Violations** - Processing personal data without complying with applicable privacy law. Failing to honor data subject requests.

***

##### 5. SOURCE PLATFORM TERMS - YOUR RESPONSIBILITY

You are solely responsible for ensuring your downstream use complies with Meta's Terms of Service. The Publisher makes no representation that any specific use is permitted under Meta's terms. If you receive a cease-and-desist from Meta: (a) Cease immediately; (b) Notify UnseenUser within 48 hours via https://apify.com/UnseenUser; (c) Cooperate as needed.

***

##### 6. DATA PROTECTION

**6.1 Roles Under Privacy Law**

- **You** are the Data Controller of any personal data you obtain and process
- **Scrape Creators** bears responsibility for the data collection itself
- **The Publisher** acts solely as a software vendor (does not store, retain, or process personal data)

**6.2 No Data Retention by the Publisher**

The Publisher does not maintain a database of personal data, does not access your outputs, and does not view or analyze Actor results.

**6.3 Your Obligations**

Where your use involves personal data, you must: establish a lawful basis, provide notice, honor data subject rights, implement security measures, and comply with cross-border transfer requirements.

**6.4 Israel's Amendment 13**

If your use involves Israeli residents' personal data, comply with the Privacy Protection Law as amended (Amendment 13, effective August 14, 2025).

**6.5 Sensitive Data Restrictions**

Do not use the Actor to target or profile based on: health, religion, politics, sexual orientation, genetics/biometrics, criminal history, or children under 16.

***

##### 7. INTELLECTUAL PROPERTY

The Actor's source code, schemas, documentation, and branding are owned by the Publisher. You receive a limited, non-exclusive, revocable license. The Publisher claims no ownership over public data returned. You may not reverse engineer or reuse the Actor's code in a competing actor.

***

##### 8. PRICING AND PAYMENT

Pricing is administered through Apify. The Publisher may change pricing with at least 14 days' notice. No refunds for breach-related termination.

***

##### 9. SERVICE AVAILABILITY

The Actor depends on Apify, Scrape Creators, and Meta's continued accessibility. The Publisher makes no uptime guarantees and may discontinue the Actor at any time.

***

##### 10. DISCLAIMERS

THE ACTOR IS PROVIDED "AS IS" AND "AS AVAILABLE" WITHOUT WARRANTIES OF ANY KIND, INCLUDING WARRANTIES OF MERCHANTABILITY, FITNESS FOR PURPOSE, NON-INFRINGEMENT, OR ACCURACY OF DATA. The Publisher makes no representation that your use is lawful in your jurisdiction.

***

##### 11. LIMITATION OF LIABILITY

AGGREGATE LIABILITY SHALL NOT EXCEED THE GREATER OF: (a) US $100, OR (b) AMOUNTS PAID IN THE 3 MONTHS PRECEDING THE EVENT. THE PUBLISHER IS NOT LIABLE FOR INDIRECT, INCIDENTAL, SPECIAL, CONSEQUENTIAL, OR PUNITIVE DAMAGES. Claims must be brought within 1 year.

***

##### 12. INDEMNIFICATION

You agree to defend, indemnify, and hold harmless the Publisher from claims arising from your use, violations of these Terms, violations of law, violations of Source Platform terms, or your processing of personal data.

***

##### 13. SUSPENSION AND TERMINATION

The Publisher may terminate access for material breach, illegal use, or credible legal demand. You may stop using the Actor at any time.

***

##### 14. DISPUTE RESOLUTION

14.1 Send disputes to https://apify.com/UnseenUser and wait 60 days before formal claims.
14.2 Governed by the laws of the State of Israel.
14.3 Exclusive jurisdiction: civil courts of Tel Aviv-Jaffa, Israel.
14.4 Individual claims only (no class actions).
14.5 Prevailing party recovers attorneys' fees.

***

##### 15. MISCELLANEOUS

Entire agreement. Severability applies. No assignment without consent. Sections 0, 4, 5, 6, 7, 10, 11, 12, 14, and 15 survive termination. English controls. Publisher contact: https://apify.com/UnseenUser

***

##### 16. ACKNOWLEDGMENT

By using this Actor, you acknowledge that: (a) You have read these Terms; (b) You understand the architecture; (c) You accept responsibility for your use; (d) Indemnification covers third-party claims; (e) Disputes are resolved in Israeli courts; (f) Publisher identity is obtainable through valid legal process via Apify.

***

#### Actor-Specific ToS Addendum - Facebook & Instagram Ad Library Scraper

This addendum supplements the Master Terms V4.0.

**A. Architectural Disclosure** - This Actor calls Scrape Creators API endpoints and returns the response. UnseenUser does not store, log, or process the data.

**B. Nature of Data Returned** - Ad creative (images, video, carousel), ad copy, CTAs, page identity, dates, platforms, demographic targeting (political ads), spend ranges (political ads). Where output includes personal data, you are the data controller.

**C. Permitted Use Cases** - DTC competitor research, creative inspiration, brand-safety monitoring, influencer-vetting, election integrity research, agency proof-of-spend.

**D. Specifically Prohibited Uses** - Republishing ad creative without licensing, building substitute Ad Library databases for resale, harassing advertisers, impersonation/trademark dilution, voter suppression, publishing targeting data for manipulation.

**E. Platform Terms** - Meta restricts commercial reuse of Ad Library data. If Meta issues a cease-and-desist, notify UnseenUser within 48 hours via https://apify.com/UnseenUser.

**F. Ad Creative Copyright** - Ad creative is copyrighted by the advertiser. Analysis is typically fair use; republishing requires licensing.

**G. Political Ads** - May be used for journalism, research, voter education, election monitoring. May NOT be used for voter suppression, microtargeting "swing voter" lists, disinformation, or election interference.

**H. Page Identity** - When a page name corresponds to an individual, treat as personal data in your downstream processing.

**I. Cross-Platform Aggregation** - Do not aggregate with other ad platforms + personal data to build cross-platform identity profiles. This creates GDPR/CCPA exposure.

**J. Restricted Content** - Do not target minors, do not promote regulated products in prohibited jurisdictions, comply with industry-specific advertising restrictions.

***

### Links

- Publisher contact: https://apify.com/UnseenUser
- ScrapeCreators API docs: https://docs.scrapecreators.com
- Meta Ad Library: https://www.facebook.com/ads/library

# Actor input Schema

## `searchMode` (type: `string`):

Pick one. The box below changes meaning based on your choice.

## `searchTerms` (type: `array`):

One per line. What to put here depends on the mode above:

• **Find ads by keyword** — keywords, e.g. `running shoes`, `skincare`
• **Get all ads from a brand / page** — brand names (e.g. `Nike`) or numeric Facebook page IDs (e.g. `15087023444`). Names are auto-resolved to IDs.
• **Look up a brand's Facebook page ID** — brand names, e.g. `nike`, `lululemon`
• **Get full details for a specific ad** — ad IDs (e.g. `702369045530963`) or full Meta Ad Library URLs

## `countries` (type: `array`):

Pick one or more countries. Leave on **All countries** for worldwide. If you select multiple, the actor runs the search once per country and merges results (ScrapeCreators accepts one country at a time).

## `status` (type: `string`):

Only show ads that are currently running, or include paused/ended ads too.

## `maxItems` (type: `integer`):

Stops the run once this many ads are collected across **all** search terms. Use `0` for no limit. By default this budget is split evenly across your terms (e.g. 100 items / 8 terms ≈ 13 per term).

## `maxItemsPerTerm` (type: `integer`):

Hard cap for each individual search term. Use `0` (default) to auto-distribute the total budget evenly across your terms. Set an explicit number (e.g. `20`) if you want the same cap per term regardless of how many terms you add.

## `mediaType` (type: `string`):

Filter by creative format.

## `sortBy` (type: `string`):

Applies to ad-returning modes.

## `startDate` (type: `string`):

Only include ads running on or after this date. Click to pick from a calendar.

## `endDate` (type: `string`):

Only include ads running on or before this date. Click to pick from a calendar.

## `searchType` (type: `string`):

Only used when finding ads by keyword.

## `languages` (type: `array`):

Click to pick one or more languages to filter ads by. Only used when getting ads from a brand/page. Leave empty for no language filter. Multiple languages will fan out (one API call per language).

## `adType` (type: `string`):

Restrict to political / issue ads (they come with extra fields like spend and audience). Only used when finding ads by keyword.

## `getTranscript` (type: `boolean`):

Only used in 'Get full details for a specific ad'. Works on videos under 2 minutes.

## `trim` (type: `boolean`):

Strip rarely-used fields from each ad for a lighter dataset.

## `maxPagesPerQuery` (type: `integer`):

Safety cap on pagination per search term. Default 100 is plenty.

## Actor input object example

```json
{
  "searchMode": "search_ads",
  "searchTerms": [
    "nike"
  ],
  "countries": [
    "ALL"
  ],
  "status": "ACTIVE",
  "maxItems": 100,
  "maxItemsPerTerm": 0,
  "mediaType": "ALL",
  "sortBy": "total_impressions",
  "searchType": "keyword_unordered",
  "languages": [],
  "adType": "all",
  "getTranscript": false,
  "trim": false,
  "maxPagesPerQuery": 100
}
```

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "searchMode": "search_ads",
    "searchTerms": [
        "nike"
    ],
    "countries": [
        "ALL"
    ],
    "status": "ACTIVE",
    "maxItems": 100,
    "maxItemsPerTerm": 0,
    "mediaType": "ALL",
    "sortBy": "total_impressions",
    "searchType": "keyword_unordered",
    "adType": "all",
    "maxPagesPerQuery": 100
};

// Run the Actor and wait for it to finish
const run = await client.actor("unseenuser/meta-ads").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "searchMode": "search_ads",
    "searchTerms": ["nike"],
    "countries": ["ALL"],
    "status": "ACTIVE",
    "maxItems": 100,
    "maxItemsPerTerm": 0,
    "mediaType": "ALL",
    "sortBy": "total_impressions",
    "searchType": "keyword_unordered",
    "adType": "all",
    "maxPagesPerQuery": 100,
}

# Run the Actor and wait for it to finish
run = client.actor("unseenuser/meta-ads").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "searchMode": "search_ads",
  "searchTerms": [
    "nike"
  ],
  "countries": [
    "ALL"
  ],
  "status": "ACTIVE",
  "maxItems": 100,
  "maxItemsPerTerm": 0,
  "mediaType": "ALL",
  "sortBy": "total_impressions",
  "searchType": "keyword_unordered",
  "adType": "all",
  "maxPagesPerQuery": 100
}' |
apify call unseenuser/meta-ads --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=unseenuser/meta-ads",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Facebook & Instagram Ad Library Scraper [NO COOKIES] ✅",
        "description": "Extract every active ad across Meta - Facebook and Instagram. Pull full creatives, copy, CTAs, run dates, and EU spend/impression data. No Meta account, no Marketing API, no developer app required. Built for growth marketers, agencies, and e-commerce brands.",
        "version": "0.0",
        "x-build-id": "uC6ZgFWroeuwz3obn"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/unseenuser~meta-ads/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-unseenuser-meta-ads",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/unseenuser~meta-ads/runs": {
            "post": {
                "operationId": "runs-sync-unseenuser-meta-ads",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/unseenuser~meta-ads/run-sync": {
            "post": {
                "operationId": "run-sync-unseenuser-meta-ads",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "searchMode",
                    "searchTerms"
                ],
                "properties": {
                    "searchMode": {
                        "title": "What do you want to do?",
                        "enum": [
                            "search_ads",
                            "company_ads",
                            "search_companies",
                            "ad_details"
                        ],
                        "type": "string",
                        "description": "Pick one. The box below changes meaning based on your choice.",
                        "default": "search_ads"
                    },
                    "searchTerms": {
                        "title": "Search terms",
                        "type": "array",
                        "description": "One per line. What to put here depends on the mode above:\n\n• **Find ads by keyword** — keywords, e.g. `running shoes`, `skincare`\n• **Get all ads from a brand / page** — brand names (e.g. `Nike`) or numeric Facebook page IDs (e.g. `15087023444`). Names are auto-resolved to IDs.\n• **Look up a brand's Facebook page ID** — brand names, e.g. `nike`, `lululemon`\n• **Get full details for a specific ad** — ad IDs (e.g. `702369045530963`) or full Meta Ad Library URLs",
                        "items": {
                            "type": "string"
                        }
                    },
                    "countries": {
                        "title": "Countries",
                        "uniqueItems": true,
                        "type": "array",
                        "description": "Pick one or more countries. Leave on **All countries** for worldwide. If you select multiple, the actor runs the search once per country and merges results (ScrapeCreators accepts one country at a time).",
                        "items": {
                            "type": "string",
                            "enum": [
                                "ALL",
                                "US",
                                "GB",
                                "CA",
                                "AU",
                                "NZ",
                                "IE",
                                "DE",
                                "FR",
                                "ES",
                                "IT",
                                "NL",
                                "BE",
                                "CH",
                                "AT",
                                "PT",
                                "DK",
                                "SE",
                                "NO",
                                "FI",
                                "IS",
                                "PL",
                                "CZ",
                                "SK",
                                "HU",
                                "RO",
                                "BG",
                                "GR",
                                "HR",
                                "SI",
                                "EE",
                                "LV",
                                "LT",
                                "LU",
                                "MT",
                                "CY",
                                "BR",
                                "MX",
                                "AR",
                                "CL",
                                "CO",
                                "PE",
                                "VE",
                                "UY",
                                "PY",
                                "BO",
                                "EC",
                                "CR",
                                "PA",
                                "DO",
                                "GT",
                                "HN",
                                "SV",
                                "NI",
                                "CU",
                                "PR",
                                "IN",
                                "JP",
                                "KR",
                                "SG",
                                "MY",
                                "TH",
                                "ID",
                                "PH",
                                "VN",
                                "HK",
                                "TW",
                                "BD",
                                "PK",
                                "LK",
                                "NP",
                                "KH",
                                "LA",
                                "MM",
                                "AE",
                                "SA",
                                "QA",
                                "KW",
                                "BH",
                                "OM",
                                "JO",
                                "LB",
                                "IL",
                                "TR",
                                "EG",
                                "MA",
                                "TN",
                                "DZ",
                                "LY",
                                "SD",
                                "ZA",
                                "NG",
                                "KE",
                                "GH",
                                "ET",
                                "UG",
                                "TZ",
                                "CI",
                                "CM",
                                "SN",
                                "MU",
                                "RW",
                                "ZM",
                                "ZW",
                                "AO",
                                "MZ",
                                "BW",
                                "NA",
                                "RU",
                                "UA",
                                "BY",
                                "MD",
                                "GE",
                                "AM",
                                "AZ",
                                "KZ",
                                "UZ",
                                "KG",
                                "TJ",
                                "TM",
                                "MN",
                                "RS",
                                "BA",
                                "MK",
                                "AL",
                                "ME",
                                "XK",
                                "FJ",
                                "PG",
                                "NC",
                                "SB",
                                "VU",
                                "WS",
                                "TO"
                            ],
                            "enumTitles": [
                                "All countries",
                                "United States",
                                "United Kingdom",
                                "Canada",
                                "Australia",
                                "New Zealand",
                                "Ireland",
                                "Germany",
                                "France",
                                "Spain",
                                "Italy",
                                "Netherlands",
                                "Belgium",
                                "Switzerland",
                                "Austria",
                                "Portugal",
                                "Denmark",
                                "Sweden",
                                "Norway",
                                "Finland",
                                "Iceland",
                                "Poland",
                                "Czechia",
                                "Slovakia",
                                "Hungary",
                                "Romania",
                                "Bulgaria",
                                "Greece",
                                "Croatia",
                                "Slovenia",
                                "Estonia",
                                "Latvia",
                                "Lithuania",
                                "Luxembourg",
                                "Malta",
                                "Cyprus",
                                "Brazil",
                                "Mexico",
                                "Argentina",
                                "Chile",
                                "Colombia",
                                "Peru",
                                "Venezuela",
                                "Uruguay",
                                "Paraguay",
                                "Bolivia",
                                "Ecuador",
                                "Costa Rica",
                                "Panama",
                                "Dominican Republic",
                                "Guatemala",
                                "Honduras",
                                "El Salvador",
                                "Nicaragua",
                                "Cuba",
                                "Puerto Rico",
                                "India",
                                "Japan",
                                "South Korea",
                                "Singapore",
                                "Malaysia",
                                "Thailand",
                                "Indonesia",
                                "Philippines",
                                "Vietnam",
                                "Hong Kong",
                                "Taiwan",
                                "Bangladesh",
                                "Pakistan",
                                "Sri Lanka",
                                "Nepal",
                                "Cambodia",
                                "Laos",
                                "Myanmar",
                                "United Arab Emirates",
                                "Saudi Arabia",
                                "Qatar",
                                "Kuwait",
                                "Bahrain",
                                "Oman",
                                "Jordan",
                                "Lebanon",
                                "Israel",
                                "Turkey",
                                "Egypt",
                                "Morocco",
                                "Tunisia",
                                "Algeria",
                                "Libya",
                                "Sudan",
                                "South Africa",
                                "Nigeria",
                                "Kenya",
                                "Ghana",
                                "Ethiopia",
                                "Uganda",
                                "Tanzania",
                                "Ivory Coast",
                                "Cameroon",
                                "Senegal",
                                "Mauritius",
                                "Rwanda",
                                "Zambia",
                                "Zimbabwe",
                                "Angola",
                                "Mozambique",
                                "Botswana",
                                "Namibia",
                                "Russia",
                                "Ukraine",
                                "Belarus",
                                "Moldova",
                                "Georgia",
                                "Armenia",
                                "Azerbaijan",
                                "Kazakhstan",
                                "Uzbekistan",
                                "Kyrgyzstan",
                                "Tajikistan",
                                "Turkmenistan",
                                "Mongolia",
                                "Serbia",
                                "Bosnia & Herzegovina",
                                "North Macedonia",
                                "Albania",
                                "Montenegro",
                                "Kosovo",
                                "Fiji",
                                "Papua New Guinea",
                                "New Caledonia",
                                "Solomon Islands",
                                "Vanuatu",
                                "Samoa",
                                "Tonga"
                            ]
                        },
                        "default": [
                            "ALL"
                        ]
                    },
                    "status": {
                        "title": "Ad status",
                        "enum": [
                            "ACTIVE",
                            "INACTIVE",
                            "ALL"
                        ],
                        "type": "string",
                        "description": "Only show ads that are currently running, or include paused/ended ads too.",
                        "default": "ACTIVE"
                    },
                    "maxItems": {
                        "title": "Maximum ads to return (total)",
                        "minimum": 0,
                        "type": "integer",
                        "description": "Stops the run once this many ads are collected across **all** search terms. Use `0` for no limit. By default this budget is split evenly across your terms (e.g. 100 items / 8 terms ≈ 13 per term).",
                        "default": 100
                    },
                    "maxItemsPerTerm": {
                        "title": "Maximum ads per search term",
                        "minimum": 0,
                        "type": "integer",
                        "description": "Hard cap for each individual search term. Use `0` (default) to auto-distribute the total budget evenly across your terms. Set an explicit number (e.g. `20`) if you want the same cap per term regardless of how many terms you add.",
                        "default": 0
                    },
                    "mediaType": {
                        "title": "Media type",
                        "enum": [
                            "ALL",
                            "IMAGE",
                            "VIDEO",
                            "MEME",
                            "IMAGE_AND_MEME",
                            "NONE"
                        ],
                        "type": "string",
                        "description": "Filter by creative format.",
                        "default": "ALL"
                    },
                    "sortBy": {
                        "title": "Sort by",
                        "enum": [
                            "total_impressions",
                            "relevancy_monthly_grouped"
                        ],
                        "type": "string",
                        "description": "Applies to ad-returning modes.",
                        "default": "total_impressions"
                    },
                    "startDate": {
                        "title": "Start date",
                        "type": "string",
                        "description": "Only include ads running on or after this date. Click to pick from a calendar."
                    },
                    "endDate": {
                        "title": "End date",
                        "type": "string",
                        "description": "Only include ads running on or before this date. Click to pick from a calendar."
                    },
                    "searchType": {
                        "title": "Keyword match",
                        "enum": [
                            "keyword_unordered",
                            "keyword_exact_phrase"
                        ],
                        "type": "string",
                        "description": "Only used when finding ads by keyword.",
                        "default": "keyword_unordered"
                    },
                    "languages": {
                        "title": "Languages",
                        "uniqueItems": true,
                        "type": "array",
                        "description": "Click to pick one or more languages to filter ads by. Only used when getting ads from a brand/page. Leave empty for no language filter. Multiple languages will fan out (one API call per language).",
                        "items": {
                            "type": "string",
                            "enum": [
                                "EN",
                                "ES",
                                "FR",
                                "DE",
                                "IT",
                                "PT",
                                "NL",
                                "PL",
                                "RU",
                                "UK",
                                "TR",
                                "AR",
                                "HE",
                                "FA",
                                "ZH",
                                "JA",
                                "KO",
                                "VI",
                                "TH",
                                "ID",
                                "MS",
                                "HI",
                                "BN",
                                "UR",
                                "TA",
                                "TE",
                                "SV",
                                "NO",
                                "DA",
                                "FI",
                                "IS",
                                "CS",
                                "SK",
                                "HU",
                                "RO",
                                "BG",
                                "EL",
                                "HR",
                                "SR",
                                "SL",
                                "ET",
                                "LV",
                                "LT",
                                "SW",
                                "AM",
                                "YO",
                                "ZU",
                                "AF",
                                "CA",
                                "EU",
                                "GL",
                                "GA",
                                "CY"
                            ],
                            "enumTitles": [
                                "English",
                                "Spanish",
                                "French",
                                "German",
                                "Italian",
                                "Portuguese",
                                "Dutch",
                                "Polish",
                                "Russian",
                                "Ukrainian",
                                "Turkish",
                                "Arabic",
                                "Hebrew",
                                "Persian",
                                "Chinese",
                                "Japanese",
                                "Korean",
                                "Vietnamese",
                                "Thai",
                                "Indonesian",
                                "Malay",
                                "Hindi",
                                "Bengali",
                                "Urdu",
                                "Tamil",
                                "Telugu",
                                "Swedish",
                                "Norwegian",
                                "Danish",
                                "Finnish",
                                "Icelandic",
                                "Czech",
                                "Slovak",
                                "Hungarian",
                                "Romanian",
                                "Bulgarian",
                                "Greek",
                                "Croatian",
                                "Serbian",
                                "Slovenian",
                                "Estonian",
                                "Latvian",
                                "Lithuanian",
                                "Swahili",
                                "Amharic",
                                "Yoruba",
                                "Zulu",
                                "Afrikaans",
                                "Catalan",
                                "Basque",
                                "Galician",
                                "Irish",
                                "Welsh"
                            ]
                        },
                        "default": []
                    },
                    "adType": {
                        "title": "Ad category",
                        "enum": [
                            "all",
                            "political_and_issue_ads"
                        ],
                        "type": "string",
                        "description": "Restrict to political / issue ads (they come with extra fields like spend and audience). Only used when finding ads by keyword.",
                        "default": "all"
                    },
                    "getTranscript": {
                        "title": "Include video transcript",
                        "type": "boolean",
                        "description": "Only used in 'Get full details for a specific ad'. Works on videos under 2 minutes.",
                        "default": false
                    },
                    "trim": {
                        "title": "Smaller response",
                        "type": "boolean",
                        "description": "Strip rarely-used fields from each ad for a lighter dataset.",
                        "default": false
                    },
                    "maxPagesPerQuery": {
                        "title": "Max pages per term",
                        "minimum": 1,
                        "type": "integer",
                        "description": "Safety cap on pagination per search term. Default 100 is plenty.",
                        "default": 100
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
