# Meta | Facebook Ads Library Scraper (`parsebird/facebook-ads-library-scraper`) Actor

Scrape the Meta Ad Library by search URL, Facebook Page or Instagram profile: ad copy, images, videos, CTA, landing links, dates, platforms, plus EU reach, age and gender breakdowns and payer data. Export JSON, CSV, Excel.

- **URL**: https://apify.com/parsebird/facebook-ads-library-scraper.md
- **Developed by:** [ParseBird](https://apify.com/parsebird) (community)
- **Stats:** 5 total users, 5 monthly users, 99.6% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.39 / 1,000 meta ads

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/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

### Meta | Facebook Ads Library Scraper

Meta | Facebook Ads Library Scraper extracts ads from the [Meta Ad Library](https://www.facebook.com/ads/library/) (Facebook Ads Library) for any keyword search, Facebook Page or Instagram profile, with ad copy, headlines, images, videos, carousel cards, CTA, landing page, start and end dates, platforms and advertiser details.

<table><tr>
<td style="border-left:4px solid #1877F2;padding:12px 16px;font-weight:600">
Paste any Ads Library search URL with your filters, a Facebook Page or an Instagram profile, and optionally add EU and UK reach with age, gender and country breakdowns, payer and beneficiary, and advertiser follower counts for every ad.
</td>
</tr></table>

##### Copy to your AI assistant

Copy this block into ChatGPT, Claude, Cursor, or any LLM to start using this actor.

```text
Meta | Facebook Ads Library Scraper (Apify actor parsebird/facebook-ads-library-scraper) scrapes the Meta Ad Library (facebook.com/ads/library) for Facebook, Instagram, Messenger, Threads and Audience Network ads. Call it with the Apify API client: client.actor("parsebird/facebook-ads-library-scraper").call(run_input={"startUrl": "https://www.facebook.com/nike/", "maxAds": 100, "extractDetails": true}). Inputs: startUrl (string, required; an Ads Library search URL copied from facebook.com/ads/library with any filters such as country, active_status, ad_type, media_type, q, search_type, start_date, publisher_platforms, content_languages, sort_data or view_all_page_id; or a Facebook Page URL such as https://www.facebook.com/nike/; or an Instagram profile URL such as https://www.instagram.com/nike/; or a single-ad URL ?id=...; or a plain keyword); maxAds (integer 1-10000, default 100); extractDetails (boolean, default false; adds advertiser profile, EU/UK transparency reach with age, gender and country breakdowns, payer and beneficiary, violation flags; billed as a separate ad-details event); country (two-letter code or ALL, default ALL; used for Page, Instagram and keyword inputs and Ads Library URLs without a country); activeStatus ("active", "inactive" or "all", default "active"; same scope as country). Output: one row per ad in the Ad Library's own field names: ad_archive_id, page_id, page_name, is_active, start_date and end_date (Unix seconds) plus start_date_formatted and end_date_formatted (YYYY-MM-DD), publisher_platform, categories, spend, impressions_with_index, currency, targeted_or_reached_countries, snapshot (body.text, title, caption, link_url, link_description, cta_text, cta_type, display_format, images, videos, cards, page_like_count, page_categories, page_profile_uri), ad_library_url, input_url, and with details: advertiser (page_info with likes, ig_username, ig_followers, page_category, page_verification; about text), aaa_info (payer_beneficiary_data, targets_eu), transparency_by_location (eu_transparency with eu_total_reach, age_country_gender_reach_breakdown, location_audience, age_audience, gender_audience; uk_transparency with total_reach), violation_types, is_violating_eu_siep. API docs: https://apify.com/parsebird/facebook-ads-library-scraper/api. Get a token: https://console.apify.com/settings/integrations
```

### What is Meta | Facebook Ads Library Scraper?

**Meta | Facebook Ads Library Scraper** turns the public [Meta Ad Library](https://www.facebook.com/ads/library/) into structured data. The Ad Library lists every ad running on **Facebook, Instagram, Messenger, Threads and Audience Network**. This scraper returns each ad's **text, headline, images, videos, carousel cards, call to action, landing page, start date, platforms and advertiser**, and with details on, **EU and UK reach with age, gender and country breakdowns, payer and beneficiary, and the advertiser's Facebook likes and Instagram followers**.

It works as a **Facebook Ads Library API** alternative: no Facebook account, no access token and no identity verification, which Meta's official Ad Library API asks for. The easiest way to try it is to keep the example URL, click **Start**, and download the ads as JSON, CSV or Excel a few seconds later.

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

- 🔎 **Three ways in**: an Ads Library search URL, a Facebook Page URL or an Instagram profile URL. A single-ad link (`?id=...`) or a plain keyword also works.
- 🎛️ **Every Ad Library filter**: country, active or inactive status, ad category (such as all ads or political and issue ads), media type, exact phrase search, date range, platform, language and sorting. Set them on facebook.com/ads/library and paste the URL.
- 📸 **Instagram profiles**: the scraper finds the Facebook advertiser linked to an Instagram account and returns its ads.
- 📊 **Ad details** (optional): EU and UK reach, reach by country, age and gender, targeted locations and ages, payer and beneficiary, advertiser Page likes, Instagram followers and verification.
- 🎬 **Creative assets**: image URLs, HD and SD video URLs, video preview images, and all carousel and dynamic product ad cards.
- 🔁 **No duplicates**: every ad appears once per run, up to 10,000 ads.

As an Apify Actor it also gives you [scheduling](https://docs.apify.com/platform/schedules) for daily or weekly competitor ad monitoring, a [REST API](https://docs.apify.com/api/v2), [integrations](https://apify.com/integrations) with Google Sheets, Zapier, Make, Slack and webhooks, and exports to JSON, CSV, Excel, XML and HTML.

### What data can you extract from the Facebook Ads Library?

| Field | Description |
|-------|-------------|
| `ad_archive_id`, `ad_library_url` | Ad Library ID and a link to the ad |
| `page_id`, `page_name` | Advertiser Page |
| `is_active`, `start_date`, `end_date` | Status and dates (Unix seconds); `start_date_formatted` and `end_date_formatted` as YYYY-MM-DD |
| `publisher_platform` | FACEBOOK, INSTAGRAM, MESSENGER, THREADS, AUDIENCE_NETWORK |
| `snapshot.body.text`, `snapshot.title`, `snapshot.caption` | Ad text, headline and display link |
| `snapshot.cta_text`, `snapshot.cta_type`, `snapshot.link_url`, `snapshot.link_description` | Call to action and landing page |
| `snapshot.display_format` | IMAGE, VIDEO, CAROUSEL, DCO, DPA, MULTI_IMAGES |
| `snapshot.images`, `snapshot.videos`, `snapshot.cards` | Image URLs, HD/SD video URLs with preview images, carousel and product cards |
| `snapshot.page_like_count`, `snapshot.page_categories` | Advertiser likes and categories |
| `categories`, `spend`, `impressions_with_index`, `currency` | Ad category, and spend and impression ranges where Meta publishes them |
| `advertiser.ad_library_page_info.page_info` | Likes, Instagram username, followers and verification, Page category, verification badge (with **Fetch ad details**) |
| `transparency_by_location.eu_transparency` | EU total reach, reach by country, age and gender, targeted locations, ages and gender (with details) |
| `transparency_by_location.uk_transparency` | UK total reach and breakdown (with details) |
| `aaa_info.payer_beneficiary_data` | Who paid for the ad and who it benefits (with details) |
| `violation_types`, `is_violating_eu_siep` | Policy flags (with details) |

The field names match the Ad Library's own data, so rows from other Ads Library tools that use the same names can be merged directly.

### How to scrape the Facebook Ads Library

1. Open the [Facebook Ads Library](https://www.facebook.com/ads/library/), choose a country and ad category, and search for a keyword or advertiser. Add any filters you need.
2. Copy the URL from your browser's address bar. You can also copy a Facebook Page URL or an Instagram profile URL instead.
3. Open [Meta | Facebook Ads Library Scraper](https://apify.com/parsebird/facebook-ads-library-scraper) in Apify Console and paste the URL into **Ads Library, Facebook Page or Instagram URL**.
4. Set **Max ads**, and turn on **Fetch ad details** if you need reach, demographics and payer data.
5. Click **Start**.
6. Download the ads from the **Output** tab as JSON, CSV, Excel, XML or HTML, or read them through the [API](https://apify.com/parsebird/facebook-ads-library-scraper/api).

### Input parameters

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| `startUrl` | string | **Yes** | — | Ads Library search URL, Facebook Page URL, Instagram profile URL, single-ad URL or keyword |
| `maxAds` | integer | No | 100 | Ads to save, up to 10,000 |
| `extractDetails` | boolean | No | `false` | Add advertiser info, EU/UK reach and demographics, payer and beneficiary |
| `country` | string | No | `ALL` | Two-letter country code for Page, Instagram and keyword inputs, and for Ads Library URLs without a country |
| `activeStatus` | string | No | `active` | `active`, `inactive` or `all`; same scope as `country` |
| `proxyConfiguration` | object | No | automatic | Optional; the scraper switches to residential proxy by itself when Facebook limits requests |

**Input examples**

Everything a Facebook Page is running, with details:

```json
{ "startUrl": "https://www.facebook.com/adidas/", "extractDetails": true, "maxAds": 50 }
```

An Ads Library keyword search in the US:

```json
{
  "startUrl": "https://www.facebook.com/ads/library/?active_status=active&ad_type=all&country=US&q=running%20shoes&search_type=keyword_unordered&media_type=all",
  "extractDetails": false,
  "maxAds": 100
}
```

An Instagram profile, all ads ever run in Germany:

```json
{ "startUrl": "https://www.instagram.com/nike/", "country": "DE", "activeStatus": "all", "maxAds": 40 }
```

### Output example

```json
{
  "ad_archive_id": "1923645134954720",
  "page_id": "966175593248497",
  "page_name": "American Health Support Community",
  "is_active": true,
  "start_date": 1780297200,
  "end_date": 1791270000,
  "start_date_formatted": "2026-06-01",
  "end_date_formatted": "2026-10-06",
  "publisher_platform": ["FACEBOOK", "INSTAGRAM"],
  "categories": ["UNKNOWN"],
  "spend": null,
  "currency": "",
  "is_aaa_eligible": true,
  "targeted_or_reached_countries": [],
  "snapshot": {
    "body": { "text": "I almost looked past the woman who saved my husband's life. She was seventy-nine, sitting alone at the booth next to ours..." },
    "title": "Natural Relief in Weeks",
    "caption": "shop.pipitea.com",
    "cta_text": "Learn more",
    "cta_type": "LEARN_MORE",
    "display_format": "IMAGE",
    "link_url": "https://shop.pipitea.com/hbt/kd/sp",
    "link_description": "\"I've tried everything to support my kidney function naturally...",
    "images": [
      {
        "original_image_url": "https://scontent.fblr1-7.fna.fbcdn.net/v/t39.35426-6/713729791_...n.jpg",
        "resized_image_url": "https://scontent.fblr1-3.fna.fbcdn.net/v/t39.35426-6/711729685_...n.jpg"
      }
    ],
    "videos": [],
    "cards": [],
    "page_like_count": 3882,
    "page_categories": ["Community Center"],
    "page_profile_uri": "https://www.facebook.com/61588018263996/"
  },
  "ad_library_url": "https://www.facebook.com/ads/library/?id=1923645134954720",
  "advertiser": {
    "page": { "id": "966175593248497", "about": { "text": "A community for people in the United States looking for practical health advice." } },
    "ad_library_page_info": {
      "page_info": {
        "page_name": "American Health Support Community",
        "likes": 3882,
        "ig_username": null,
        "ig_followers": null,
        "page_category": "Community centre",
        "page_verification": "NOT_VERIFIED",
        "entity_type": "PERSON_PROFILE"
      }
    }
  },
  "aaa_info": {
    "payer_beneficiary_data": [{ "payer": "American Health Support Community", "beneficiary": "American Health Support Community" }],
    "targets_eu": true,
    "is_ad_taken_down": false
  },
  "transparency_by_location": {
    "eu_transparency": {
      "eu_total_reach": 173451,
      "gender_audience": "All",
      "age_audience": { "min": 18, "max": 65 },
      "location_audience": [{ "name": "Worldwide", "type": "country_groups", "excluded": false }],
      "age_country_gender_reach_breakdown": [
        {
          "country": "AT",
          "age_gender_breakdowns": [
            { "age_range": "55-64", "male": 797, "female": 555, "unknown": 11 },
            { "age_range": "45-54", "male": 1073, "female": 547, "unknown": 19 }
          ]
        }
      ]
    },
    "uk_transparency": { "total_reach": 6485 }
  },
  "violation_types": [],
  "is_violating_eu_siep": false,
  "input_url": "https://www.facebook.com/ads/library/?active_status=all&ad_type=all&country=ALL&q=shoes&search_type=keyword_unordered&media_type=all"
}
```

The example is shortened: real rows contain every field the Ad Library returns, and the breakdown lists every country and age range. Image and video links are signed by Facebook and expire after a few days, so download files you need soon after the run.

### How to use the Facebook Ads Library API

**Python**

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_APIFY_TOKEN>")
run = client.actor("parsebird/facebook-ads-library-scraper").call(run_input={
    "startUrl": "https://www.facebook.com/nike/",
    "maxAds": 200,
    "extractDetails": True,
})
for ad in client.dataset(run["defaultDatasetId"]).iterate_items():
    eu = (ad.get("transparency_by_location") or {}).get("eu_transparency") or {}
    print(ad["start_date_formatted"], ad["snapshot"]["display_format"], eu.get("eu_total_reach"))
```

**JavaScript**

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: '<YOUR_APIFY_TOKEN>' });
const run = await client.actor('parsebird/facebook-ads-library-scraper').call({
    startUrl: 'https://www.facebook.com/ads/library/?active_status=active&ad_type=all&country=GB&q=protein%20powder&search_type=keyword_unordered&media_type=all',
    maxAds: 100,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items.map((ad) => [ad.page_name, ad.snapshot.link_url]));
```

Get your token in [Apify Console → Integrations](https://console.apify.com/settings/integrations). Full endpoint reference is on the [API tab](https://apify.com/parsebird/facebook-ads-library-scraper/api).

### Use cases

- **Competitor ad research**: see every ad a competitor runs on Facebook and Instagram, with creatives, copy, offers and landing pages.
- **Ad creative inspiration**: collect winning hooks, headlines and formats for a niche keyword.
- **Long-running ad detection**: sort by `start_date` to find ads that have run for months, a common sign that an ad works.
- **EU audience analysis**: compare reach by country, age and gender across a brand's ads.
- **Political and issue ad monitoring**: track spend and impression ranges, payers and beneficiaries.
- **Lead generation**: find businesses that advertise in a niche and their landing pages.

### How it works

1. Your URL is turned into an Ad Library search. Facebook Page URLs are matched to the Page's Ad Library ID, and Instagram profiles to the Facebook advertiser linked to the account.
2. The scraper reads the same results the Ad Library website shows, page by page, and drops duplicates.
3. With **Fetch ad details** on, each ad's detail panel data (advertiser, EU and UK transparency, payer and beneficiary) is added.
4. Ads are saved in the Ad Library's order until **Max ads** is reached or the results end.

### How much does it cost to scrape the Facebook Ads Library?

Meta | Facebook Ads Library Scraper uses pay-per-event pricing with two events:

| Event | Free | Bronze | Silver | Gold |
|-------|------|--------|--------|------|
| `ad`, per 1,000 ads | **$0.59** | **$0.49** | **$0.39** | **$0.39** |
| `ad-details`, per 1,000 ads with details | **$0.59** | **$0.49** | **$0.39** | **$0.39** |

`ad-details` is charged only when **Fetch ad details** is on and the details were fetched for that ad. For example, 1,000 ads cost $0.59 on the Free plan, or $1.18 with details. Compute and proxy costs are included in the event price, and you can set a maximum spend per run in Apify Console.

### FAQ

**Which URLs can I use?**
Any Ads Library search URL from facebook.com/ads/library (keyword, exact phrase or advertiser searches, with any filters), a single-ad URL such as `https://www.facebook.com/ads/library/?id=1466307095509411`, a Facebook Page URL (`facebook.com/nike`, `facebook.com/profile.php?id=...`), an Instagram profile URL (`instagram.com/nike`), or a plain keyword.

**Why does my Facebook Page or Instagram URL return no ads?**
The Page may not run ads right now. Set **Ad status** to **All ads** to include past ads, or set **Country** to **All countries**. Some brands also advertise from a separate Page per country: for example, the main Coca-Cola Page had no ads in our tests. If an Instagram account has no linked Facebook advertiser, the run stops with a message saying so.

**Why are demographics only available for some ads?**
Meta publishes reach, age, gender and country breakdowns for ads shown in the EU (and the UK) because of the EU Digital Services Act. Ads shown only outside these regions have no breakdown, so `eu_transparency` is empty for them. Spend and impression ranges are published for political and issue ads.

**How many ads can I get?**
Up to 10,000 per run. The Ad Library shows a rough total for each search in the run log.

**Do I need a Facebook account, token or proxy?**
No. The scraper reads the public Ad Library without logging in. It switches to residential proxy by itself if Facebook limits requests, at no extra cost to you.

**Something is missing or not working?**
Open an issue on the **Issues** tab and we will look into it.

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

Our scrapers are ethical and do not extract any private user data, such as email addresses, gender, or location. They only extract what the user has chosen to share publicly. The Ad Library is published by Meta for ad transparency, and the scraper only reads what it shows to logged-out visitors. We therefore believe that our scrapers, when used for ethical purposes by Apify users, are safe. However, you should be aware that your results could contain personal data. Personal data is protected by the GDPR in the European Union and by other regulations around the world. You should not scrape personal data unless you have a legitimate reason to do so. If you're unsure whether your reason is legitimate, consult your lawyers. You can also read our blog post on the [legality of web scraping](https://blog.apify.com/is-web-scraping-legal/).

### Other Facebook and ad library scrapers

| Actor | What it scrapes |
|-------|-----------------|
| [Facebook User Posts Scraper](https://apify.com/parsebird/facebook-user-posts-scraper) | Public posts from Facebook Pages and profiles |
| [Facebook Page Reviews Scraper](https://apify.com/parsebird/facebook-reviews-scraper) | Reviews and recommendations on Facebook Pages |
| [Facebook Page Video Downloader](https://apify.com/parsebird/facebook-page-video-downloader) | Every video on a Facebook Page |
| [Facebook Media Downloader](https://apify.com/parsebird/facebook-media-downloader) | Video, reel and photo links from Facebook posts |
| [Facebook Public Group Posts Scraper](https://apify.com/parsebird/facebook-group-posts-scraper) | Posts from public Facebook groups |
| [Facebook Group Profile Scraper](https://apify.com/parsebird/facebook-group-profile-scraper) | Facebook group details and member counts |
| [Instagram Profile Scraper](https://apify.com/parsebird/instagram-profile-scraper) | Instagram profiles with email, phone and social links |
| [Google Ads Transparency Center Scraper](https://apify.com/parsebird/google-ads-transparency-scraper) | Google ads by advertiser or domain |
| [TikTok Ads Scraper](https://apify.com/parsebird/tiktok-ads-scraper) | TikTok Creative Center top ads |
| [TikTok Top Ads Scraper](https://apify.com/parsebird/tiktok-top-ads-scraper) | TikTok Creative Center top ads with likes tier and language filters |

# Changelog

This Actor's version history is a separate document: https://apify.com/parsebird/facebook-ads-library-scraper/changelog.md

# Actor input Schema

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

Paste one of: an Ads Library search URL (set your keyword, country and filters on facebook.com/ads/library, then copy the URL), a Facebook Page URL such as https://www.facebook.com/nike/, or an Instagram profile URL such as https://www.instagram.com/nike/. A plain keyword also works.

## `maxAds` (type: `integer`):

Maximum number of ads to save (up to 10,000).

## `extractDetails` (type: `boolean`):

Add each ad's advertiser profile (Page likes, Instagram followers, category, about text), EU transparency data (total EU reach, reach by country, age and gender, targeted locations and ages), payer and beneficiary, and violation flags. Billed as a separate ad-details event per ad.

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

Used for Facebook Page URLs, Instagram URLs, keywords, and Ads Library URLs that have no country. Shows ads delivered in this country. Ads Library URLs that include a country keep it.

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

Used for Facebook Page URLs, Instagram URLs, keywords, and Ads Library URLs that have no status filter. Ads Library URLs that include a status keep it.

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

Optional. The scraper switches to a proxy by itself when Facebook limits requests, so you can leave this empty.

## Actor input object example

```json
{
  "startUrl": "https://www.facebook.com/ads/library/?active_status=active&ad_type=all&country=US&q=running%20shoes&search_type=keyword_unordered&media_type=all",
  "maxAds": 20,
  "extractDetails": false,
  "country": "ALL",
  "activeStatus": "active"
}
```

# Actor output Schema

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

No description

# 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 = {
    "startUrl": "https://www.facebook.com/ads/library/?active_status=active&ad_type=all&country=US&q=running%20shoes&search_type=keyword_unordered&media_type=all",
    "maxAds": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("parsebird/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 = {
    "startUrl": "https://www.facebook.com/ads/library/?active_status=active&ad_type=all&country=US&q=running%20shoes&search_type=keyword_unordered&media_type=all",
    "maxAds": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("parsebird/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 '{
  "startUrl": "https://www.facebook.com/ads/library/?active_status=active&ad_type=all&country=US&q=running%20shoes&search_type=keyword_unordered&media_type=all",
  "maxAds": 20
}' |
apify call parsebird/facebook-ads-library-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,parsebird/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/bl70iNROQQYjkRZyQ/builds/l56RmxdSq2OjPGPmB/openapi.json
