# TikTok Ad Library Scraper - Ads, Creatives & Audience Targeting (`sourabhbgp/tiktok-ads-scraper`) Actor

Search TikTok's ad library by advertiser or browse a whole country. Get ad creatives, run dates, advertiser details and the full audience breakdown: impressions by age, gender and country. Covers the EU, EEA, UK, Switzerland and Turkey.

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

## Pricing

Pay per event

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/platform/actors/running/actors-in-store#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: ads, creatives, advertisers & audience targeting

Search every ad running on TikTok in Europe by advertiser or browse a whole country. Get the creative, the dates it ran, and who it was aimed at.

**$2.00 per 1,000 ads. $6.00 per 1,000 with the full audience breakdown. No subscription.**

Covers 33 countries: the EU and EEA, the UK, Switzerland and Turkey.

### Why this scraper?

- 📊 **Impressions by age and gender, not yes/no.** Most scrapers tell you an age band was targeted. This one tells you how many impressions it actually got, per band, per gender, per country.
- 💰 **One price, compute included.** Several scrapers in this category bill you for Apify platform usage on top of the per-ad fee, so the sticker price is not the bill. Here it is.
- 🎯 **You only pay for what arrives.** Ads that don't match your search term are dropped and never charged. If an ad's audience data can't be read, that row is charged as a plain ad, not as an enriched one.
- 🚀 **No proxy setup, no login, no cookies to paste.** Bot protection is handled for you.
- 🧾 **Fields that are always empty are not shipped.** TikTok bans political ads, so it never publishes spend figures for the ads in here. Rather than hand you a `spend` column full of nulls, there isn't one.
- ⚡ **Fast where it counts.** The plain ad search runs without a browser at all.

### What data can you extract?

| Group | Fields |
|---|---|
| Ad | ad ID, caption, first shown, last shown, estimated audience, link to the ad page |
| Creative | video URLs, cover images, still images |
| Advertiser | name, business ID, registered country, who paid for it |
| Objective | what the advertiser optimised for: sales, traffic, reach, community interaction |
| Reach | total impressions, number of countries, target audience size |
| **Audience** | **impressions split by age band × gender × country** |
| Targeting setup | countries, cities, provinces, languages, devices, operating systems, interests, high-spending-power flag, whether an audience was excluded |

### Scraping modes

**Ad search** (default). Creative, advertiser and dates for every matching ad. Runs without a browser, so it's the cheap, fast path. Use it when you want to see what a brand is running, or sweep a whole market.

**Ad search with audience targeting** (`includeTargeting: true`). Everything above plus the full audience breakdown for each ad. Slower and priced higher because each ad has to be opened individually. Use it when you care *who* an ad reached, not just that it ran.

### How to scrape the TikTok ad library: step by step

1. Pick a country from the dropdown.
2. Type an advertiser name, or leave it blank to browse everything running in that country.
3. Set how many days back to look and how many ads you want.
4. Tick **Include audience targeting** if you need the age/gender breakdown.
5. Run it. Export to JSON, CSV, Excel or Google Sheets.

### How much does TikTok Ad Library Scraper cost?

Pay per ad, nothing else.

- **$2.00 per 1,000 ads** without targeting.
- **$6.00 per 1,000 ads** with the full audience breakdown.
- Plus a small per-run start fee of $0.005 per GB of memory (about $0.01 on the default setting).

The Apify Free plan gives you $5 in credits a month, roughly **2,500 ads** or **833 ads with targeting**. The $29/month Starter plan covers about **14,500 ads**, or **4,833 with targeting**.

No subscription lock-in. Pause whenever.

### Input

```json
{
  "country": "FR",
  "searchTerm": "Nike",
  "daysBack": 30,
  "maxResults": 500,
  "includeTargeting": true
}
```

`searchTerm` matches the advertiser name or words in the ad caption. Leave it empty to browse every ad in that country and date window. Ads that do not contain the term are dropped before they reach you, and are never charged.

### Output

One row per ad. Plain search:

```json
{
  "adId": "1872851388756274",
  "adTitle": "Summer drop is live",
  "advertiserName": "NIKE Retail B.V.",
  "targetCountry": "FR",
  "firstShownDate": "2026-08-08T13:34:22.000Z",
  "lastShownDate": "2026-08-09T09:12:04.000Z",
  "estimatedAudience": "1K-10K",
  "videoUrls": ["https://library.tiktok.com/..."],
  "coverImageUrls": ["https://p16-common-sign.tiktokcdn.com/..."],
  "imageUrls": [],
  "adUrl": "https://library.tiktok.com/ads/detail/?ad_id=1872851388756274&region=FR",
  "targetingEnriched": false
}
```

With `includeTargeting: true`, every row also carries:

```json
{
  "advertisingObjective": "Sales",
  "advertiserBusinessId": "7671651246943797249",
  "advertiserRegistryLocation": "Netherlands",
  "totalRegions": 1,
  "totalImpressions": "1K-10K",
  "targetAudienceSize": "18.8M-23.0M",
  "impressionsByRegion": [
    { "region": "FR", "impressions": "9K" }
  ],
  "impressionsByAgeGender": [
    { "region": "FR", "age": "18-24", "gender": "MALE", "impressions": "2K" },
    { "region": "FR", "age": "18-24", "gender": "FEMALE", "impressions": "2K" },
    { "region": "FR", "age": "25-34", "gender": "MALE", "impressions": "2K" }
  ],
  "targetedCountries": ["FR"],
  "targetedOperatingSystems": ["ALL"],
  "highSpendingPower": "No",
  "excludesAudience": "No",
  "targetingEnriched": true
}
```

`impressionsByAgeGender` is the interesting one: six age bands times three genders times every country the ad ran in, one entry per cell, with the impression band TikTok reports for it.

### Use cases

- **Competitor creative tracking.** Pull everything a rival is running, weekly, and diff it. The caption, the video and the run dates are all there.
- **Audience research before a launch.** See which age and gender split competitors actually reach in your market, rather than guessing from a media kit.
- **Creative libraries for agencies.** Build a searchable archive of what works in a category, with the video files attached.
- **Market entry sizing.** Browse a whole country to see who is advertising, how heavily, and to whom.
- **Compliance and brand safety.** Check who is paying for ads that mention your brand, using the "paid for by" and registered-country fields.

### Limitations

- **Europe only.** TikTok publishes this library for the EU and EEA, the UK, Switzerland and Turkey. There is no US data here, because TikTok does not publish it. Pick an unsupported country and the run stops immediately with the list of valid ones, rather than quietly returning nothing.
- **No spend figures.** TikTok only publishes spend for political advertising, which it bans. No ad in this library has a spend number, so the field isn't in the output.
- **Impressions are bands, not exact counts.** You get `2K` or `1M-10M`, because that is what TikTok reports.
- **Media links expire.** Video and cover-image URLs are signed by TikTok and stop working after a while. Download anything you want to keep.
- **Some ads have no caption or advertiser name.** Around half the ads in a broad sweep have no caption. That's the source data, not a parsing gap.
- **A search term can hit a ceiling.** TikTok sometimes reports a large match count and then stops serving well before it. A term reporting 771 matches returned 24 ads. When that happens the run says so in its status rather than pretending it finished.
- **Targeting detail is slower, and coverage varies by country.** Each ad is opened individually, at roughly 5 seconds per ad. Coverage measured 100% for France and Germany, but 16% on one Italian sample. Ads whose audience data cannot be read still arrive, with the targeting fields empty, and they are charged at the plain ad rate rather than the targeting rate.
- **City, province, language and device targeting are usually empty.** Most advertisers don't set them. When they do, you get them.

### FAQ

#### How much does TikTok Ad Library Scraper cost?

Pay-per-result. **$2.00 per 1,000 ads**, or **$6.00 per 1,000** with audience targeting. The Apify Free plan's $5 monthly credit covers roughly 2,500 ads; the $29 Starter plan covers about 14,500. No subscription lock-in.

#### Is it legal to scrape the TikTok ad library?

Scraping public data is generally allowed in the US and most of the EU, as long as you don't collect personal data covered by GDPR or CCPA without a lawful basis. This library is a public transparency database that TikTok is required to publish, and this actor only reads it. How you use the output is on you.

Apify's full breakdown: [Is web scraping legal?](https://blog.apify.com/is-web-scraping-legal/).

#### Why not use TikTok's official Commercial Content API?

You can, if you qualify. It is part of TikTok's research programme and needs an approved application with a client key and secret, which rules out most commercial users. It also returns less: reach is bucketed, and there is no age and gender breakdown. This actor reads the same public library the API is built on, and returns more of it.

#### Can I integrate it with other tools?

Push results into **Make, Zapier, Slack, Airbyte, GitHub, Google Sheets, Google Drive**, and more. Apify treats every actor as a webhook source, so anything that consumes webhooks or pulls from an API works.

Full list: [Apify integrations](https://docs.apify.com/platform/integrations).

#### Can I use it with the Apify API?

Yes. Every run is available via the Apify REST API:

```bash
curl -X POST "https://api.apify.com/v2/acts/sourabhbgp~tiktok-ads-scraper/runs?token=APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"country":"FR","searchTerm":"Nike","maxResults":500}'
```

Docs: [Apify API reference](https://docs.apify.com/api/v2).

#### Can I use it through an MCP server?

Yes. Apify ships an MCP server that exposes every actor as a tool, so Claude Desktop, Cursor, and any other MCP-capable client can call this one. Setup: [Apify MCP docs](https://docs.apify.com/platform/integrations/mcp).

***

### Your feedback

Bug, missing field, or odd behavior? Drop a note in the [Issues tab](https://console.apify.com/actors/Rpsqe2MZFHXTPG8qv/issues). Reports go to a human and fixes usually ship the same week.

# Actor input Schema

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

The country the ads were shown in. TikTok's ad library covers the EU and EEA, the UK, Switzerland and Turkey.

## `searchTerm` (type: `string`):

Match ads by advertiser name or words in the ad caption, for example a brand name or hashtag. Leave empty to browse every ad in the country and date range. Ads that do not contain the term are dropped and never charged.

## `daysBack` (type: `integer`):

How many days of ad history to cover, counting back from today.

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

Stop after this many ads. Each ad is one row.

## `includeTargeting` (type: `boolean`):

Add the full targeting breakdown to every ad: impressions split by age and gender for each country, plus objective, audience size, languages, devices and interests. This opens each ad in a browser, so it is slower and costs more. Leave off if you only need the creatives and dates.

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

Apify datacenter proxy is enough for everything this Actor does, including audience targeting. Leave the default unless you have a reason to change it.

## Actor input object example

```json
{
  "country": "FR",
  "searchTerm": "Nike",
  "daysBack": 30,
  "maxResults": 100,
  "includeTargeting": false,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

Every ad found, one row each.

# 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 = {
    "country": "FR",
    "searchTerm": "Nike",
    "daysBack": 30,
    "maxResults": 100
};

// Run the Actor and wait for it to finish
const run = await client.actor("sourabhbgp/tiktok-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 = {
    "country": "FR",
    "searchTerm": "Nike",
    "daysBack": 30,
    "maxResults": 100,
}

# Run the Actor and wait for it to finish
run = client.actor("sourabhbgp/tiktok-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 '{
  "country": "FR",
  "searchTerm": "Nike",
  "daysBack": 30,
  "maxResults": 100
}' |
apify call sourabhbgp/tiktok-ads-scraper --silent --output-dataset

```

## MCP server setup

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