# TikTok Ad Library Scraper: Ads, Reach & Targeting (`onibaku/tiktok-ad-library`) Actor

Get TikTok ads from the official TikTok Ad Library (EU, EEA, UK, Switzerland, Turkey): ad text, video and images, first and last shown, unique users reached per country, landing page, and the age, gender, interest and audience targeting published under the DSA. Search by advertiser or keyword.

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

## Pricing

from $0.60 / 1,000 ad returneds

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 Ad Library Scraper (Ads, Reach and Targeting)

See **the TikTok ads any brand runs in Europe**, with the numbers TikTok publishes about them. Search by advertiser or
keyword and get one clean, flat dataset from the **official TikTok Ad Library**: ad text, video and images, first and
last shown, **unique users reached per country**, the landing page, the advertiser's TikTok account, who paid, and
the **targeting**: ages, genders, interests and audience size.

Since the EU's Digital Services Act, TikTok has to publish every ad shown in the EU and EEA (plus the UK, Switzerland
and Turkey) with this detail. This actor reads the library the way your browser does, with no login, and turns it into
rows you can filter, sort and chart.

### What it's for

- **Competitor ad research:** every TikTok ad a rival ran in the last month, which countries, how many people saw it
  and who it targeted.
- **Agencies:** audit a prospect's TikTok advertising before the pitch, or benchmark a client against its category.
- **Creative research:** pull the most-seen ads for a keyword (`sortBy: reach`) and study the hooks.
- **Targeting intelligence:** see the age bands, genders and interest groups competitors pay to reach.
- **AI agents:** one call answers "what TikTok ads did Nike run in Germany this month?" (see MCP below).

### Input

| Field | What it does |
| --- | --- |
| `queries` | Advertiser names or keywords, exact phrases in quotes, or library search URLs. See below. |
| `region` | Where the ads were shown: an EU or EEA country code, `GB`, `CH`, `TR`, or `all`. |
| `startDate`, `endDate` | Only ads shown in this window (`YYYY-MM-DD`). Defaults to the last 30 days. |
| `format` | `all`, `video`, `image` or `text`. |
| `status` | `all`, `active` or `inactive`. |
| `sortBy` | `lastShown` (default), `published` or `reach` (most unique users first). |
| `includeDetails` | Advertiser details, landing page, reach per country and targeting (on by default). |
| `maxResultsPerQuery`, `maxResults` | Caps (defaults 200 and 1,000). |
| `proxyConfiguration` | Apify Proxy, on by default. Keep it on (see Good to know). |

**What you can put in `queries`:**

- A keyword or advertiser name, as you'd type it in the library: `nike`. This matches advertiser names and ad text, so
  it also finds creators' ads that mention the brand.
- An exact phrase in quotes: `"just do it"`.
- **One advertiser only:** paste that advertiser's library search URL. Every row has it as `advertiserAdsUrl`, so run a
  keyword search once, pick the advertiser, and use its URL from then on.
- Any `library.tiktok.com/ads?...` URL copied from your browser. The actor takes who or what it searches for from the
  URL; country, dates, format, status and sorting always come from the input.

**Nike's ads in Germany, most-seen first:**

```json
{
    "queries": ["https://library.tiktok.com/ads?adv_name=NIKE%20Retail%20B.V.&region=all&query_type=2&adv_biz_ids=6876453864464188162"],
    "region": "DE",
    "sortBy": "reach"
}
```

**Active video ads for a keyword across Europe:**

```json
{
    "queries": ["protein powder"],
    "format": "video",
    "status": "active",
    "maxResults": 300
}
```

### Output

One row per ad:

```json
{
    "platform": "tiktok",
    "query": "nike",
    "advertiserName": "NIKE Retail B.V.",
    "advertiserId": "6876453864464188162",
    "adId": "1879069070553138",
    "format": "image",
    "firstShown": "2026-10-14T00:00:00.000Z",
    "lastShown": "2026-10-24T00:00:00.000Z",
    "regions": ["GB"],
    "uniqueUsersSeen": "10K-100K",
    "uniqueUsersByRegion": [{ "region": "GB", "users": "46K" }],
    "body": "Work without compromise in the Nike Hybrid RN.",
    "landingUrl": "https://www.nike.com/gb/w/hybrid-training-8wvhh?cp=62135823270_brs_CR28K0FJHQCV",
    "detailsIncluded": true,
    "imageUrls": ["https://p16-common-sign.tiktokcdn.com/ad-site-i18n-sg/202610125d0d8ec84cce0fe64d4ab26c~tplv-tiktokx-origin.jpeg?..."],
    "videoUrls": [],
    "videoCoverUrls": [],
    "adUrl": "https://library.tiktok.com/ads/detail/?ad_id=1879069070553138",
    "advertiserAdsUrl": "https://library.tiktok.com/ads?adv_name=NIKE%20Retail%20B.V.&region=all&query_type=2&adv_biz_ids=6876453864464188162",
    "industry": "Apparel & Accessories",
    "advertiserCountry": "Netherlands",
    "paidFor": "INITIATIVE MEDIA B.V.",
    "tiktokUsername": "nike",
    "tiktokDisplayName": "Nike",
    "tiktokProfileUrl": "https://www.tiktok.com/share/user/208464585232822272?source=ad_review",
    "tiktokFollowers": "9.3M",
    "targetAges": ["18-24", "25-34"],
    "targetGenders": ["female", "male", "unknown"],
    "targetAudienceSize": "7.6M-9.2M",
    "targetInterests": "Health & Fitness, Sports & Fitness, Exercise & Fitness, Physical Fitness, Sports",
    "targetCustomAudience": "No",
    "targetVideoInteractions": null,
    "targetCreatorInteractions": null,
    "targetLocations": [],
    "targetLanguages": [],
    "targetDevices": [],
    "targetSpendingPower": null
}
```

- `uniqueUsersSeen` and `uniqueUsersByRegion` are TikTok's own estimates of unique users who saw the ad, as ranges or
  rounded numbers, the way the library shows them.
- `paidFor` is who paid for the ad when it isn't the advertiser (often the media agency).
- `targetCustomAudience` says whether the advertiser used its own audience list.
- With `includeDetails` off you still get the advertiser name, format, dates, text, media and overall reach, but not
  the landing page, per-country reach or targeting.

### Pricing

**$0.0006 per ad returned**, plus **$0.0019 per ad that comes with its targeting and landing page** (the
`includeDetails` lookup, which needs extra browser sessions), plus a token $0.00005 per run. 1,000 ads cost $0.60
without details or $2.50 with them. Ads where TikTok doesn't give the details are charged the base price only, and
searches that find nothing cost nothing.

### Good to know

- The library only covers ads shown in the EU, EEA, UK, Switzerland and Turkey. US-only campaigns aren't in it.
- TikTok lets each IP see only a few ad details in a short while. With Apify Proxy on, the actor moves to a fresh proxy
  session when that happens; without a proxy, ads after the first few come without targeting.
- Image and video links are signed by TikTok and expire after a day or so. Download what you need straight away.
- The library is a JavaScript app, so the actor runs a real browser (1 GB memory). It reads the same responses the page
  gets, never logs in and never solves CAPTCHAs.
- TikTok also has a Commercial Content API for approved researchers. This actor doesn't need an application.

### Use it from Claude, ChatGPT or Cursor (MCP)

AI assistants can call this actor as a tool through Apify's MCP server. Add this server URL to your MCP client and
sign in with your Apify account when prompted:

```
https://mcp.apify.com?tools=onibaku/tiktok-ad-library
```

### More ad libraries

- [Google Ads Transparency Center Scraper](https://apify.com/onibaku/google-ads-transparency): every search, display,
  Shopping and YouTube ad an advertiser runs on Google, with dates, regions and creatives.

### Data source

The [TikTok Ad Library](https://library.tiktok.com/ads), TikTok's public repository of ads shown in Europe under the
Digital Services Act. Every row's `adUrl` links to the ad there.

Questions or feature requests? Open an issue on the actor's Issues tab or email admin@onibaku.co.uk.

# Actor input Schema

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

What you'd type in the library's search box: an advertiser name or keyword (nike), or an exact phrase in quotes ("just do it"). For one advertiser's ads only, paste its library search URL (every result has it as advertiserAdsUrl). Any library.tiktok.com/ads URL works.

## `region` (type: `string`):

Where the ads were shown: an EU or EEA country code (DE, FR, NL...), GB, CH or TR, or "all". The library only covers these countries.

## `startDate` (type: `string`):

YYYY-MM-DD. Defaults to 30 days before the end date.

## `endDate` (type: `string`):

YYYY-MM-DD. Defaults to today.

## `format` (type: `string`):

Only ads in this format.

## `status` (type: `string`):

Only ads that are still running, or only ones that have stopped.

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

Order the library returns ads in.

## `includeDetails` (type: `boolean`):

One extra lookup per ad for the advertiser's details, landing page, unique users per country and the targeting (age, gender, interests, audience size). Turn off for faster runs.

## `maxResultsPerQuery` (type: `integer`):

Stop after this many ads from any one search.

## `maxResults` (type: `integer`):

Stop after this many ads in total.

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

TikTok shows each IP only a few ad details at a time, so the actor moves between Apify Proxy sessions. Keep this on.

## Actor input object example

```json
{
  "queries": [
    "nike"
  ],
  "region": "all",
  "format": "all",
  "status": "all",
  "sortBy": "lastShown",
  "includeDetails": true,
  "maxResultsPerQuery": 200,
  "maxResults": 24,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `overview` (type: `string`):

No description

## `results` (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 = {
    "queries": [
        "nike"
    ],
    "region": "all",
    "maxResults": 24,
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("onibaku/tiktok-ad-library").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 = {
    "queries": ["nike"],
    "region": "all",
    "maxResults": 24,
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("onibaku/tiktok-ad-library").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 '{
  "queries": [
    "nike"
  ],
  "region": "all",
  "maxResults": 24,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call onibaku/tiktok-ad-library --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,onibaku/tiktok-ad-library"
        }
    }
}
```

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/qbk6V1hg2PLqFAbKz/builds/YjJtCigs53dr28tpE/openapi.json
