# Meta/Facebook Ads Scraper (`thenetaji/meta-ads-scraper`) Actor

Scrape public Facebook and Instagram ads from Meta Ad Library by keyword or by pasting an Ad Library search URL. Filter by country, status, category, format, platform, and date, and optionally enrich each ad with full details. No Facebook login or Meta API key required.

- **URL**: https://apify.com/thenetaji/meta-ads-scraper.md
- **Developed by:** [The Netaji](https://apify.com/thenetaji) (community)
- **Categories:** Social media, Developer tools, Lead generation
- **Stats:** 3 total users, 2 monthly users, 87.5% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.50 / 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.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

**Meta Ads Scraper extracts public Facebook and Instagram ads from Meta Ad Library by keyword or Ad Library URL, with rich filters and optional per-ad detail enrichment.**

Use it as a Meta Ad Library scraper when you need structured Facebook and Instagram ad data inside Apify datasets. Enter a keyword or advertiser name, or paste a Meta Ad Library search URL and the Actor reads the filters from it automatically.

It is designed for marketers, agencies, researchers, data teams, and AI builders who need repeatable Meta ads data without maintaining custom scraping infrastructure. Turn on enrichment to attach full details to every returned ad.

### What is Meta Ad Library?

Meta Ad Library is Meta's public ad transparency database. It lists ads running across Facebook, Instagram, Messenger, and the Audience Network, including the advertiser page, media, and active status. You can browse it at https://www.facebook.com/ads/library/ without a Facebook login.

### What data can I extract with Meta Ads Scraper?

Meta Ads Scraper extracts the following data from Meta Ad Library:

- **Ad identity** - Ad archive IDs, page IDs, advertiser references, and dataset records for each returned ad.
- **Advertiser and page data** - Facebook page IDs, matching advertiser pages, and page-level records returned by page search and page browsing modes.
- **Ad creative and performance** - Ad status, start and end dates, publisher platforms, currency, spend and reach estimates, and the creative snapshot (body, title, call to action, images, and videos).
- **Enriched ad details** - When enrichment is enabled, each ad row also includes the full ad-details payload for that ad.

You can collect all of this without an API key, rate limits, or code.

### How can I use Meta Ad Library data?

- **Competitor ad research** - Monitor competitor creatives, messages, offers, landing pages, and advertiser activity across Meta platforms.
- **Market research** - Track how brands position products, which categories are active, and how campaign messaging changes by country or season.
- **Ad intelligence** - Build datasets for creative analysis, copywriting research, campaign monitoring, and paid social reporting.
- **Lead generation** - Find active advertisers and pages that are currently investing in Meta ads.
- **AI and analytics workflows** - Export structured ad data to train classifiers, enrich internal dashboards, or feed automated research agents.

### How to scrape Meta Ad Library

#### Step 1: Choose your input

Enter the Meta Ad Library search terms, IDs, or filters supported by this Actor.

#### Step 2: Set filters and limits

Adjust country, status, date, platform, page size, and max item settings to control the dataset and cost.

#### Step 3: Run the Actor

Start the run in Apify Console or call it through the Apify API.

#### Step 4: Export your data

Download results in JSON, CSV, Excel, XML, or HTML, or consume them through the Apify Dataset API.

### Meta Ads Scraper features

- **Search, browse, and enrich** - Search ads by keyword or Ad Library URL, browse every ad from an advertiser Page, find advertiser Pages by name, and optionally enrich each ad with full details.
- **Apify-ready datasets** - Results are saved to the default Apify dataset and can be downloaded as JSON, CSV, Excel, XML, or HTML.
- **Country and content filters** - Filter by country, ad status, ad type, media type, date range, language, publisher platform, and page IDs.
- **Pagination and limits** - Use page size, cursors, and max item limits to control run size and cost.
- **Automation support** - Run manually, schedule recurring runs, call the Actor through the Apify API, or trigger workflows with webhooks.

Built for reliable runs at scale: requests use proxy rotation, automatic retries, and pagination handling so large Meta Ad Library scrapes finish without manual babysitting.

### Input

Configure the run on the Actor's Input tab. Set the fields for your chosen mode, then start the run.

#### Search by keyword

Enter a keyword or advertiser name, then narrow results with optional filters.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `q` | string | No | Keyword, phrase, or advertiser name to search for in the Meta Ad Library. |
| `country` | string | No | ISO 3166-1 alpha-2 country code to target, e.g. US, IN, GB. |
| `active_status` | string | No | Return all ads, or only currently active or inactive ones. |
| `ad_type` | string | No | Limit results to a specific ad category, such as political and issue ads. |
| `search_type` | string | No | How to match your search query: keywords in any order, or the exact phrase. |
| `media_type` | string | No | Limit results to a creative format: images, videos, or memes. |
| `publisher_platforms` | array<string> | No | Only include ads shown on the selected Meta platforms. |
| `date_min` | string | No | Only include ads active on or after this date (YYYY-MM-DD). |
| `date_max` | string | No | Only include ads active on or before this date (YYYY-MM-DD). |
| `maxItems` | integer | No | Maximum number of results to return. Set 0 for no limit. |
| `enrichAdDetails` | boolean | No | Fetch full details for every returned ad (one extra request per ad — slower and billed as an ad-details enrichment). Leave off for fast, lightweight runs. |

#### Start from an Ad Library URL

Paste a Meta Ad Library search URL and its filters are applied automatically.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `startUrl` | string | No | Optional shortcut: paste a Meta Ad Library search URL (https://www.facebook.com/ads/library/?...) and its filters (query, country, ad type, media type, and more) are read from it automatically. Anything you set below overrides the URL. |
| `maxItems` | integer | No | Maximum number of results to return. Set 0 for no limit. |
| `enrichAdDetails` | boolean | No | Fetch full details for every returned ad (one extra request per ad — slower and billed as an ad-details enrichment). Leave off for fast, lightweight runs. |

#### Example input

```json
{
  "q": "running shoes",
  "country": "US",
  "active_status": "all",
  "maxItems": 50,
  "enrichAdDetails": false
}
````

### Output

Download results as JSON, CSV, Excel, XML, or HTML, or pull them from the Apify Dataset API.

#### 📦 Ad identity

| Field | Type | Description |
| --- | --- | --- |
| `ad_archive_id` | string,number,boolean,object,array,null | Unique ID of the ad in the Meta Ad Library. |
| `page_id` | string,number,boolean,object,array,null | Numeric ID of the advertiser's Facebook Page. |
| `page_name` | string,number,boolean,object,array,null | Name of the advertiser's Facebook Page. |

#### 📊 Ad status and performance

| Field | Type | Description |
| --- | --- | --- |
| `is_active` | string,number,boolean,object,array,null | Whether the ad is currently running. |
| `start_date` | string,number,boolean,object,array,null | Unix timestamp when the ad started running. |
| `end_date` | string,number,boolean,object,array,null | Unix timestamp when the ad stopped running (0 if still active). |
| `publisher_platform` | string,number,boolean,object,array,null | Meta platforms the ad ran on (Facebook, Instagram, etc.). |
| `spend` | string,number,boolean,object,array,null | Estimated spend range for the ad, when available. |
| `reach_estimate` | string,number,boolean,object,array,null | Estimated audience reach for the ad, when available. |

#### 🔍 Creative and enrichment

| Field | Type | Description |
| --- | --- | --- |
| `snapshot` | string,number,boolean,object,array,null | Ad creative: body text, title, call to action, images, videos, and link. |
| `details` | string,number,boolean,object,array,null | Full ad details, present only when 'Enrich with ad details' is enabled. |

#### Example output

```json
{
  "ad_archive_id": "123456789012345",
  "page_id": "102988293558",
  "page_name": "Nike",
  "is_active": true,
  "start_date": 1704067200,
  "publisher_platform": [
    "FACEBOOK",
    "INSTAGRAM"
  ]
}
```

### How much does it cost to scrape Meta Ad Library?

This Actor uses Apify pay-per-result pricing. You are charged for successful dataset results according to the Actor pricing shown on the Apify Pricing tab. Single-result modes return one dataset item, while search and page modes can return many items.

Apify's free plan includes monthly credits, which may cover small test runs and up to the free result allowance configured for the Actor.

Use the max item limit before large runs so you can control spend while testing keywords, countries, and advertiser pages.

### How does Meta Ads Scraper compare to other Meta Ad Library scrapers?

| Tool | Price / 1K | Fields | Key difference |
| --- | --- | --- | --- |
| Meta Ads Scraper (this Actor) | Apify pay-per-result | Ads, advertiser, status, dates, platforms, creative, optional details | Search by keyword or Ad Library URL and optionally enrich every ad with full details, without a Facebook login or developer API key. |
| Official Meta Ad Library API | Free but access-gated | Focused on political and issue ads | Requires a Meta developer account, identity verification, and approved access, and centers on authenticated political ad data. |

- Best when you want structured Meta ad data from a keyword or a pasted Ad Library URL.
- Choose the official API only if you specifically need Meta's verified political ad dataset.

### Meta Ads Scraper FAQ

#### Can I start from a Meta Ad Library URL?

Yes. Paste a Meta Ad Library search URL into Start URL and the Actor reads the query and filters from it. Anything you set in the form overrides the URL.

#### What does 'Enrich with ad details' do?

When enabled, the Actor makes one extra request per ad to fetch its full details and attaches them to the ad row. Leave it off for faster, cheaper runs.

#### Can I export Meta Ads data to CSV or Excel?

Yes. Apify datasets can be downloaded as JSON, CSV, Excel, XML, HTML, or accessed through the Dataset API.

#### Do I need a Meta API key?

No. You configure the Actor input in Apify and run it without providing a Meta developer API key.

#### Can I schedule recurring Meta Ads monitoring?

Yes. Use Apify schedules to run the Actor hourly, daily, weekly, or at any custom interval supported by Apify.

#### How do I control run cost?

Set maxItems for search and page browsing runs, keep page\_size conservative while testing, and expand limits after you confirm the input returns the data you need.

### Can I integrate Meta Ads Scraper with other apps?

Yes. Meta Ads Scraper works with Apify integrations and can send results to common automation, spreadsheet, database, and AI workflows.

- **Make, Zapier, and n8n** - Send ad results into campaign monitoring, CRM, enrichment, or reporting workflows.
- **Google Sheets and Airtable** - Keep competitor ad libraries and advertiser lists in shared tables.
- **Slack and email** - Notify your team when scheduled monitoring runs finish.
- **Apify API and webhooks** - Trigger runs from code and react to completed datasets automatically.
- **Apify MCP Server** - Let AI agents query fresh Meta Ads data through Apify.

### Can I use Meta Ads Scraper with the Apify API?

Yes. Meta Ads Scraper can be run programmatically with the Apify API. You can also schedule recurring runs, trigger runs with webhooks, and export data through the Dataset API.

#### Python

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_APIFY_API_TOKEN")

run = client.actor("thenetaji/meta-ads-scraper").call(run_input={
    "q": "running shoes",
    "country": "US",
    "active_status": "all",
    "maxItems": 50,
    "enrichAdDetails": false
})

for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)
```

#### Node.js

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

const client = new ApifyClient({ token: "YOUR_APIFY_API_TOKEN" });

const run = await client.actor("thenetaji/meta-ads-scraper").call({
  "q": "running shoes",
  "country": "US",
  "active_status": "all",
  "maxItems": 50,
  "enrichAdDetails": false
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

### Can I use Meta Ads Scraper through an MCP server?

Yes. AI agents can call this Actor through the Apify MCP server. Point your MCP client at the Apify MCP server (https://mcp.apify.com) and enable the Actor as a tool so agents can pull fresh Meta Ad Library data on demand.

### Is it legal to scrape Meta Ad Library?

This Actor extracts publicly available information from Meta Ad Library pages and related public ad transparency data. It does not require a Facebook login and should not be used to collect private user data. Your results may still contain personal data or regulated advertising information, so make sure your use case complies with GDPR, other privacy laws, Meta terms, and your own legal obligations. If you are unsure, consult a qualified lawyer.

### Your feedback

Use the Issues tab on the Actor page for bug reports, missing fields, and feature requests.

### You might also like

- [Instagram Scraper](https://apify.com/apify/instagram-scraper) - Scrape Instagram profiles, posts, comments, hashtags, and places.
- [Facebook Posts Scraper](https://apify.com/apify/facebook-posts-scraper) - Extract public Facebook posts and engagement data.
- [Google Search Results Scraper](https://apify.com/apify/google-search-scraper) - Collect organic and paid Google search result data.

*Last updated:* 2026-07-02

*Keywords:* Meta Ads Scraper, Meta Ad Library scraper, Facebook Ads Library scraper, Meta ads API alternative, scrape Meta ads, Facebook ad intelligence

# Actor input Schema

## `q` (type: `string`):

Keyword, phrase, or advertiser name to search for in the Meta Ad Library.

## `startUrl` (type: `string`):

Optional shortcut: paste a Meta Ad Library search URL (https://www.facebook.com/ads/library/?...) and its filters (query, country, ad type, media type, and more) are read from it automatically. Anything you set below overrides the URL.

## `country` (type: `string`):

ISO 3166-1 alpha-2 country code to target, e.g. US, IN, GB.

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

Maximum number of results to return. Set 0 for no limit.

## `enrichAdDetails` (type: `boolean`):

Fetch full details for every returned ad (one extra request per ad — slower and billed as an ad-details enrichment). Leave off for fast, lightweight runs.

## `active_status` (type: `string`):

Return all ads, or only currently active or inactive ones.

## `ad_type` (type: `string`):

Limit results to a specific ad category, such as political and issue ads.

## `media_type` (type: `string`):

Limit results to a creative format: images, videos, or memes.

## `search_type` (type: `string`):

How to match your search query: keywords in any order, or the exact phrase.

## `publisher_platforms` (type: `array`):

Only include ads shown on the selected Meta platforms.

## `content_languages` (type: `string`):

Comma-separated ISO 639-1 language codes to include, e.g. en,hi,es.

## `date_min` (type: `string`):

Only include ads active on or after this date (YYYY-MM-DD).

## `date_max` (type: `string`):

Only include ads active on or before this date (YYYY-MM-DD).

## `page_ids` (type: `string`):

Comma-separated Facebook Page IDs to restrict results to specific advertisers.

## `is_targeted_country` (type: `boolean`):

Only show ads that specifically target the selected country.

## `potential_reach_min` (type: `integer`):

Only include ads with at least this estimated audience size.

## `potential_reach_max` (type: `integer`):

Only include ads with at most this estimated audience size.

## `sort_mode` (type: `string`):

Order results by a metric. Leave empty for the default order.

## `sort_direction` (type: `string`):

Direction to sort in when Sort By is set.

## Actor input object example

```json
{
  "q": "Nike",
  "startUrl": "https://www.facebook.com/ads/library/?q=running%20shoes&country=US",
  "country": "US",
  "maxItems": 10,
  "enrichAdDetails": false,
  "active_status": "all",
  "ad_type": "ALL",
  "media_type": "all",
  "content_languages": "en,hi",
  "date_min": "2024-01-01",
  "date_max": "2024-12-31",
  "page_ids": "123456789,987654321",
  "is_targeted_country": false
}
```

# Actor output Schema

## `dataset` (type: `string`):

Dataset containing all scraped data

# 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 = {
    "q": "Nike",
    "maxItems": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("thenetaji/meta-ads-scraper").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 = {
    "q": "Nike",
    "maxItems": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("thenetaji/meta-ads-scraper").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 '{
  "q": "Nike",
  "maxItems": 10
}' |
apify call thenetaji/meta-ads-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Meta/Facebook Ads Scraper",
        "description": "Scrape public Facebook and Instagram ads from Meta Ad Library by keyword or by pasting an Ad Library search URL. Filter by country, status, category, format, platform, and date, and optionally enrich each ad with full details. No Facebook login or Meta API key required.",
        "version": "0.1",
        "x-build-id": "lHkWhAcYcoLPmj7D0"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/thenetaji~meta-ads-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-thenetaji-meta-ads-scraper",
                "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/thenetaji~meta-ads-scraper/runs": {
            "post": {
                "operationId": "runs-sync-thenetaji-meta-ads-scraper",
                "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/thenetaji~meta-ads-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-thenetaji-meta-ads-scraper",
                "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",
                "properties": {
                    "q": {
                        "title": "Search Query",
                        "type": "string",
                        "description": "Keyword, phrase, or advertiser name to search for in the Meta Ad Library."
                    },
                    "startUrl": {
                        "title": "Start URL",
                        "type": "string",
                        "description": "Optional shortcut: paste a Meta Ad Library search URL (https://www.facebook.com/ads/library/?...) and its filters (query, country, ad type, media type, and more) are read from it automatically. Anything you set below overrides the URL."
                    },
                    "country": {
                        "title": "Country",
                        "type": "string",
                        "description": "ISO 3166-1 alpha-2 country code to target, e.g. US, IN, GB.",
                        "default": "US"
                    },
                    "maxItems": {
                        "title": "Max Results",
                        "minimum": 0,
                        "type": "integer",
                        "description": "Maximum number of results to return. Set 0 for no limit.",
                        "default": 50
                    },
                    "enrichAdDetails": {
                        "title": "Enrich with ad details",
                        "type": "boolean",
                        "description": "Fetch full details for every returned ad (one extra request per ad — slower and billed as an ad-details enrichment). Leave off for fast, lightweight runs.",
                        "default": false
                    },
                    "active_status": {
                        "title": "Ad Status",
                        "enum": [
                            "all",
                            "active",
                            "inactive"
                        ],
                        "type": "string",
                        "description": "Return all ads, or only currently active or inactive ones.",
                        "default": "all"
                    },
                    "ad_type": {
                        "title": "Ad Category",
                        "enum": [
                            "ALL",
                            "POLITICAL_AND_ISSUE_ADS",
                            "HOUSING_ADS",
                            "EMPLOYMENT_ADS",
                            "CREDIT_ADS"
                        ],
                        "type": "string",
                        "description": "Limit results to a specific ad category, such as political and issue ads.",
                        "default": "ALL"
                    },
                    "media_type": {
                        "title": "Creative Format",
                        "enum": [
                            "all",
                            "image",
                            "video",
                            "meme"
                        ],
                        "type": "string",
                        "description": "Limit results to a creative format: images, videos, or memes.",
                        "default": "all"
                    },
                    "search_type": {
                        "title": "Keyword Match",
                        "enum": [
                            "keyword_unordered",
                            "keyword_exact_phrase"
                        ],
                        "type": "string",
                        "description": "How to match your search query: keywords in any order, or the exact phrase."
                    },
                    "publisher_platforms": {
                        "title": "Platforms",
                        "type": "array",
                        "description": "Only include ads shown on the selected Meta platforms.",
                        "items": {
                            "type": "string",
                            "enum": [
                                "FACEBOOK",
                                "INSTAGRAM",
                                "AUDIENCE_NETWORK",
                                "MESSENGER"
                            ],
                            "enumTitles": [
                                "Facebook",
                                "Instagram",
                                "Audience Network",
                                "Messenger"
                            ]
                        }
                    },
                    "content_languages": {
                        "title": "Ad Languages",
                        "type": "string",
                        "description": "Comma-separated ISO 639-1 language codes to include, e.g. en,hi,es."
                    },
                    "date_min": {
                        "title": "Start Date",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                        "type": "string",
                        "description": "Only include ads active on or after this date (YYYY-MM-DD)."
                    },
                    "date_max": {
                        "title": "End Date",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                        "type": "string",
                        "description": "Only include ads active on or before this date (YYYY-MM-DD)."
                    },
                    "page_ids": {
                        "title": "Filter by Page IDs",
                        "type": "string",
                        "description": "Comma-separated Facebook Page IDs to restrict results to specific advertisers."
                    },
                    "is_targeted_country": {
                        "title": "Targeted Country Only",
                        "type": "boolean",
                        "description": "Only show ads that specifically target the selected country.",
                        "default": false
                    },
                    "potential_reach_min": {
                        "title": "Min Audience Size",
                        "type": "integer",
                        "description": "Only include ads with at least this estimated audience size."
                    },
                    "potential_reach_max": {
                        "title": "Max Audience Size",
                        "type": "integer",
                        "description": "Only include ads with at most this estimated audience size."
                    },
                    "sort_mode": {
                        "title": "Sort By",
                        "enum": [
                            "total_impressions"
                        ],
                        "type": "string",
                        "description": "Order results by a metric. Leave empty for the default order."
                    },
                    "sort_direction": {
                        "title": "Sort Direction",
                        "enum": [
                            "desc"
                        ],
                        "type": "string",
                        "description": "Direction to sort in when Sort By is set."
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
