# TikTok Ads Library Scraper - Ad Creatives, Reach & Targeting (`hgservices/tiktok-ads-library-scraper`) Actor

Scrape TikTok ads from the TikTok Ad Library (EU, UK, Switzerland, Norway, Turkey) by keyword, advertiser or URL. Get ad videos, images, captions, run dates and reach. Add targeting, impressions by country, age and gender, landing page and CTA. Export JSON, CSV or Excel.

- **URL**: https://apify.com/hgservices/tiktok-ads-library-scraper.md
- **Developed by:** [Harish Garg](https://apify.com/hgservices) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 89.7% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.90 / 1,000 scraped ads

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

Scrape the **TikTok Ad Library** (library.tiktok.com), TikTok's public ad repository for Europe. Search by keyword or exact phrase, get every ad of an advertiser, or paste Ad Library URLs. Get one clean row per ad: **advertiser, caption, video and image links, first and last day shown, unique users reached and moderation status**.

Turn on **ad details** to add **targeting, impressions by country, age and gender, target audience size, landing page, call to action, advertising objective, industry, the advertiser's registered country, the sponsor and the advertiser's TikTok account**.

Export the data as JSON, CSV, Excel or HTML, or read it from the API.

No TikTok account. No API key. No coding needed.

### What does TikTok Ads Library Scraper do?

- **Keyword search** — every ad that matches a keyword, the same as the Ad Library search box.
- **Exact phrase search** — put a phrase in double quotes, for example `"free shipping"`.
- **Advertiser search** — all ads of one advertiser, by the advertiser's name.
- **Ad Library URLs** — paste a search, advertiser or single-ad URL from library.tiktok.com. The URL keeps all its filters.
- **Filters** — country, active or inactive ads, video or image ads, date range and sort order.
- **Ad details** — targeting and reach by country, age and gender, landing page, call to action and more.

### Why use this TikTok ad scraper?

- **Competitor ad research** — See which ads your competitors run on TikTok, since when, and how many people they reach.
- **Creative inspiration** — Collect the videos, images and captions of the ads that run longest or reach the most people.
- **Targeting research** — See which countries, ages and genders an advertiser targets, and the audience size.
- **Landing page and offer research** — Get the landing pages and calls to action of the ads in your market.
- **Brand monitoring** — Find ads that mention your brand or product.
- **Transparency and policy research** — Track ads that TikTok removed, by advertiser, country and period.

### Which countries are covered?

The TikTok Ad Library has ads shown in the **27 EU countries, Iceland, Liechtenstein, Norway, Switzerland, the United Kingdom, Turkey and Brazil**. It starts on **2022-10-01**. TikTok publishes this library under the EU Digital Services Act, so it has **no ads for the United States** or other countries.

### How to scrape the TikTok Ad Library

1. Click **Try for free** and sign in to Apify. A free account is enough.
2. Add one or more **Search keywords**, **Advertiser names** or **Ad Library URLs**.
3. Optional: set the countries, ad status, media type, dates and sort order.
4. Optional: turn on **Add ad details**.
5. Set **Maximum ads per search**.
6. Click **Start**.
7. Open the **Output** tab. View the ads as a table, or download them as JSON, CSV, Excel or HTML.

### Input

| Field | Type | Default | Description |
|-------|------|---------|-------------|
| `searchQueries` | string\[] | — | Keywords. Put a keyword in double quotes for an exact phrase. Each keyword is one search |
| `advertiserNames` | string\[] | — | Exact advertiser names, as the Ad Library shows them. Upper and lower case do not matter |
| `adLibraryUrls` | string\[] | — | library.tiktok.com search, advertiser or ad URLs |
| `countries` | string\[] | all | Country codes, for example `["DE", "FR"]` |
| `adStatus` | string | `all` | `all`, `active` or `inactive` |
| `mediaType` | string | `all` | `all`, `video` or `image` |
| `dateFrom` / `dateTo` | string | 2022-10-01 / today | Ads shown in this period (YYYY-MM-DD) |
| `sortBy` | string | `last_shown_newest` | `last_shown_newest`, `last_shown_oldest`, `first_shown_newest`, `first_shown_oldest`, `reach_highest` or `reach_lowest` |
| `includeAdDetails` | boolean | `false` | Add targeting, reach by country, age and gender, landing page, CTA and more |
| `maxAdsPerSearch` | integer | `100` | Stop each search after this many ads |

Give at least one keyword, advertiser name or URL.

**Advertiser names.** An advertiser search needs the exact name that TikTok lists, for example `LIDL GREAT BRITAIN LIMITED`, not `Lidl`. If no advertiser has the name you give, the run log and the SOURCES record show the names TikTok suggests. You can also open the advertiser in the Ad Library and paste the URL.

**URLs.** A search URL keeps its own filters, including the age, gender and reach filters that are not in the input form. Filters that the URL does not set come from the input.

**Sort order.** TikTok sorts keyword searches mainly by relevance, so the sort order has little effect on them. It works for advertiser searches.

You do not need to set up a proxy. The scraper picks the proxy for you.

#### Input examples

Keywords in Germany and France, active video ads only:

```json
{
    "searchQueries": ["running shoes", "\"free shipping\""],
    "countries": ["DE", "FR"],
    "adStatus": "active",
    "mediaType": "video",
    "maxAdsPerSearch": 500
}
```

All ads of an advertiser in 2026, with details:

```json
{
    "advertiserNames": ["LIDL GREAT BRITAIN LIMITED"],
    "dateFrom": "2026-01-01",
    "sortBy": "reach_highest",
    "includeAdDetails": true,
    "maxAdsPerSearch": 200
}
```

Ad Library URLs:

```json
{
    "adLibraryUrls": [
        "https://library.tiktok.com/ads?region=all&adv_name=coffee&query_type=1&ad_status=1",
        "https://library.tiktok.com/ads/detail/?ad_id=1869544271940817"
    ]
}
```

### Output

One row per ad. A search outputs each ad once, also when TikTok sends the same ad on more than one page.

```json
{
    "ad_id": "1875590927380850",
    "ad_url": "https://library.tiktok.com/ads/detail/?ad_id=1875590927380850",
    "advertiser_name": "YUMMU SKINCARE",
    "advertiser_id": "7436007352878252049",
    "caption": "Nu orice skincare. Skincare coreean autentic.",
    "media_type": "video",
    "thumbnail_url": "https://p16-common-sign.tiktokcdn.com/...",
    "videos": [
        {
            "video_url": "https://library.tiktok.com/api/v1/cdn/.../video/...",
            "cover_image_url": "https://p16-common-sign.tiktokcdn.com/..."
        }
    ],
    "image_urls": ["https://p16-common-sign.tiktokcdn.com/..."],
    "first_shown_date": "2026-09-06",
    "last_shown_date": "2026-09-09",
    "estimated_audience": "0-1K",
    "moderation_status": "shown",
    "objective": "Sales",
    "industry": "Beauty & Personal Care",
    "call_to_action": "Shop now",
    "landing_page_url": "https://purekorea.ro/magazin/?utm_source=tiktok&utm_id=__CAMPAIGN_ID__&utm_campaign=__CAMPAIGN_NAME__&utm_medium=paid",
    "app_download_url": null,
    "advertiser_registry_location": "Romania",
    "sponsor": "YUMMU SKINCARE",
    "tiktok_username": "pure_korea",
    "tiktok_profile_url": "https://www.tiktok.com/share/user/7388446613432271904?source=ad_review",
    "tiktok_avatar_url": "https://p16-common-sign.tiktokcdn-eu.com/...",
    "tiktok_followers": 10200,
    "targeting": {
        "total_impressions": "0-1K",
        "regions_count": 1,
        "impressions_by_region": [
            {
                "region": "RO",
                "impressions": "0-1K",
                "by_age_and_gender": [
                    { "age": "18-24", "gender": "FEMALE", "impressions": "0-1K" },
                    { "age": "25-34", "gender": "FEMALE", "impressions": "0-1K" }
                ]
            }
        ],
        "target_audience_size": "3.3M-4.1M",
        "countries": ["RO"],
        "provinces": [],
        "cities": [],
        "ages": [{ "region": "RO", "ages": ["18-24", "25-34", "35-44", "45-54", "55+"] }],
        "genders": [{ "region": "RO", "genders": ["female"] }],
        "languages": [],
        "interests": "Beauty & Personal Care",
        "video_interactions": null,
        "creator_interactions": null,
        "custom_audience": "No",
        "excluded_custom_audience": "No",
        "high_spending_power": "No",
        "device_models": [],
        "operating_systems": ["ALL"]
    },
    "details_scraped": true,
    "details_error": null,
    "source": "skincare",
    "source_type": "keyword",
    "scraped_at": "2026-10-11T02:39:50+00:00"
}
```

The detail fields (`objective` to `targeting`) are `null` when **Add ad details** is off. `advertiser_id` is known for advertiser searches, and for every ad when details are on.

TikTok gives reach and impressions as ranges, for example `1K-10K`, not as exact numbers.

The video, cover and image links are signed by TikTok and **expire after a few hours**. Download the media soon after the run if you want to keep it.

The **Output** tab has two views: **Ads** and **Details**.

The **SOURCES** record in the key-value store has one entry per keyword, advertiser or URL: its status, the number of ads, the pages read, TikTok's result count, the advertisers matched and any errors.

### How much does it cost to scrape the TikTok Ad Library?

The scraper uses pay-per-event pricing. You pay for each keyword, advertiser or URL that the scraper searches, also when the Ad Library has no ads for it. You also pay for each ad row, and for each ad with details. A search that fails is free. You do not pay for the Apify platform usage. See the **Pricing** tab for the current prices.

Set a **maximum cost per run** in the run options to cap the bill. The scraper stops when it reaches the limit and keeps every ad collected so far.

### Tips

- **Speed** — Without details, one search reads about 200 ads a minute: 500 ads take about 2.5 minutes. TikTok shows only about 80 ads for each search, so for more ads the scraper splits your search by date, then by country, then by media type, and runs the parts in parallel. Each ad comes out once. Searches run in parallel. With details, expect about 20 to 30 ads a minute, because each details page is one more request.
- **More results** — TikTok shows "5000" as the result count for large searches, but the scraper can read past it. To split a very large search, use countries or date ranges.
- **Filters** — set filters on library.tiktok.com in your browser, then paste the URL.
- **Removed ads** — TikTok keeps removed ads in the library. They have `moderation_status` set to `removed` or `removed_in_some_regions`.

### FAQ

**Is it legal to scrape the TikTok Ad Library?**
TikTok publishes this library for the public, as the EU Digital Services Act requires. This scraper reads only data that any visitor can see. You are responsible for how you use the data. Some advertisers are people; personal data has legal protection in the EU (GDPR), so use it only with a legal basis. If you are not sure, ask a lawyer.

**Can I get ads from the United States?**
No. TikTok's Ad Library has ads shown in Europe, Turkey and Brazil only.

**Why are some detail fields empty?**
TikTok does not show a landing page, a call to action or a TikTok account for every ad. When the details page fails, the row is still in the output, and `details_error` says why. You are not charged for details that failed.

**I found a problem.**
Open an issue on the **Issues** tab. Add the run URL, and we will fix it.

# Actor input Schema

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

Keywords to search for in the ads, the same as the Ad Library search box. Put a keyword in double quotes, for example "free shipping", to find ads with this exact phrase. Each keyword is one search.

## `advertiserNames` (type: `array`):

Advertisers to get all ads of, by their exact name in the Ad Library, for example "LIDL GREAT BRITAIN LIMITED". Upper and lower case do not matter. If no advertiser has this exact name, the run log shows the names TikTok suggests. Each advertiser is one search.

## `adLibraryUrls` (type: `array`):

Search, advertiser or ad URLs copied from library.tiktok.com, for example https://library.tiktok.com/ads/detail/?ad_id=1869544271940817. A search URL keeps all its own filters, including the age, gender and reach filters. Each URL is one search.

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

Get only ads shown in these countries. Leave empty for all countries. The Ad Library has ads for the EU, Iceland, Liechtenstein, Norway, Switzerland, the UK, Turkey and Brazil only.

## `adStatus` (type: `string`):

Get ads that are running now, ads that stopped, or both.

## `mediaType` (type: `string`):

Type of media in the ad.

## `dateFrom` (type: `string`):

Get only ads that were shown on or after this date (YYYY-MM-DD). The Ad Library starts on 2022-10-01. Leave empty to search from that day.

## `dateTo` (type: `string`):

Get only ads that were shown on or before this date (YYYY-MM-DD). Leave empty for today.

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

Order of the ads. With a limit on the number of ads, this decides which ads you get. TikTok sorts keyword searches mainly by relevance, so this order has little effect on them. It works for advertiser searches.

## `includeAdDetails` (type: `boolean`):

Get the details page of each ad too: targeting, impressions by country, age and gender, audience size, landing page, call to action, objective and the advertiser's TikTok account. This is slower and costs more per ad.

## `maxAdsPerSearch` (type: `integer`):

Stop each search after this many ads.

## Actor input object example

```json
{
  "searchQueries": [
    "coffee"
  ],
  "adStatus": "all",
  "mediaType": "all",
  "sortBy": "last_shown_newest",
  "includeAdDetails": false,
  "maxAdsPerSearch": 100
}
```

# Actor output Schema

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

One row per ad: advertiser, caption, media, run dates and reach.

## `details` (type: `string`):

Objective, industry, call to action, landing page and the advertiser, when details are on.

## `sources` (type: `string`):

One entry per keyword, advertiser or URL: status, ads, pages read and any errors.

# 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 = {
    "searchQueries": [
        "coffee"
    ],
    "maxAdsPerSearch": 100
};

// Run the Actor and wait for it to finish
const run = await client.actor("hgservices/tiktok-ads-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 = {
    "searchQueries": ["coffee"],
    "maxAdsPerSearch": 100,
}

# Run the Actor and wait for it to finish
run = client.actor("hgservices/tiktok-ads-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 '{
  "searchQueries": [
    "coffee"
  ],
  "maxAdsPerSearch": 100
}' |
apify call hgservices/tiktok-ads-library-scraper --silent --output-dataset

```

## MCP server setup

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