# TikTok Ad Library Scraper — Competitor Ads & Creatives (`seemuapps/tiktok-ad-library-scraper`) Actor

Scrape every TikTok ad an advertiser is running — video/image creatives, ad copy, run dates and estimated audience — straight from the public ad library.

- **URL**: https://apify.com/seemuapps/tiktok-ad-library-scraper.md
- **Developed by:** [Andrew](https://apify.com/seemuapps) (community)
- **Categories:** Social media, Marketing
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$10.00 / 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.

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

## TikTok Ad Library Scraper — Competitor Ads & Creatives

Pull every ad an advertiser is running on TikTok — video and image creatives, ad copy, run dates and estimated audience — straight from the public TikTok ad library. No login, no cookies, no TikTok account needed.

### What you get

Every record is one ad, with:

- **Creative** — direct video URL, cover image, and any additional images
- **Ad copy** — the on-screen ad text
- **Advertiser** — the advertiser name as declared to TikTok
- **Format and status** — ad format code and audit status
- **Flight dates** — first and last date the ad was shown
- **Estimated audience** — TikTok's disclosed audience size band, where available

### Use cases

- **Competitor ad research** — see exactly which video and image ads a rival is currently running
- **Ad creative inspiration** — build a swipe file of high-performing TikTok ad copy and creative in your category
- **Messaging analysis** — track how competitors position their product on TikTok, and when messaging shifts
- **Launch monitoring** — catch new competitor campaigns as soon as they go live
- **Agency pitching** — show a prospect what their competitors are spending TikTok ad budget on

### How to use

1. Pick a **Search mode**:
   - **Advertiser** — every ad from one advertiser (enter a name, e.g. `nike`)
   - **Keyword** — every ad whose copy mentions a phrase (e.g. `running shoes`)
2. Set **Max ads** (default 100; set `0` for unlimited)
3. Run the actor — results appear in the **Dataset** tab

#### Fetching more than one run's worth

The actor paginates automatically to fill your **Max ads**. To keep going past that, open the **Key-value store** tab after the run → copy the `NEXT_PAGE_ID` value → paste it into **Page ID** on your next run. If `NEXT_PAGE_ID` is `null`, you've fetched every matching ad.

### Output format

Each dataset record:

```json
{
  "adId": "1874467016217649",
  "adLibraryUrl": "https://library.tiktok.com/ads/detail/?ad_id=1874467016217649",
  "advertiser": "Duolingo, Inc.",
  "adText": "The #1 app for learning languages",
  "imageUrl": "https://p16-common-sign.tiktokcdn.com/...",
  "videoUrl": "https://library.tiktok.com/api/v1/cdn/...",
  "coverImageUrl": "https://p16-common-sign.tiktokcdn.com/...",
  "images": ["https://p16-common-sign.tiktokcdn.com/..."],
  "adFormat": "2",
  "estimatedAudience": "-",
  "firstShownAt": "2026-08-25T00:00:00.000Z",
  "lastShownAt": "2026-08-29T00:00:00.000Z"
}
```

### Pricing

Pay-per-event — you're charged **$10 per 1,000 ads** actually returned to your dataset. No charge for empty searches.

# Actor input Schema

## `searchMode` (type: `string`):

Search the ad library by advertiser name, or by a keyword that appears in the ad copy.

## `advertiserName` (type: `string`):

Advertiser to pull ads for, e.g. 'nike'. Used when Search mode is 'Advertiser'.

## `keyword` (type: `string`):

Phrase to search for inside ad copy, e.g. 'running shoes'. Used when Search mode is 'Keyword'.

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

Maximum number of ads to return in this run. Set 0 for unlimited (the run will paginate until the library is exhausted or the run times out).

## `pageId` (type: `string`):

Paste NEXT\_PAGE\_ID from the previous run's Key-value store to continue where that run stopped.

## Actor input object example

```json
{
  "searchMode": "advertiser",
  "advertiserName": "duolingo",
  "maxItems": 100
}
```

# Actor output Schema

## `results` (type: `string`):

One ad per record. Fields: adId, adLibraryUrl, advertiser, resolvedAdvertiserName, adText, imageUrl, videoUrl, coverImageUrl, images, adFormat, auditStatus, estimatedAudience, impressions, spend, firstShownAt, lastShownAt, searchQuery.

## `nextPageId` (type: `string`):

NEXT\_PAGE\_ID record in the default key-value store. Paste into Page ID on the next run to resume; null when every ad has been fetched.

# 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 = {
    "advertiserName": "duolingo"
};

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

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

```

## MCP server setup

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