# Facebook, Instagram & Meta Ad Spy ($0.50/1k) (`unitbytes/facebook-instagram-ad-spy-scraper`) Actor

⚡ Fast & Cheap ($0.50/1k): Competitor Meta, Facebook & Instagram ad spy by Page URL, @handle or keyword. Find winning ads, new launches, HD videos, CTAs & IG stats.

- **URL**: https://apify.com/unitbytes/facebook-instagram-ad-spy-scraper.md
- **Developed by:** [UnitBytes | Enterprise Web Data](https://apify.com/unitbytes) (community)
- **Categories:** Marketing, Social media, E-commerce
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.50 / 1,000 ad scrapeds

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 & Instagram Competitor Ad Spy & Monitor

Track competitor **Facebook, Instagram, and Threads** advertising campaigns in seconds—with **no login credentials required**.

Pass any competitor **Facebook Page URL** (`https://www.facebook.com/nike`), **Instagram handle** (`@gymshark`), **pasted Ad Library URL**, or **niche keyword** to uncover their longest-running winning creatives, HD video hooks, landing page funnels, variant counts, and newly launched ads across scheduled runs.

***

### Built for Performance Marketers, DTC Brands & Creative Strategists

- **Identify Proven Winning Creatives (`isLongRunningWinner` & `activeDays`)**:
  - Automatically calculates exact **`activeDays`** and flags ads running continuously for **`30+` days** (`isLongRunningWinner: true`) plus **`collationCount`** (how many active ad variations share the same creative).
- **Stateful Cross-Run Competitor Monitoring (`monitorStatus`)**:
  - Automatically persists competitor ad snapshots in a Named Key-Value Store (`meta-ads-monitor-state` by default on Apify Cloud, or a custom **`monitorStoreName`**). First-time page runs establish a **`"baseline"`**, and subsequent scheduled runs label newly launched creatives as **`"new"`**, continuing ads as **`"continuing"`**, and record `recentlyStoppedByPage` IDs in `AD_MONITOR_STATE` whenever a page's active catalog is scanned in full.
- **Direct HD Creative Assets & Unwrapped Landing Funnels**:
  - Extracts playable **`primaryVideoHdUrl`** (`.mp4`), high-resolution **`imageUrls`**, full **`carouselCards`**, **`ctaText`**, unwrapped **`linkUrl`**, and normalized **`linkDomain`** for instant landing-page funnel grouping.
- **Instagram & Facebook Brand Enrichment**:
  - Resolves **`igUsername`**, **`igFollowers`**, **`igVerified`**, **`pageLikes`**, **`pageCategory`**, and **`pageAbout`**—plus **`euTotalReach`** & transparency disclosures when scraping EU/UK markets (`DE`, `FR`, `NL`, `GB`, etc.).

***

### Pay-Per-Event Pricing

| Apify Plan Tier | Price per Ad | Price per 1,000 Ads |
| :--- | :--- | :--- |
| **Free** | `$0.00075` | **`$0.75 / 1K`** |
| **Bronze** | `$0.00065` | **`$0.65 / 1K`** |
| **Silver** | `$0.00055` | **`$0.55 / 1K`** |
| **Gold / Platinum / Diamond** | `$0.00050` | **`$0.50 / 1K`** |

*(Plus a one-time `$0.0005` Actor start event per run. `$0.00` result fee when 0 ads match.)*

***

### Quick Start Examples

#### 1. Daily Competitor Brand Page & Change Tracking

```json
{
  "pageUrls": [
    "https://www.facebook.com/nike",
    "https://www.facebook.com/shopify"
  ],
  "country": "US",
  "activeStatus": "active",
  "enableChangeTracking": true,
  "monitorStoreName": "competitor-ads-monitor",
  "maxItems": 100
}
```

#### 2. Spy on Instagram Video Ads by `@handle`

```json
{
  "instagramHandles": ["@gymshark"],
  "country": "ALL",
  "activeStatus": "active",
  "mediaType": "video",
  "publisherPlatforms": ["instagram"],
  "maxItems": 40
}
```

***

### Flat Output Sample

```json
{
  "adArchiveId": "880112233445566",
  "adUrl": "https://www.facebook.com/ads/library/?id=880112233445566",
  "collationId": "330998877665544",
  "collationCount": 8,
  "isActive": true,
  "startDate": "2026-01-15T10:00:00+00:00",
  "endDate": null,
  "activeDays": 74.2,
  "isLongRunningWinner": true,
  "monitorStatus": "continuing",
  "pageId": "100200300400",
  "pageName": "Acme Sportswear",
  "pageUrl": "https://www.facebook.com/acmesportswear/",
  "pageCategory": "Apparel & clothing",
  "pageLikes": 412900,
  "igUsername": "acmesportswear",
  "igFollowers": 285400,
  "igVerified": true,
  "displayFormat": "VIDEO",
  "publisherPlatforms": ["FACEBOOK", "INSTAGRAM"],
  "publisherPlatformsText": "FACEBOOK, INSTAGRAM",
  "title": "Zero-Drop Training Shoe",
  "bodyText": "Built for heavy lifts and sprint intervals. Try 30 days risk-free.",
  "ctaText": "Shop Now",
  "ctaType": "SHOP_NOW",
  "linkUrl": "https://shop.example.com/products/zero-drop-trainer",
  "linkDomain": "shop.example.com",
  "primaryVideoHdUrl": "https://video.example.com/v/hook_hd.mp4",
  "videoCount": 1,
  "countryFilter": "US",
  "searchQuery": "acmesportswear",
  "inputSource": "page_url",
  "detailLevel": "full",
  "scrapedAt": "2026-03-30T12:00:00+00:00"
}
```

***

### Support & Feedback

Need assistance or custom filter support? Open an issue in the **Issues** tab on this Actor page in Apify Console.

# Actor input Schema

## `pageUrls` (type: `array`):

Competitor Facebook Page URLs (`https://www.facebook.com/nike`, `https://www.facebook.com/shopify`), Instagram URLs (`https://www.instagram.com/gymshark/`), or pasted Meta Ad Library URLs (up to 25 URLs/handles per run).

## `instagramHandles` (type: `array`):

Instagram advertiser handles (e.g. `@gymshark`, `@loungebyzalando`) to resolve and track all linked Instagram & Facebook creatives (up to 25 URLs/handles per run).

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

Search competitor brand names or product keywords (e.g. `protein powder`, `AI note taker`). Up to 50 queries per run. Automatically overrides untouched Page URL prefill when provided.

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

2-letter country code (`US`, `GB`, `DE`, `CA`, `AU`) or `ALL` for global competitor tracking.

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

Monitor live active ads or inspect historical inactive ads.

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

Focus on competitor video hooks, static images, or all formats.

## `publisherPlatforms` (type: `array`):

Restrict to `instagram`, `facebook`, `threads`, `messenger`, `whatsapp`, or `audience_network`.

## `sortBy` (type: `string`):

Native upstream sort order.

## `startDateMin` (type: `string`):

Matches Meta Ad Library's native date filter (`start_date[min]`): returns competitor ads active on or after this date (e.g. `2026-01-01`).

## `scrapeAdDetails` (type: `boolean`):

Enriches every competitor ad with linked Instagram handle/followers, Page likes/bio, and EU/UK reach when applicable.

## `enableChangeTracking` (type: `boolean`):

Persists advertiser ad snapshots in Key-Value Store (`AD_MONITOR_STATE`, defaulting to `meta-ads-monitor-state` on Cloud) so scheduled runs label `monitorStatus` as `'baseline'` (first run), `'new'`, or `'continuing'`, and record stopped IDs when a page catalog is fully scanned.

## `monitorStoreName` (type: `string`):

Custom persistent Named Key-Value Store name (defaults automatically to `meta-ads-monitor-state` on Apify Cloud; also accepts `stateStoreName` via API).

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

Maximum total ads to return.

## `resumptionToken` (type: `string`):

Paste `resumptionToken` from `RESUMPTION_TOKEN` in Key-Value Store for zero-duplicate multi-batch pagination.

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

Apify Residential Proxy is automatically configured on cloud runs.

## Actor input object example

```json
{
  "pageUrls": [
    "https://www.facebook.com/nike"
  ],
  "country": "US",
  "activeStatus": "active",
  "mediaType": "all",
  "sortBy": "default",
  "scrapeAdDetails": true,
  "enableChangeTracking": true,
  "maxItems": 20,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `overview` (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 = {
    "pageUrls": [
        "https://www.facebook.com/nike"
    ],
    "country": "US",
    "activeStatus": "active",
    "mediaType": "all",
    "sortBy": "default",
    "scrapeAdDetails": true,
    "enableChangeTracking": true,
    "maxItems": 20,
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("unitbytes/facebook-instagram-ad-spy-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 = {
    "pageUrls": ["https://www.facebook.com/nike"],
    "country": "US",
    "activeStatus": "active",
    "mediaType": "all",
    "sortBy": "default",
    "scrapeAdDetails": True,
    "enableChangeTracking": True,
    "maxItems": 20,
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("unitbytes/facebook-instagram-ad-spy-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 '{
  "pageUrls": [
    "https://www.facebook.com/nike"
  ],
  "country": "US",
  "activeStatus": "active",
  "mediaType": "all",
  "sortBy": "default",
  "scrapeAdDetails": true,
  "enableChangeTracking": true,
  "maxItems": 20,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call unitbytes/facebook-instagram-ad-spy-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,unitbytes/facebook-instagram-ad-spy-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/DJZyd3Y3BKC7wg4RH/builds/bTwFWLYslofp254QO/openapi.json
