# TikTok Ads Library Scraper – Targeting & Impressions (`expensive_marquess/tiktok-ads-library-scraper`) Actor

Scrape TikTok ads from the official TikTok Ad Library by advertiser or keyword. Get ad text, videos, dates, reach, landing pages, CTA, targeting (age, gender, interests) and impressions by country. EU, UK, CH, TR.

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

## Pricing

from $1.60 / 1,000 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 – Targeting, Impressions & Landing Pages

![TikTok Ads Library Scraper](https://api.apify.com/v2/key-value-stores/zJcuVPqbUFf5yLBhI/records/banner-tiktok-ads-library-scraper)

Scrape ads from the official [TikTok Ad Library](https://library.tiktok.com/ads) by **advertiser** or **keyword**. Get the ad text, video and image links, first/last shown dates and reach – and, with one switch, the data most scrapers skip: **landing page URL, call to action, campaign objective, who paid for the ad, the full targeting setup (age, gender, interests, languages, locations, custom audiences)** and **impressions by country, age and gender**.

No TikTok account or cookies needed.

> TikTok publishes ads shown in the **EU/EEA, Switzerland, the United Kingdom and Turkey**. Ads that only ran elsewhere (e.g. US-only) are not in the library.

### Why this TikTok ads scraper?

- 🎯 **Targeting & reach from TikTok itself** – age, gender, interests, audience size and impressions by country, age and gender, read from each ad's official detail page.
- 🔗 **Landing pages & CTAs** – see where every ad sends traffic.
- ✅ **Exact advertiser matching** – searches resolve to the advertiser's account ID, and keyword results that don't contain your keyword are dropped (and not charged).
- 🌍 **Country filter that works** – results are limited to the countries you choose.
- 💬 **Clear feedback** – the log shows how many ads TikTok reports for your search, and empty runs explain why.

### What can you use it for?

- 🕵️ **Competitor research** – see every TikTok ad a competitor runs in Europe, how long each one ran and how many people it reached.
- 🎯 **Steal targeting ideas** – see the exact age groups, genders, interests and creator/video interactions competitors target.
- 🔗 **Funnel analysis** – collect the landing pages and offers behind the ads.
- 🎬 **Creative swipe files** – download winning video ads (sort by reach to find the biggest ones first).
- 🏢 **Agency prospecting** – find brands that spend on TikTok ads and see who manages their media (the "paid by" field often names the agency).
- 🤖 **AI agents & automations** – clean JSON for n8n, Make, Zapier and the Apify MCP server.

### Input

| Field | What it does |
|---|---|
| **Advertisers, keywords or URLs** | Any mix of advertiser names (`NIKE Retail B.V.`), TikTok advertiser IDs (`6876453864464188162`), Ad Library search URLs and ad URLs (`https://library.tiktok.com/ads/detail/?ad_id=...`) |
| **Treat plain text as** | Advertiser name (default) or keyword in the ad text |
| **Countries** | All, or any of the 33 supported countries |
| **Shown from / until** | Date range (default: last 12 months) |
| **Sort by** | Last shown, reach (biggest first), or published date |
| **Max ads per query** | Up to 5,000 per query |
| **Include targeting, landing page and impressions** | Adds the detailed fields below |

```json
{
  "queries": ["NIKE Retail B.V.", "running shoes"],
  "searchType": "advertiser",
  "regions": ["DE", "FR"],
  "sortBy": "impression,desc",
  "maxAdsPerQuery": 100,
  "includeDetails": true
}
```

### Output

```json
{
  "adId": "1877844531073314",
  "advertiserName": "NIKE Retail B.V.",
  "advertiserId": "6876453864464188162",
  "adText": "La veste ACG Lava Flow Ultralight offre une chaleur volcanique contre le froid.",
  "format": "IMAGE",
  "firstShown": "2026-10-02",
  "lastShown": "2026-10-02",
  "daysRunning": 1,
  "estimatedAudience": "10K-100K",
  "videoUrls": [],
  "coverImageUrl": "https://p16-common-sign.tiktokcdn.com/...",
  "adLibraryUrl": "https://library.tiktok.com/ads/detail/?ad_id=1877844531073314",
  "landingPageUrl": "https://www.nike.com/fr/w/acg-temps-froid-7t42qz93bsd",
  "callToAction": "Shop now",
  "objective": "Traffic",
  "advertiserRegistryLocation": "Netherlands",
  "paidBy": "INITIATIVE MEDIA B.V.",
  "totalImpressions": "10K-100K",
  "impressionsByCountry": [
    {
      "countryCode": "FR",
      "countryName": "France",
      "impressions": "28K",
      "breakdown": [{ "age": "18-24", "gender": "MALE", "impressions": "8K" }]
    }
  ],
  "targeting": {
    "countries": ["FR"],
    "ageGroups": ["18-24", "25-34"],
    "genders": ["female", "male", "unknown"],
    "audienceSize": "2.2M-2.7M",
    "interests": ["Outdoor Equipment"],
    "videoInteractions": ["Sports & Outdoors"],
    "creatorInteractions": ["Sport, Outdoor Activities & Nature"],
    "highSpendingPower": false,
    "usesCustomAudience": false,
    "excludesCustomAudience": false
  }
}
```

The fields from `landingPageUrl` down are only filled when **Include targeting, landing page and impressions** is on.

### Pricing

You pay per ad scraped, plus a small extra per ad when detailed data is turned on – see the **Pricing** tab. Set **Maximum cost per run** to cap spending; the scraper stops cleanly when it's reached.

### Tips

- **Find winning ads:** sort by *Unique users reached* or look at `daysRunning` – advertisers keep paying for ads that work.
- **Exact advertiser:** enter the legal name shown in the library (e.g. `NIKE Retail B.V.`) or the advertiser ID. Ad Library URLs copied from your browser work too.
- **Video links expire** after some hours (TikTok signs them). Download videos soon after the run.
- Some ads have no media in the library (TikTok doesn't publish it for every ad); their `format` is empty.
- If runs are slow or throttled, switch the proxy to **Residential**.

### FAQ

**Is it legal?** The scraper collects ad transparency data that TikTok publishes under the EU Digital Services Act. It does not collect personal data. Make sure your use complies with the laws that apply to you.

**Can I get US ads?** No – TikTok's Ad Library only covers ads shown in Europe and Turkey.

**Something missing or broken?** Open an issue in the **Issues** tab – I usually reply within a day.

⭐ **If this scraper saved you time, please [leave a review](https://apify.com/expensive_marquess/tiktok-ads-library-scraper/reviews) – it really helps!**

### More tools from this developer

- [YouTube Channel Email Finder – creator emails & socials by niche](https://apify.com/expensive_marquess/youtube-channel-email-finder)
- [Telegram Channel Scraper – messages, views, reactions, no login](https://apify.com/expensive_marquess/telegram-channel-scraper)
- [Google Ads Transparency Scraper – every Google ad of any advertiser](https://apify.com/expensive_marquess/google-ads-transparency-scraper)
- [LinkedIn Ad Library Scraper – B2B ads, payers & targeting](https://apify.com/expensive_marquess/linkedin-ad-library-scraper)
- [Ad Library All-in-One – Google + TikTok + LinkedIn ads in one format](https://apify.com/expensive_marquess/ad-library-all-in-one)

# Actor input Schema

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

Any mix of: advertiser names (Nike), TikTok advertiser IDs (6876453864464188162), Ad Library search URLs, or ad detail URLs (library.tiktok.com/ads/detail/?ad_id=...).

## `searchType` (type: `string`):

How to interpret plain text entries. Advertiser IDs and URLs are detected automatically.

## `regions` (type: `array`):

Countries where the ad was shown. TikTok publishes ads shown in the EU/EEA, Switzerland, the UK and Turkey.

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

Default: 1 year ago.

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

Default: today.

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

Order of results. Use 'Unique users reached' to find the biggest ads first.

## `maxAdsPerQuery` (type: `integer`):

Stop after this many ads per query. 0 = as many as possible (TikTok returns up to 5,000 per search).

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

Adds landing page URL, call to action, objective, industry, who paid, targeting (age, gender, interests, languages, locations, audiences) and impressions by country, age and gender. One extra request per ad, so runs are slower.

## `advertisersPerName` (type: `integer`):

How many matching advertiser accounts to scrape for each name (an exact name match is always preferred).

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

Use a residential proxy if runs are throttled.

## Actor input object example

```json
{
  "queries": [
    "NIKE Retail B.V.",
    "6876453864464188162",
    "running shoes"
  ],
  "searchType": "advertiser",
  "regions": [
    "ALL"
  ],
  "sortBy": "last_shown_date,desc",
  "maxAdsPerQuery": 24,
  "includeDetails": false,
  "advertisersPerName": 1,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

No description

## `allResults` (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 Retail B.V.",
        "https://library.tiktok.com/ads/detail/?ad_id=1869613598821521"
    ],
    "maxAdsPerQuery": 24,
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("expensive_marquess/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 = {
    "queries": [
        "NIKE Retail B.V.",
        "https://library.tiktok.com/ads/detail/?ad_id=1869613598821521",
    ],
    "maxAdsPerQuery": 24,
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("expensive_marquess/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 '{
  "queries": [
    "NIKE Retail B.V.",
    "https://library.tiktok.com/ads/detail/?ad_id=1869613598821521"
  ],
  "maxAdsPerQuery": 24,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call expensive_marquess/tiktok-ads-library-scraper --silent --output-dataset

```

## MCP server setup

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