# Facebook Ads Library Scraper (`data_minds/facebook-ads-library-scraper`) Actor

Scrape public ads from the Meta Ad Library with no login or cookies. Get ad copy, creatives, landing pages, run dates, advertiser profile, spend and EU reach from keywords, pages or Ad Library links. Bulk input, auto proxy fallback. Export JSON, CSV or Excel.

- **URL**: https://apify.com/data_minds/facebook-ads-library-scraper.md
- **Developed by:** [Data Minds](https://apify.com/data_minds) (community)
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.70 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## 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.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

### What is Facebook Ads Library Scraper?

**Facebook Ads Library Scraper** turns the public [Meta Ad Library](https://www.facebook.com/ads/library/) into a clean dataset for competitor ad research. Enter a keyword, a Facebook page or an Ad Library link, choose a country, and get ad copy, creatives, landing pages, run dates, advertiser profiles and, where Meta publishes it, ad spend and EU ad reach. No Facebook account is needed. Pricing starts at $3.50 per 1,000 ads on the Free plan and falls to $2.70 on Gold.

Just enter a keyword such as `nike` and click Start. No coding needed.

- 🔍 **Competitor ad research:** see every ad a rival runs, how long each ad has been running and where it sends people.
- 🎨 **Ad creative inspiration:** collect ad copy, headlines, buttons, images and video links to brief designers and copywriters.
- 📈 **Ad spend and reach tracking:** read spend, impressions and reach ranges plus the EU, UK and Brazil reach breakdown where Meta publishes them.
- 🎯 **Landing page analysis:** list the landing page and landing domain behind each ad to study offers and funnels.
- 🏢 **Advertiser research:** get the advertiser profile, page likes, verification, Instagram account and payer details for lead generation and market research.

It works as a bulk Facebook ads scraper, so you can schedule runs and connect it to other tools. You can also scrape Meta ads and export the Facebook ad library data to Excel, CSV or JSON.

#### What can Facebook Ads Library Scraper do?

- 🔎 **Search by keyword, Facebook page or Ad Library link**, mixed freely in one run, in one country or all countries
- 🚦 **Filter ads** by active or inactive status, media type, and the days the ads ran
- 🏆 **Sort results** by impressions or relevance
- 💎 **Add ad details** such as advertiser profile, payer and beneficiary, and reach by country, age and gender
- 📦 **Export Facebook ad library data** to JSON, CSV, Excel, XML or HTML
- 👥 **Get separate tables** for advertisers, reach breakdown and the status of each input entry

***

### What data can Facebook Ads Library Scraper extract?

Every ad from the Facebook ads archive is one row of Facebook ads transparency data. The main dataset has these fields:

| Data | Field names |
|---|---|
| 🔗 Input and ad identity | `inputUrl`, `adArchiveID`, `adLibraryUrl`, `pageID`, `pageName` |
| 🚦 Status and dates | `isActive`, `startDateFormatted`, `endDateFormatted`, `daysRunning`, `totalActiveTimeSeconds` |
| 📱 Platforms and type | `publisherPlatform`, `creativeType`, `similarAdsCount`, `cardCount`, `collationId` |
| 📝 Ad copy | `adText`, `headline`, `linkDescription`, `ctaText`, `ctaType` |
| 🌐 Landing page | `landingUrl`, `landingDomain` |
| 📸 Media | `imageUrls`, `videoUrls`, `videoPreviewUrls` |
| 💲 Spend | `spend`, `spendLower`, `spendUpper`, `currency` |
| 👀 Reach and impressions | `reachEstimate`, `reachLower`, `reachUpper`, `impressions`, `impressionsLower`, `impressionsUpper`, `targetedOrReachedCountries`, `categories` |
| 🏢 Advertiser | `advertiser`, `payerBeneficiary`, `pageLifetimeSpendByDisclaimer` |
| 🔍 Transparency | `euTransparency`, `ukTransparency`, `brazilTransparency`, `audienceInsights`, `verifiedVoiceTypes`, `isTakenDown`, `stateMediaLabel`, `reportCount`, `containsSensitiveContent`, `isAiGenerated` |
| 📂 Other | `searchTotalResults`, `snapshot` |

The `advertiser` object holds `pageId`, `pageName`, `pageUrl`, `pageAlias`, `category`, `likes`, `verification`, `instagramUsername`, `instagramFollowers`, `instagramVerified`, `about` and `profilePictureUrl`. With ad details on, it can also hold `isDeleted`, `isRestricted` and `coverPhotoUrl`.

> **Note:** Spend, impressions and reach figures are published mostly for political and social-issue ads, so they are empty for many ads. Advertiser profile, payer, EU, UK and Brazil reach, and audience insights come from the ad details option and stay empty when it is off or when Meta does not publish them.

#### What data can't Facebook Ads Library Scraper extract?

- Exact spend for ads where Meta publishes no figures. You get ranges only where Meta shows them.
- Results ordered newest first. The Ad Library offers only impressions and relevance order.
- Private or logged-in Facebook data. The Actor works without a Facebook account, so it covers only what the Ad Library shows publicly.

For public page data, try [Facebook Pages Scraper](https://apify.com/data_minds/facebook-pages-scraper).

***

### How to scrape Facebook Ads Library data

This Actor is designed for an easy start, even if you have never extracted data from the web before.

1. [Create a free Apify account](https://console.apify.com/sign-up) using your email.
2. Open [Facebook Ads Library Scraper](https://apify.com/data_minds/facebook-ads-library-scraper).
3. Add one or more keywords, Facebook page links, page ids or Ad Library links to `urls`.
4. Choose the `country` and set `resultsLimit`. Optionally set `activeStatus`, `mediaType` and the date fields.
5. Click **Start** and wait for the run to finish.
6. Open the Output tab and download your data in JSON, CSV, Excel, XML or HTML.

***

### How much does it cost to scrape Facebook ads?

The Actor uses a **pay-per-event** pricing model: you pay for each ad saved to the dataset, plus a small start charge per run. Platform usage is billed in addition. The price per ad depends on your Apify plan:

| Plan | Price per ad | Price per 1,000 ads |
|---|---|---|
| Free | $0.0035 | $3.50 |
| Bronze | $0.0032 | $3.20 |
| Silver | $0.003 | $3.00 |
| Gold | $0.0027 | $2.70 |

The start charge is $0.00005 per GB of memory with a minimum of one event. This Actor runs with 4096 MB by default, so each run starts with 4 events, which is $0.0002.

**Example:** on the Free plan, a run that saves 1,000 ads costs $3.50 for the results plus $0.0002 for the start, with platform usage billed in addition. The default run of 10 ads costs $0.035 for the results on the Free plan.

See the [pricing tab](https://apify.com/data_minds/facebook-ads-library-scraper/pricing) for all events.

#### Is scraping Facebook ads free?

You can start for free. The Apify Free plan includes $5 in monthly credit, which covers about 1,428 ads at the Free price of $0.0035 per ad, before platform usage. Paid plans lower the price per ad down to $2.70 per 1,000 ads on Gold.

***

### Input

To run it you only need `urls`: one or more keywords, Facebook page links, numeric page ids or Ad Library links. Set the input in the Actor interface or send it as JSON through the API. This is the default input, which returns 10 ads for the keyword `nike` in the United States:

```json
{
  "urls": ["nike"],
  "country": "US",
  "resultsLimit": 10,
  "isDetailsPerAd": true,
  "activeStatus": "all",
  "sorting": "impressions",
  "mediaType": "all"
}
```

See the [input tab](https://apify.com/data_minds/facebook-ads-library-scraper/input-schema) for a full description of every field.

| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| `urls` | array | Yes | `["nike"]` (prefill) | Keywords, Facebook page links, numeric page ids or Ad Library links, one per line |
| `country` | string | No | `US` | Country where the ads ran, or `ALL` for every country |
| `resultsLimit` | integer | No | `10` | Total ads to return across all entries; `0` returns every ad available |
| `isDetailsPerAd` | boolean | No | `true` | Adds advertiser profile, payer and beneficiary, and reach breakdown; slower |
| `activeStatus` | string | No | `all` | `all`, `active` or `inactive` |
| `sorting` | string | No | `impressions` | `impressions` or `relevance` |
| `mediaType` | string | No | `all` | `all`, `image`, `video`, `meme`, `image_and_meme` or `none` |
| `onlyAdsNewerThan` | string | No | none | Ads running on or after this day (Pacific time) |
| `onlyAdsOlderThan` | string | No | none | Ads running on or before this day (Pacific time) |
| `proxyConfiguration` | object | No | `{"useApifyProxy": false}` | Optional connection settings; the default works for most runs |

#### urls

Mix keywords, page links, page ids and Ad Library links in one list.

- ✅ Good: `nike`, `https://www.facebook.com/adidas`, `1234567890`
- ❌ Bad: `https://example.com/shoes` (a link that is not a Facebook page or Ad Library link is skipped)

> **Warning:** A link copied from the Ad Library keeps its own country, status and order, so `country`, `activeStatus` and `sorting` are ignored for that entry.

#### onlyAdsNewerThan and onlyAdsOlderThan

Use a date or a relative value.

- ✅ Good: `2025-01-31` or `30 days` or `2 months`
- ❌ Bad: `last month` or `31/01/2025`

***

### Output

Results are stored in a dataset in the **Output** tab. You can view them as tables (Overview, Creatives, Spend & reach, Advertisers, Transparency, Landing pages, All fields), pick only the fields you need, and download them in JSON, CSV, Excel, XML or HTML. Use it as a Meta ad library API alternative when you need the data in your own tools. Three extra tables are filled in the same run: advertisers, reach breakdown and searches.

#### JSON example

Results for the input example above:

```json
{
  "inputUrl": "nike",
  "adArchiveID": "1234567890123456",
  "adLibraryUrl": "https://www.facebook.com/ads/library/?id=1234567890123456",
  "pageID": "1122334455",
  "pageName": "Example Brand",
  "isActive": true,
  "startDateFormatted": "2026-09-01",
  "endDateFormatted": null,
  "daysRunning": 55,
  "publisherPlatform": ["FACEBOOK", "INSTAGRAM"],
  "creativeType": "image",
  "adText": "Example ad text.",
  "headline": "Example headline",
  "linkDescription": "Example link description",
  "ctaText": "Shop Now",
  "ctaType": "SHOP_NOW",
  "landingUrl": "https://example.com/shop",
  "landingDomain": "example.com",
  "imageUrls": ["https://example.com/ad-image.jpg"],
  "videoUrls": null,
  "videoPreviewUrls": null,
  "cardCount": null,
  "similarAdsCount": 3,
  "spend": null,
  "spendLower": null,
  "spendUpper": null,
  "currency": null,
  "reachEstimate": null,
  "reachLower": null,
  "reachUpper": null,
  "impressions": null,
  "impressionsLower": null,
  "impressionsUpper": null,
  "totalActiveTimeSeconds": 4752000,
  "isAiGenerated": null,
  "containsSensitiveContent": null,
  "reportCount": null,
  "stateMediaLabel": null,
  "targetedOrReachedCountries": null,
  "categories": null,
  "advertiser": {
    "pageId": "1122334455",
    "pageName": "Example Brand",
    "pageUrl": "https://example.com/examplebrand",
    "pageAlias": "examplebrand",
    "category": "Retail",
    "likes": 120000,
    "verification": "BLUE_VERIFIED",
    "instagramUsername": "examplebrand",
    "instagramFollowers": 250000,
    "instagramVerified": true,
    "about": "Example about text",
    "profilePictureUrl": "https://example.com/logo.jpg"
  },
  "euTransparency": null,
  "ukTransparency": null,
  "brazilTransparency": null,
  "audienceInsights": null,
  "verifiedVoiceTypes": null,
  "payerBeneficiary": [{"payer": "Example Brand Inc", "beneficiary": "Example Brand Inc"}],
  "pageLifetimeSpendByDisclaimer": null,
  "isTakenDown": false,
  "searchTotalResults": 1200,
  "collationId": "9876543210",
  "snapshot": {"displayFormat": "IMAGE"}
}
```

The advertisers table has one row per advertiser:

```json
{
  "inputUrl": "nike",
  "pageId": "1122334455",
  "pageName": "Example Brand",
  "pageUrl": "https://example.com/examplebrand",
  "pageAlias": "examplebrand",
  "category": "Retail",
  "likes": 120000,
  "verification": "BLUE_VERIFIED",
  "instagramUsername": "examplebrand",
  "instagramFollowers": 250000,
  "instagramVerified": true,
  "about": "Example about text",
  "profilePictureUrl": "https://example.com/logo.jpg",
  "pageLifetimeSpendByDisclaimer": null
}
```

The reach breakdown table has one row per region, country, age range and gender split, for ads with EU, UK or Brazil data:

```json
{
  "adArchiveID": "1234567890123456",
  "pageName": "Example Brand",
  "region": "EU",
  "country": "DE",
  "ageRange": "25-34",
  "male": 1200,
  "female": 1500,
  "unknown": 10,
  "total": 2710,
  "regionTotalReach": 50000
}
```

The searches table has one row per input entry:

```json
{
  "input": "nike",
  "inputType": "keyword",
  "status": "ok",
  "adsCollected": 10,
  "searchTotalResults": 1200,
  "network": null,
  "error": null
}
```

#### Notes and limitations

- Only ads saved to the main dataset are charged. The advertisers, reach breakdown and searches tables are filled alongside it.
- `resultsLimit` applies to the whole run across all entries. The run also stops when the maximum cost you set for the run is reached, and the ads collected so far are saved.
- Facebook ads library to CSV, Excel or JSON works through the Output tab export. Entries that cannot be searched are listed in the searches table with a status of `skipped`, `failed` or `not searched` and an `error` text.
- Ad details are fetched for the ads returned. If they are unavailable, the advertiser profile and reach fields stay empty and the run continues.

***

### Tips and advanced usage

#### How many ads can you scrape per run?

Set `resultsLimit` to `0` to return every ad available for each entry. The number depends on how many ads match your keyword, country and filters; the `searchTotalResults` field shows the total the Ad Library reports. The best way to know for your use case is a quick test run.

#### Run it as a Facebook ads scraper online

You can run this Facebook ads extractor online from the Apify Console, with nothing to install.

#### How to get faster or cheaper results

- Turn `isDetailsPerAd` off for the fastest run when you only need ad copy, creatives and landing pages.
- Keep `resultsLimit` low for tests; you pay per saved ad.
- Use `activeStatus`, `mediaType` and the date fields to collect only the ads you need.

***

### Integrations and API

#### Can I use Facebook Ads Library Scraper as an API?

Yes. The [Apify API](https://docs.apify.com/api/v2) gives you programmatic access to the Actor, a Facebook ads library API of your own: start runs, schedule them and fetch results. Use the `apify-client` package for Node.js or Python. See the [API tab](https://apify.com/data_minds/facebook-ads-library-scraper/api) for ready-to-use code.

#### How to scrape Facebook ads with Python

This Facebook ads library Python example runs the Actor and prints every ad.

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_APIFY_TOKEN>")
run = client.actor("data_minds/facebook-ads-library-scraper").call(run_input={
    "urls": ["nike"],
    "country": "US",
    "resultsLimit": 10,
    "isDetailsPerAd": True,
    "activeStatus": "all",
    "sorting": "impressions",
    "mediaType": "all",
})

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

#### Can I integrate Facebook Ads Library Scraper with other apps?

Yes. Connect it with cloud services such as Make, Zapier, Google Sheets and Slack through Apify integrations. Use [webhooks](https://docs.apify.com/integrations/webhooks) to trigger an action when a run finishes, and schedule runs to monitor competitor ads over time.

#### Can I use Facebook Ads Library Scraper with AI agents (MCP)?

Yes. Connect it to Claude and other AI assistants through the Apify MCP server. Open the [MCP tab](https://apify.com/data_minds/facebook-ads-library-scraper/api/mcp) for setup steps.

***

### Other Facebook scrapers

| | |
|---|---|
| 📅 [Facebook Event Scraper](https://apify.com/data_minds/facebook-event-scraper): public events with dates, places and organizers | 📢 [LinkedIn Ads Library Scraper](https://apify.com/data_minds/linkedin-ads-library-scraper): ad copy, creatives and advertiser details from the LinkedIn Ad Library |
| 📄 [Facebook Pages Scraper](https://apify.com/data_minds/facebook-pages-scraper): public Facebook page data in bulk | 🎬 [Facebook Reels Scraper](https://apify.com/data_minds/facebook-reels-scraper): reels from public pages, profiles or reel links |
| 🔗 [Facebook Reels Scraper](https://apify.com/data_minds/facebook-reels-scraper) | Scrape Facebook Reels from any public page, profile or reel URL: captions, play counts, reactions, comments, shares, HD/SD video links... |
| 🔗 [Instagram Scraper](https://apify.com/data_minds/instagram-scraper) | Scrape public Instagram profiles, posts, reels, comments, hashtags, topics and places: followers, bio contacts, likes, plays, captions, media... |
| 🔗 [LinkedIn Ads Library Scraper](https://apify.com/data_minds/linkedin-ads-library-scraper) | Scrape the LinkedIn Ad Library — ad copy, headlines, creatives, CTAs, advertiser and payer, impressions by country, targeting and run dates —... |

***

### FAQ

#### Is it legal to scrape the Facebook Ad Library?

Web scraping is generally legal when you extract publicly available data. The Ad Library is public, but you should respect personal data rules such as GDPR, intellectual property and Meta's terms. Read [Is web scraping legal?](https://blog.apify.com/is-web-scraping-legal/) for background. This is not legal advice.

#### How does it work?

You give it keywords, Facebook pages or Ad Library links, a country and optional filters. It collects the matching public ads and saves one row per ad with copy, creatives, landing pages, dates and advertiser details. Results appear in the dataset while the run is going, ready to export.

#### Why scrape Facebook ads data?

Marketers and agencies use Facebook ads data for competitor ad research, creative inspiration and media buying research. It shows what rivals run, how long ads stay live and which landing pages they use. Researchers also use it for brand monitoring and political ad transparency studies.

#### Is the Facebook Ad Library free?

The Ad Library itself is public, but copying results by hand is slow. This Actor automates it on a pay-per-ad basis, and the Apify Free plan includes $5 in monthly credit that covers about 1,428 ads before platform usage. Check the pricing section for every plan.

#### How do I export Facebook Ad Library data to Excel or CSV?

Run the Actor, open the Output tab and choose Export. You can download the dataset as Excel, CSV, JSON, XML or HTML, and select only the fields you need. You can also fetch the same data through the Apify API for use in spreadsheets or dashboards.

#### Why am I getting fewer ads than expected?

Check that your keyword matches ads in the chosen country, and that `activeStatus`, `mediaType` and the date fields are not too narrow. Also check `resultsLimit` and your run's maximum cost. The searches table shows the status and the Ad Library total for each entry.

#### Does it show ad spend and reach?

Only where Meta publishes it. Spend, impressions and reach ranges are mostly available for political and social-issue ads, and EU, UK and Brazil reach appears for ads with transparency data. Other ads return empty values in those fields, so do not expect spend for every ad.

#### What if it is not working?

Re-run with a small `resultsLimit` and a simple keyword to confirm your input is valid, then read the run log. If the problem continues, open an issue on the Issues tab with your run link and input, and we will look into it.

***

### Support and feedback

Found a bug or have a feature request? Please create an issue on the [Issues tab](https://apify.com/data_minds/facebook-ads-library-scraper/issues/open).

Need a **custom solution** or more data? Contact us at hello.dataminds@gmail.com.

Built and maintained by the data_minds team on [Apify](https://apify.com/data_minds).

This Actor is an independent tool and is not affiliated with or endorsed by Meta or Facebook. Use the data in line with the applicable laws and platform terms.

# Actor input Schema

## `urls` (type: `array`):

One entry per line, mix freely. Accepts: a keyword (e.g. nike), a Facebook page link (https://www.facebook.com/adidas), a numeric page id, or a link copied from facebook.com/ads/library (its own filters are kept). Use Bulk edit to paste many at once.

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

Only ads delivered in this country. Choose All countries to search every country at once. A pasted Ad Library link keeps its own country.

## `resultsLimit` (type: `integer`):

Total number of ads to return across all entries. 0 = every ad available.

## `isDetailsPerAd` (type: `boolean`):

Adds the advertiser profile (Instagram account and followers, page likes, verification, about text), payer and beneficiary, and the EU / UK / Brazil reach breakdown by country, age and gender when Meta publishes it. Makes the run slower; turn off for the fastest run.

## `activeStatus` (type: `string`):

Keep only ads that are still running, only ads that have stopped, or both. Ignored when a pasted Ad Library link already sets a status.

## `sorting` (type: `string`):

Order of the results: most impressions first, or most relevant first. The Ad Library itself offers no newest-first order. Ignored when a pasted Ad Library link already sets an order.

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

Keep only ads with this kind of creative.

## `onlyAdsNewerThan` (type: `string`):

Only ads that were running on or after this day (Pacific time). Use a date like 2025-01-31 or a relative value like 30 days or 2 months.

## `onlyAdsOlderThan` (type: `string`):

Only ads that were running on or before this day (Pacific time). Same formats as the field above.

## `proxyConfiguration` (type: `object`):

Optional connection settings. The default works for most runs.

## Actor input object example

```json
{
  "urls": [
    "nike"
  ],
  "country": "US",
  "resultsLimit": 10,
  "isDetailsPerAd": true,
  "activeStatus": "all",
  "sorting": "impressions",
  "mediaType": "all",
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `overview` (type: `string`):

No description

## `creatives` (type: `string`):

No description

## `performance` (type: `string`):

No description

## `advertiserView` (type: `string`):

No description

## `transparency` (type: `string`):

No description

## `landing` (type: `string`):

No description

## `all` (type: `string`):

No description

## `advertisers` (type: `string`):

One row per advertiser.

## `reachBreakdown` (type: `string`):

Reach by country, age and gender.

## `searches` (type: `string`):

Status of every input entry.

# 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 = {
    "urls": [
        "nike"
    ],
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("data_minds/facebook-ads-library-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 = {
    "urls": ["nike"],
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("data_minds/facebook-ads-library-scraper").call(run_input=run_input)

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

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

```

## CLI example

```bash
echo '{
  "urls": [
    "nike"
  ],
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call data_minds/facebook-ads-library-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,data_minds/facebook-ads-library-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/aqyCWDfZ6q6pguW8u/builds/yjDEXoCNV8Bo7PpoV/openapi.json
