# Meta Ads Scraper Pro | Video & Copy Extractor (`zackmiel/meta-ad-library-scraper`) Actor

Scrape thousands of ads from the Meta Ad Library instantly. No login required. Extracts full raw GraphQL data including video URLs, ad copy, page names, and target domain links. Perfect for e-commerce research, competitor analysis, and lead generation.

- **URL**: https://apify.com/zackmiel/meta-ad-library-scraper.md
- **Developed by:** [Zack Miel](https://apify.com/zackmiel) (community)
- **Categories:**
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.70 / 1,000 results

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

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

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — 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 Pro | Video & Copy Extractor

The fastest, most cost-effective way to extract raw data from the Facebook (Meta) Ad Library. Built on a resilient hybrid GraphQL architecture, this scraper bypasses rate limits and heavy page loads to deliver complete ad payloads without requiring personal Facebook accounts or authentication cookies.

### 🚀 Key Features

- **Winning Ad Detection (Longevity Scoring):** Stop wasting time on untested creatives. Use the `minDaysActive` filter to instantly isolate profitable, battle-tested campaigns running for 14+ days.
- **Zero-Cost Precision Filtering:** Target specific networks (Instagram, WhatsApp, Messenger) and media formats (Video only) natively. Get highly segmented data without paying for extra proxy bandwidth.
- **Smart URL Parsing:** Paste a full Meta Ad Library URL directly into the input to automatically configure your target country and keywords.
- **Zero Authentication Required:** Runs entirely without user logins, session cookies, or personal account risk.
- **Deep Data Extraction:** Captures the full raw Meta GraphQL node. Uncovers high-resolution video URLs, image assets, exact ad copy, call-to-action (CTA) types, and hidden destination URLs.
- **Unbeatable Economics:** Optimized for network-level HTTP routing, driving costs down to a highly competitive **$0.70 per 1,000 ads**.
- **E-Commerce Ready:** Automatically isolates the root `domain`, `pageName`, and `rawLink` for instant dropshipping research and lead generation.

### 🎯 Use Cases

- **E-Commerce & Dropshipping:** Monitor competitor product launches, isolate trending ad creatives, and download unwatermarked video assets.
- **B2B Lead Generation:** Extract destination URLs (e.g., `.youcan.store`, `.myshopify.com`) to build verified contact lists of active, spending store owners.
- **Marketing Agencies:** Audit niche ad strategies, analyze copywriting frameworks, and track active campaign durations.

### ⚙️ Input Configuration

| Field | Type | Description | Example |
| :--- | :--- | :--- | :--- |
| **Full Ad Library URL** | `String` | *(Optional)* Paste a complete Meta search URL to override manual keyword/country fields. | `https://www.facebook.com/...` |
| **Search Keyword** | `String` | The exact phrase, brand, or query to search. | `youcan`, `livraison`, `shoes` |
| **Country Code** | `String` | Two-letter ISO country code for localized searches. | `DZ` (Algeria), `US` (USA), `ALL` |
| **Platform Filter** | `String` | Target specific networks. | `INSTAGRAM`, `FACEBOOK`, `ALL` |
| **Media Type** | `String` | Target specific ad formats. | `VIDEO`, `IMAGE`, `ALL` |
| **Minimum Days Active** | `Integer` | Filter out new ads. Set to `14` for proven winning products. | `14` |
| **Maximum Ads** | `Integer` | The absolute maximum number of ads to extract. | `500` |
| **GraphQL Doc ID** | `String` | *(Advanced)* Hidden fallback ID in case of Meta API updates. | `24922295957467452` |

### 📊 Output Data Structure

Your default dataset will feature a clean overview, but you have full freedom to export the **entire raw JSON payload** which includes nested metadata for deep analysis.

Here is the exact exportable raw data format:

````json
[
  {
    "domain": "hengservice.youcan.store",
    "pageName": "hanout dz",
    "adArchiveId": "1197271145572302",
    "rawLink": "https://hengservice.youcan.store/pages/sauna-t",
    "days_active": 42,
    "ad_archive_id": "1197271145572302",
    "collation_count": 1,
    "collation_id": "1575472130525664",
    "is_active": true,
    "page_id": "130904716771468",
    "page_is_deleted": false,
    "snapshot": {
      "branded_content": null,
      "page_id": "130904716771468",
      "page_is_deleted": false,
      "page_profile_uri": "[https://www.facebook.com/61551202305399/](https://www.facebook.com/61551202305399/)",
      "page_name": "hanout dz",
      "caption": "hengservice.youcan.store",
      "cta_text": "Order now",
      "body": {
        "text": "✅ تسرّع حرق السعرات\n✅ تزيد التعرّق و تنقص الماء الزايد\n✅ تعاونك تنظّف جسمك من السموم\n✅ خفيفة و مريحة تقدّر تلعب بيها رياضة بلا تعب\n\n💪 استعملها غير مع المشي ولا الجيم، و شوف النتيجة من أوّل أسبوع!\n\n🚚 التوصيل سريع لجميع ولايات الجزائر\n💵 الدفع كي توصلك حتى لباب دارك\n\n⏳ الكمية محدودة،"
      },
      "cta_type": "ORDER_NOW",
      "display_format": "VIDEO",
      "link_url": "[https://hengservice.youcan.store/pages/sauna-t](https://hengservice.youcan.store/pages/sauna-t)",
      "page_categories": [
        "Magasin discount",
        "Santé et beauté",
        "Santé/beauté"
      ],
      "page_like_count": 2281,
      "title": "تعرق بشكل اكبر💦بجهد اقل 🔥",
      "videos": [
        {
          "video_hd_url": "[https://video.fcpq7-1.fna.fbcdn.net/](https://video.fcpq7-1.fna.fbcdn.net/)...",
          "video_preview_image_url": "[https://scontent.fcpq7-1.fna.fbcdn.net/](https://scontent.fcpq7-1.fna.fbcdn.net/)..."
        }
      ]
    },
    "publisher_platform": [
      "FACEBOOK",
      "INSTAGRAM",
      "AUDIENCE_NETWORK",
      "MESSENGER",
      "THREADS"
    ],
    "start_date_formatted": "2025-09-19 07:00:00",
    "end_date_formatted": "2026-08-30 07:00:00",
    "ad_library_url": "[https://www.facebook.com/ads/library/?id=1197271145572302](https://www.facebook.com/ads/library/?id=1197271145572302)"
  }
]

# Actor input Schema

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

Paste a complete Meta Ad Library search URL. If provided, this overrides all manual fields.
## `keyword` (type: `string`):

Keyword to search in the Meta Ad Library.
## `country` (type: `string`):

Two-letter country code used by the Ad Library search.
## `platform` (type: `string`):

Filter ads by where they are displayed.
## `mediaType` (type: `string`):

Filter by ad format.
## `minDaysActive` (type: `integer`):

Only save ads running for at least this many days (e.g., 14+ for winning products). Set to 0 to save all.
## `maxAds` (type: `integer`):

Maximum number of ads to save before the Actor stops.
## `docId` (type: `string`):

The Meta GraphQL document ID for Ad Library searches (override)

## Actor input object example

```json
{
  "startUrl": "https://www.facebook.com/ads/library/?active_status=all&ad_type=all&country=US&q=linkedin&search_type=keyword_unordered&media_type=all",
  "keyword": "e.g., shoes, livraison",
  "country": "DZ",
  "platform": "ALL",
  "mediaType": "ALL",
  "minDaysActive": 0,
  "maxAds": 100
}
````

# Actor output Schema

## `datasetUrl` (type: `string`):

The URL link to the default dataset containing all scraped Meta ad domains and raw data payloads.

# 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=all&ad_type=all&country=US&q=linkedin&search_type=keyword_unordered&media_type=all",
    "keyword": "e.g., shoes, livraison",
    "country": "DZ"
};

// Run the Actor and wait for it to finish
const run = await client.actor("zackmiel/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 = {
    "startUrl": "https://www.facebook.com/ads/library/?active_status=all&ad_type=all&country=US&q=linkedin&search_type=keyword_unordered&media_type=all",
    "keyword": "e.g., shoes, livraison",
    "country": "DZ",
}

# Run the Actor and wait for it to finish
run = client.actor("zackmiel/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 '{
  "startUrl": "https://www.facebook.com/ads/library/?active_status=all&ad_type=all&country=US&q=linkedin&search_type=keyword_unordered&media_type=all",
  "keyword": "e.g., shoes, livraison",
  "country": "DZ"
}' |
apify call zackmiel/meta-ad-library-scraper --silent --output-dataset

```

## MCP server setup

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