# Facebook Ads Library Scraper (Meta Ads) $0.1425/1K (`bulkleads/meta-ad-library-scraper`) Actor

Facebook Ads Library scraper for the Meta Ad Library: active Facebook and Instagram ads by keyword or website, with ad text, headline, link, images, videos, start date and platforms. $0.1425 per 1,000 ads. No login.

- **URL**: https://apify.com/bulkleads/meta-ad-library-scraper.md
- **Developed by:** [bulkleads](https://apify.com/bulkleads) (community)
- **Categories:** Social media, Lead generation
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $0.13 / 1,000 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

**Facebook Ads Library Scraper** pulls **active ads from the Meta Ad Library** (Facebook, Instagram, Messenger and Audience Network) by **keyword or website**. Each ad comes with its text, headline, link, button, images, videos, start date and platforms, plus the advertiser's page. It costs **$0.1425 per 1,000 ads**.

### What data does each ad include?

- `ad_id` and `library_url` (the ad's own Ad Library page)
- Advertiser: `page_name`, `page_url`, `page_likes` and `page_categories` (the categories the advertiser's page lists)
- Creative: `title`, `body`, `link_url`, `cta_text`, `caption`, `images`, `videos`, `format`
- `start_date`, `end_date`, `is_active`, `platforms` and `copies` (how many versions of the ad run)
- `query`: the keyword or website it was found for

### How to use it

1. Add **Keywords or websites**, one per line: `running shoes` or `nike.com`.
2. Pick a **Country** (two letters, default US) and the **Max ads** for each one.
3. For a website, keep **only ads that link to it** on to skip other advertisers that merely mention it.
4. Click **Start**.

### Output example

```json
{
  "query": "shopify.com",
  "ad_id": "1124861510230110",
  "page_name": "Shopify",
  "page_url": "https://facebook.com/shopify",
  "is_active": true,
  "start_date": "2024-06-24T07:00:00.000Z",
  "platforms": ["FACEBOOK", "INSTAGRAM"],
  "title": "Faster checkout starts with Shopify POS",
  "body": "At TALA Westfield, Shopify POS made the checkout experience faster.",
  "link_url": "https://www.shopify.com/pos/pos-pro-yearly",
  "cta_text": "Learn More",
  "library_url": "https://www.facebook.com/ads/library/?id=1124861510230110"
}
```

### How much does it cost?

**$0.1425 per 1,000 ads.** 10,000 ads cost $1.425. Set a maximum cost per run in Apify and the run stops there.

### FAQ

**Does it need a Facebook login?** No. It reads the public Ad Library, so no account is used.

**Which ads does it return?** Ads running now in the country you pick.

### Related actors

See the same advertiser's Google ads with [Google Ads Transparency Scraper](https://apify.com/bulkleads/google-ads-transparency-scraper). Find the people at an advertiser with [LinkedIn Company Employees Scraper](https://apify.com/bulkleads/company-employees-scraper).

# Actor input Schema

## `queries` (type: `array`):

One per line, e.g. running shoes or nike.com.

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

Two-letter country code, e.g. US, GB, DE.

## `maxAdsPerQuery` (type: `integer`):

Max ads per keyword or website.

## `onlyAdsLinkingToSite` (type: `boolean`):

On by default: a website search also finds ads that only mention it; these are left out.

## Actor input object example

```json
{
  "queries": [
    "shopify.com"
  ],
  "country": "US",
  "maxAdsPerQuery": 100,
  "onlyAdsLinkingToSite": true
}
```

# Actor output Schema

## `results` (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 = {
    "queries": [
        "shopify.com"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("bulkleads/meta-ad-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 = { "queries": ["shopify.com"] }

# Run the Actor and wait for it to finish
run = client.actor("bulkleads/meta-ad-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 '{
  "queries": [
    "shopify.com"
  ]
}' |
apify call bulkleads/meta-ad-library-scraper --silent --output-dataset

```

## MCP server setup

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