# TikTok Commercial Ad Library Scraper (Competitor Ad Spy) (`automation_studio/tiktok-commercial-ads-scraper`) Actor

Spy on active TikTok video ads, scaling creatives, competitor hooks, target demographics, and landing page URLs directly from the official TikTok Commercial Content Library. Zero login required.

- **URL**: https://apify.com/automation_studio/tiktok-commercial-ads-scraper.md
- **Developed by:** [Automation Studio](https://apify.com/automation_studio) (community)
- **Categories:** E-commerce, Lead generation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.50 / 1,000 tiktok commercial ad records

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

## 🎯 TikTok Commercial Ad Library Scraper (Competitor Ad Spy)

> **Spy on active competitor video ads, find proven scaling creatives, uncover winning hooks, and download HD video creatives directly from the official TikTok Commercial Content Library.** Zero login, zero cookies, 100% compliant.

***

### ⚡ What Does This Actor Do?

Performance marketing agencies, DTC e-commerce brands, and dropshippers burn thousands of dollars testing cold video creatives that fail. Meanwhile, your top competitors have already spent millions testing video hooks, scripts, and angles—and their **active winning ads are publicly documented** inside TikTok's official Commercial Content Library.

This high-speed intelligence engine extracts live TikTok video ads, downloadable CDN streaming URLs, HD thumbnail covers, exact ad copy, targeted countries, audience reach tiers, and demographic breakdowns in seconds.

***

### 🏆 Feature Comparison: Us vs. Generic Competitors

| Feature | 🎯 TikTok Commercial Ad Spy | ❌ Generic Scrapers |
| :--- | :---: | :---: |
| **Authentication Required** | **None (100% Cookieless)** | Session cookies / Login needed |
| **Scaling Winner Indicator** | **Yes (`adLongevityDays >= 30`)** | None (Manual calculation) |
| **Direct MP4 Video Streaming**| **Yes (Instant CDN Link)** | Often missing or broken |
| **Visual Gallery Table View** | **Yes (Inline Covers)** | Raw text URLs |
| **Target Demographic Breakdown**| **Age & Gender Distributions** | Generic data only |
| **Execution Speed** | **<20 Seconds per Batch** | 3–5 Minutes |
| **Account Ban Risk** | **0% Safe (Public API)** | High (Session flags) |

***

### 🚀 Key Features & Unfair Advantages

- 🚀 **100% Cookieless & Zero Login**: Does not require any TikTok account, login credentials, session cookies, or browser extensions.
- 🔥 **Automated Scaled Winner Detection (`adLongevityDays`)**:
  - Calculates exact duration (`lastSeen - firstSeen`).
  - Ads running for 30+ consecutive days are flagged with the **`🔥 SCALING_WINNER`** badge. Marketers know: advertisers only keep paying for ads if they are profitable and printing positive ROAS.
- 📹 **Direct HD Video Streaming URLs**:
  - Get instant, direct CDN MP4 links to preview, download, and archive high-converting competitor videos before campaigns are paused.
- 🖼️ **Visual Thumbnail Gallery**:
  - Direct HD thumbnail cover images rendered inline in the Apify Console dataset table for instant visual scanning.
- 🎯 **Deep Demographic & Targeting Intelligence**:
  - Uncover targeted age brackets (`18-24`, `25-34`, `35-44`, `45+`), gender splits, reach tiers (`0-1K`, `10K-100K`, `1M+`), and advertiser legal registration entities.
- 🌍 **Global Country Filtering**:
  - Search across all European Union countries or narrow down by specific markets (UK, Germany, France, Spain, Italy, etc.).
- ⚡ **Real-Time Data Streaming**:
  - Records stream directly to your dataset table microsecond-by-microsecond as they are parsed.

***

### 📊 Sample Output Record

```json
{
  "adId": "1878333269305666",
  "advertiserName": "glasgymguy",
  "adTitle": "Gym. #gymshark",
  "adLongevityDays": 0,
  "scalingStatus": "🧪 FRESH_TEST (<7 Days Active)",
  "estimatedAudience": "0-1K",
  "firstShownDate": "2026-10-06",
  "lastShownDate": "2026-10-06",
  "videoCoverUrl": "https://p16-common-sign.tiktokcdn.com/tos-no1a-p-0037-no/ogwC9aFjKEDKQ5BAHL5gfKEjpMIFV3eFkDdN0B~tplv-noop.image?...",
  "videoUrl": "https://library.tiktok.com/api/v1/cdn/1791400095/video/...",
  "industry": "Apparel & Accessories",
  "targetRegion": "ALL",
  "searchQuery": "Gymshark",
  "cclDetailUrl": "https://library.tiktok.com/ads/detail/?ad_id=1878333269305666",
  "scrapedAt": "2026-10-08T00:11:48.123456+00:00"
}
```

***

### 🛠️ Input Parameters

| Parameter | Type | Default | Description |
| :--- | :--- | :--- | :--- |
| `searchQueries` | Array | `["Gymshark"]` | Competitor brand names or product keywords to search. |
| `countryCode` | Select | `"all"` | Target ad country (UK, Germany, France, Spain, or Global). |
| `maxAds` | Integer | `10` | Maximum number of ads to extract per search keyword. |
| `dateRangeDays` | Select | `"30"` | Timeframe to look back (7, 30, 90, 180, or 365 days). |
| `onlyScalingWinners` | Boolean | `false` | When enabled, only returns ads active for 7+ consecutive days. |
| `enrichTargetingDetails`| Boolean | `false` | Deep demographic enrichment (age brackets, gender, and legal entity). |
| `proxyConfiguration` | Object | Datacenter | Apify proxy configuration (automatic). |

***

### 💡 How To Find 7-Figure Winning Creatives

1. **Enter Competitor Brand Names**: Enter 3-5 top direct competitors in your niche (e.g., `Gymshark`, `Alo Yoga`, `Lululemon`).
2. **Set Timeframe to 90 Days**: Look for ads with `adLongevityDays >= 30`.
3. **Analyze The First 3 Seconds (The Hook)**: Download the top scaling videos and study their visual hook, text overlay, and initial audio trigger.
4. **Remix For Your Brand**: Apply their winning hook structure and pacing to your own product!

***

### 🔌 API Integration Examples

#### Python (`apify-client`)

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_APIFY_TOKEN")

run_input = {
    "searchQueries": ["Gymshark", "Nike"],
    "countryCode": "all",
    "maxAds": 25,
    "dateRangeDays": "90",
    "onlyScalingWinners": True
}

run = client.actor("automation_studio/tiktok-commercial-ads-scraper").call(run_input=run_input)

for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(f"[{item['scalingStatus']}] {item['advertiserName']} -> {item['videoUrl']}")
```

#### Node.js / JavaScript (`apify-client`)

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: 'YOUR_APIFY_TOKEN' });

const run = await client.actor('automation_studio/tiktok-commercial-ads-scraper').call({
    searchQueries: ['Gymshark'],
    countryCode: 'all',
    maxAds: 20
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(`Discovered ${items.length} scaling TikTok creatives.`);
```

***

### ❓ Frequently Asked Questions (FAQ)

##### Do I need a TikTok account or cookies?

No. This scraper interfaces directly with TikTok's official EU Digital Services Act (DSA) transparency portal (`library.tiktok.com/ads`), which is 100% public. Zero login or cookies needed.

##### Can I download the video files?

Yes. Every discovered ad containing video assets provides a direct, unexpired CDN streaming link (`videoUrl`) in MP4 format.

##### How is `adLongevityDays` computed?

It computes the exact difference in days between `lastShownDate` and `firstShownDate`. Ads running for 30+ days receive the `🔥 SCALING_WINNER` badge because brands only keep paying for ads that generate positive ROAS.

# Actor input Schema

## `searchQueries` (type: `array`):

Enter the competitor brand names or niche product keywords you want to inspect (e.g., Gymshark, Nike, posture corrector, ice bath).

## `countryCode` (type: `string`):

Select the target geographic region for the ads, or choose 'All Countries' for global commercial reach.

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

Maximum number of qualified ads to extract per search keyword. Default is 10 for rapid 10-second trials.

## `dateRangeDays` (type: `string`):

How far back to look for active ads. E.g., 30 days captures currently active or recently scaled ads.

## `onlyScalingWinners` (type: `boolean`):

When enabled, filters out short-lived test ads and only returns creatives that have been running for at least 7 consecutive days.

## `enrichTargetingDetails` (type: `boolean`):

When enabled, fetches individual ad demographic targeting reports (exact age distribution, gender breakdown, and advertiser entity registration). Leave disabled for ultra-fast scraping.

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

Optional proxy settings. Apify Datacenter proxies are automatically configured by default.

## Actor input object example

```json
{
  "searchQueries": [
    "Gymshark"
  ],
  "countryCode": "all",
  "maxAds": 10,
  "dateRangeDays": "30",
  "onlyScalingWinners": false,
  "enrichTargetingDetails": false,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

Dataset containing parsed ad records

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("automation_studio/tiktok-commercial-ads-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 = {}

# Run the Actor and wait for it to finish
run = client.actor("automation_studio/tiktok-commercial-ads-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 '{}' |
apify call automation_studio/tiktok-commercial-ads-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,automation_studio/tiktok-commercial-ads-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/NgRZD1eMIQnLewkSh/builds/iX1SPuHQfaQ5lwXpj/openapi.json
