# LinkedIn, Google & TikTok Ads Library Scraper (Ad Spy) (`vesper_studio/multi-network-ad-spy`) Actor

Extract B2B & DTC ad creatives from LinkedIn Ad Library, Google Ads Transparency Center, and TikTok Creative Center via direct XHR/RPC & TLS requests (zero Playwright). Includes EU DSA impression ranges, UTM-cleaned landing domains for Clay/n8n, delta mode (onlyNew), and PPE billing.

- **URL**: https://apify.com/vesper_studio/multi-network-ad-spy.md
- **Developed by:** [Xavier Richard](https://apify.com/vesper_studio) (community)
- **Categories:** Marketing, Social media, Lead generation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$2.50 / 1,000 ad creative extracteds

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?

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

## Multi-Network Ad Spy (LinkedIn, Google & TikTok Ads)

**Spy on competitor B2B & DTC ad creatives across LinkedIn Ad Library, Google Ads Transparency Center, and TikTok Creative Center — in one unified dataset, at a fraction of $49–$459/mo AdSpy subscriptions.**

Built for **Growth B2B teams, ABM strategists, Performance Media Buyers, and Clay / n8n automation pipelines** using direct XHR/RPC reverse-engineered endpoints and Chrome TLS impersonation (`curl_cffi`) — **zero Playwright/browser overhead**, running comfortably in **512 MB RAM**.

***

### Why This Actor?

Most scrapers crowd around Meta Ad Library while ignoring the highest-intent B2B and viral creative intelligence sources:

| Network | What You Get | High-Value Signals |
| :--- | :--- | :--- |
| **LinkedIn Ad Library** | Sponsored Single Image, Video, Carousel, Document, Text & Message Ads by **keyword** or **company (`accountOwner`)** | Full ad copy, headline, CTA, **UTM-cleaned landing page**, video MP4 URLs, active dates, and **EU DSA impression ranges & country splits** |
| **Google Ads Transparency Center** | Search, Display & YouTube creatives by **advertiser name**, **Advertiser ID (`AR...`)**, or **domain** (`hubspot.com`) | All creative variations, image/YouTube assets, **EU DSA total & per-country impression ranges**, first-seen & last-shown dates |
| **TikTok Creative Center (Top Ads)** | Top-performing auction video ads ranked by **Likes, CTR, Impressions, or For You** across countries & industries | Ad copy, brand name, **1080p/720p MP4 + cover image**, country targeting, and **UTM-cleaned landing page** |

***

### Key Features for Growth & RevOps Workflows

- **Zero Browser / 512 MB Footprint**: Direct HTTP/2 Chrome TLS impersonation (`curl_cffi`) + C-speed `selectolax` HTML parsing. No Chromium, no Playwright cold starts, no wasted compute units.
- **Clay & n8n Enrichment Ready (`extractLandingDomainInfo`)**: Automatically unwraps ad click-redirectors and strips `utm_*`, `gclid`, `li_fat_id`, `ttclid`, `fbclid`, `_hsenc`, `trk`, and TikTok deep-link tracking parameters from `landingPageUrl`, populating a clean `advertiserDomain` ready for company enrichment in Clay, Apollo, or n8n.
- **EU DSA Transparency Data**: Extracts Digital Services Act (DSA) `impressionsRange`, country distribution (`countries`), and `startDate` / `lastSeenDate` on LinkedIn and Google when European/EEA regions are present.
- **Scheduled Delta Monitoring (`onlyNew`)**: Persists seen creative keys (`network:adId`) in the Apify Key-Value Store (`seen_ads` or custom `deltaStoreKey`). Schedule weekly/daily runs to push **only newly launched competitor ads** to Slack, HubSpot, or Clay — and pay only for new ads.
- **Graceful Abort & Pay-Per-Event Budget Safety**: Flushes buffered creatives and persists KV delta state on `ABORTING`, and enforces `maxTotalChargeUsd` via `ad-extracted` PPE checks.

***

### Input Configuration

| Parameter | Type | Default | Description |
| :--- | :--- | :--- | :--- |
| `networks` | `array` | `["linkedin", "google", "tiktok"]` | Networks to extract from (`linkedin`, `google`, `tiktok`). |
| `keywords` | `array` | `[]` | Search keywords (used on LinkedIn search and as fallback query in Google Suggestions). |
| `advertisers` | `array` | `[]` | Competitor names (`"HubSpot"`), Google Advertiser IDs (`"AR..."`), or domains (`"hubspot.com"`). |
| `domains` | `array` | `[]` | Explicit domains for Google Ads Transparency Center (e.g., `"hubspot.com"`, `"monday.com"`). |
| `countries` | `array` | `["US", "FR"]` | ISO-2 country codes (`"US"`, `"FR"`, `"DE"`, `"GB"`, etc.). EU codes unlock DSA impression ranges. |
| `dateRange` | `string` | `"30d"` | Lookback window: `"any"`, `"7d"`, `"30d"`, `"180d"`. |
| `adFormats` | `array` | `["all"]` | Filter by format: `"all"`, `"text"`, `"image"`, `"video"`, `"carousel"`, `"message"`. |
| `tiktokIndustry` | `string` | `""` | Optional TikTok industry name (e.g., `"Business Services"`, `"Tech & Electronics"`) or numeric ID. |
| `tiktokOrderBy` | `string` | `"like"` | TikTok ranking: `"like"`, `"ctr"`, `"impression"`, `"for_you"`. |
| `enrichDetails` | `boolean` | `true` | Fetch per-ad detail endpoints for landing URLs, DSA impressions, dates, and full media. |
| `extractLandingDomainInfo` | `boolean` | `true` | Strip UTM/tracking params from `landingPageUrl` and extract clean `advertiserDomain`. |
| `onlyNew` | `boolean` | `false` | Delta mode: skip previously seen `network:adId` keys stored in KV Store. |
| `deltaStoreKey` | `string` | `"seen_ads"` | KV Store key for `onlyNew` (use separate keys for separate watchlists). |
| `maxAdsPerNetwork` | `integer` | `50` | Maximum creatives collected per network (`1`–`2000`). |
| `maxTotalAds` | `integer` | `150` | Hard cap on total creatives delivered in the run (`1`–`5000`). |
| `proxyConfiguration` | `object` | `{"useApifyProxy": false}` | Optional Apify Proxy config (disabled by default; enable residential proxies for high-volume runs). |

#### Example Input (B2B Competitor ABM Radar)

```json
{
  "networks": ["linkedin", "google", "tiktok"],
  "keywords": ["crm"],
  "advertisers": ["HubSpot"],
  "domains": ["hubspot.com"],
  "countries": ["US", "FR"],
  "dateRange": "30d",
  "enrichDetails": true,
  "extractLandingDomainInfo": true,
  "onlyNew": true,
  "maxAdsPerNetwork": 20,
  "maxTotalAds": 60
}
```

***

### Output Schema (`AdCreative`)

Every item in the default Dataset follows the unified `AdCreative` schema:

```json
{
  "network": "linkedin",
  "adId": "1639057034",
  "advertiserName": "S-Docs",
  "advertiserUrl": "https://www.linkedin.com/company/10407092",
  "advertiserDomain": "salesforceben.com",
  "format": "single_image",
  "headline": "Salesforce Ben: S-Docs Review",
  "adText": "External document apps introduce latency, sync failures, and security risks...",
  "cta": "Learn more",
  "landingPageUrl": "https://www.salesforceben.com/how-to-generate-and-manage-your-most-important-documents-inside-salesforce/",
  "mediaUrls": [
    "https://media.licdn.com/dms/image/v2/D5610AQG3MdJM061E0A/image-shrink_1280/..."
  ],
  "countries": ["AU"],
  "impressionsRange": "< 1k",
  "startDate": "2026-11-11",
  "lastSeenDate": "2026-11-11",
  "isActive": true,
  "scrapedAt": "2026-11-14T00:00:00Z"
}
```

A run summary is also stored in the Default Key-Value Store under `OUTPUT` with `adsDelivered`, `byNetwork`, `skippedByDelta`, `stoppedByBudget`, and `errorsByNetwork`.

***

### Platform Limits & Practical Notes (Unauthenticated Public Access)

- **LinkedIn Ad Library**: Public SSR search & pagination work without login; detail enrichment (`enrichDetails: true`) fetches each ad's detail page with conservative pacing to avoid rate-limiting.
- **Google Ads Transparency Center**: Supports domain (`hubspot.com`), advertiser ID (`AR...`), and suggestion-resolved company queries with cursor pagination and EU DSA breakdowns.
- **TikTok Creative Center**: Unauthenticated Top Ads (`top_ads/v2/list`) returns up to 20 top creatives per `(country, order_by, industry, period)` slice on page 1 and does not support server-side keyword filtering without a logged-in Business session. Use `countries`, `tiktokIndustry`, and `tiktokOrderBy` to slice trends effectively.

***

### Local Development & Testing

```bash
python -m venv .venv
source .venv/bin/activate  # or .venv\Scripts\activate on Windows
pip install -r requirements-dev.txt
pytest -v
```

# Actor input Schema

## `networks` (type: `array`):

Select which ad transparency / creative networks to extract from.

## `keywords` (type: `array`):

Search keywords (used directly in LinkedIn Ad Library keyword search, as fallback query in Google Suggestions, and as optional local filter on TikTok Top Ads).

## `advertisers` (type: `array`):

Company/advertiser names (e.g. 'HubSpot', 'Salesforce'), Google Advertiser IDs (e.g. 'AR10072600183532683265'), or domains (e.g. 'hubspot.com'). Used by LinkedIn (accountOwner) and Google Ads Transparency Center.

## `domains` (type: `array`):

Explicit domains to look up on Google Ads Transparency Center (e.g. 'hubspot.com', 'monday.com'). Any domain-like value in 'advertisers' is also queried automatically.

## `countries` (type: `array`):

Optional ISO 3166-1 alpha-2 country codes (e.g. 'US', 'FR', 'DE', 'GB', 'CA'). Leave empty for global / all regions. EU countries unlock DSA impression ranges on LinkedIn & Google.

## `dateRange` (type: `string`):

Lookback period for ad activity (maps to LinkedIn dateOption, TikTok period, and Google creative recency).

## `adFormats` (type: `array`):

Filter by creative format. Leave as 'all' to capture every ad format.

## `tiktokIndustry` (type: `string`):

Optional TikTok Creative Center industry name (e.g. 'Business Services', 'Tech & Electronics', 'App', 'E-Commerce') or numeric industry ID (e.g. '24000000000').

## `tiktokOrderBy` (type: `string`):

How TikTok Top Ads are ranked when fetching.

## `enrichDetails` (type: `boolean`):

Fetch per-ad detail endpoints (LinkedIn detail page, Google GetCreativeById, TikTok detail API) to retrieve landingPageUrl, EU DSA impressionsRange, country breakdown, dates, and high-res mediaUrls.

## `extractLandingDomainInfo` (type: `boolean`):

Strips UTM and ad-tracking parameters (utm\_\*, gclid, ttclid, li_fat_id, trk, etc.) from landingPageUrl and populates clean advertiserDomain for instant B2B enrichment in Clay or n8n.

## `onlyNew` (type: `boolean`):

Store seen ad IDs in Apify Key-Value Store and only output & charge for newly launched creatives since previous runs.

## `deltaStoreKey` (type: `string`):

Key-Value Store record name used when onlyNew=true. Customize this to isolate separate competitor watchlists.

## `maxAdsPerNetwork` (type: `integer`):

Maximum creatives to collect per selected network.

## `maxTotalAds` (type: `integer`):

Hard cap on total creatives pushed across all networks in a single run.

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

Optional Apify Proxy settings. Disabled by default so Google Ads and TikTok Creative Center run proxy-free at minimal cost. Note: LinkedIn Ad Library blocks AWS datacenter IPs on Apify Cloud (HTTP 403) — enable Apify Residential Proxy when scraping LinkedIn remotely.

## Actor input object example

```json
{
  "networks": [
    "linkedin",
    "google",
    "tiktok"
  ],
  "keywords": [
    "crm",
    "ai automation"
  ],
  "advertisers": [
    "HubSpot"
  ],
  "domains": [
    "hubspot.com"
  ],
  "countries": [
    "US",
    "FR"
  ],
  "dateRange": "30d",
  "adFormats": [
    "all"
  ],
  "tiktokIndustry": "",
  "tiktokOrderBy": "like",
  "enrichDetails": true,
  "extractLandingDomainInfo": true,
  "onlyNew": false,
  "deltaStoreKey": "seen_ads",
  "maxAdsPerNetwork": 50,
  "maxTotalAds": 150,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `ads` (type: `string`):

Unified AdCreative items across LinkedIn Ad Library, Google Ads Transparency Center, and TikTok Creative Center. Append ?format=csv or ?format=json for Clay, n8n, Make, or BI import.

## `summary` (type: `string`):

Run metrics broken down by network, delta skips, budget status, and execution stats.

# 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 = {
    "networks": [
        "linkedin",
        "google",
        "tiktok"
    ],
    "keywords": [
        "crm",
        "ai automation"
    ],
    "advertisers": [
        "HubSpot"
    ],
    "domains": [
        "hubspot.com"
    ],
    "countries": [
        "US",
        "FR"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("vesper_studio/multi-network-ad-spy").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 = {
    "networks": [
        "linkedin",
        "google",
        "tiktok",
    ],
    "keywords": [
        "crm",
        "ai automation",
    ],
    "advertisers": ["HubSpot"],
    "domains": ["hubspot.com"],
    "countries": [
        "US",
        "FR",
    ],
}

# Run the Actor and wait for it to finish
run = client.actor("vesper_studio/multi-network-ad-spy").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 '{
  "networks": [
    "linkedin",
    "google",
    "tiktok"
  ],
  "keywords": [
    "crm",
    "ai automation"
  ],
  "advertisers": [
    "HubSpot"
  ],
  "domains": [
    "hubspot.com"
  ],
  "countries": [
    "US",
    "FR"
  ]
}' |
apify call vesper_studio/multi-network-ad-spy --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,vesper_studio/multi-network-ad-spy"
        }
    }
}
```

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/URHTZILgfDvegJhOa/builds/FIZFiBfqgfTrDE1vX/openapi.json
