# TikTok Ad Library Scraper (`aboo.script/library-tiktok-scraper`) Actor

\[💰$2 / 1K] ⚡ TikTok ad library scraper with full audience targeting. No login, no API key. Search ads by advertiser, keyword or URL in 33 European countries: advertiser, payer, caption, video, landing page, first and last shown dates, reach by country, age and gender.

- **URL**: https://apify.com/aboo.script/library-tiktok-scraper.md
- **Developed by:** [Aboo Script](https://apify.com/aboo.script) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.40 / 1,000 results

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 Ad Library Scraper

![TikTok Ad Library Scraper](https://i.ibb.co/1t3h5ccm/library-tiktok-banner.png)

**TikTok Ad Library Scraper** extracts ads from the [TikTok Commercial Content Library](https://library.tiktok.com/ads) into clean, structured data you can download as JSON, CSV, Excel, or HTML. Type an advertiser name or keyword, or paste a TikTok ad library URL, and get the advertiser, caption, video, first and last shown dates, unique users seen, landing page, and full audience targeting by country, age, and gender for every ad. No account or login required.

### Introduction

The [TikTok Commercial Content Library](https://library.tiktok.com/ads) is TikTok's public ad library. It lists the ads shown to users in Europe (the EU, the UK, Switzerland, Norway, Iceland, Liechtenstein, and Turkey), together with who paid for them, how many people saw them, and which audiences they targeted.

This TikTok ad library scraper collects the same public information you see in your browser and turns it into a ready-to-use dataset. You can use it as a TikTok ads API alternative: run it once, schedule it to run daily, or connect it to your own tools.

### What data can you extract from the TikTok ad library?

- 🆔 Ad ID and direct link to each ad
- 🏢 Advertiser name, advertiser ID, who paid for the ad, registered location, and a link to all ads of the advertiser
- 📝 Ad caption, ad category, advertising objective, call to action, and landing page URL
- 🎬 Ad videos with cover images, and ad images
- 📅 First shown and last shown dates
- 👥 Unique users seen, in total and per country
- 🎯 Targeting: countries, age groups, genders, reach per age and gender, target audience size, provinces, cities, languages, operating systems, devices, interests, and custom audiences
- 🚫 Whether the ad was removed by TikTok

### Use Cases

- 📈 **Market research**: see which brands advertise on TikTok in each European country, and how big their campaigns are.
- 🕵️ **Competitor monitoring**: follow every new ad of a competitor, with its creative, landing page, and target audience.
- 🎨 **Creative inspiration**: collect ad videos and captions in your industry to find what works.
- 🤝 **Lead generation**: build a list of advertisers active on TikTok, with their registered country.
- 🤖 **AI and automation**: feed clean, structured ad data into spreadsheets, dashboards, or AI workflows.

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

1. Type advertiser names or keywords into **Search queries**, or paste TikTok ad library URLs into **Start URLs**.
2. Optionally pick the **Ad target country**, the date range, and other filters for your search queries.
3. Set **Maximum number of results** to how many ads you want per query or per URL.
4. Click **Start** and wait for the run to finish.
5. Download your data in JSON, CSV, Excel, or HTML from the **Output** tab.

### Input

- **Search queries**: advertiser names or keywords, one per line. Wrap a query in double quotes (for example `"adidas"`) for an exact phrase match. Each query is scraped separately.
- **Start URLs**: TikTok ad library search URLs (`library.tiktok.com/ads?...`) or single ad URLs (`library.tiktok.com/ads/detail/?ad_id=...`). All filters in a search URL are kept, including the advertiser pages opened from "See all ads".
- **Ad target country**: the European country where the ads were shown, or all countries.
- **Last shown from** and **Last shown until**: date range of the ads. By default the last 12 months are searched. The range can be at most 365 days.
- **Ad type**: all ads, video, image, or text.
- **Ad status**: all, active, or inactive ads.
- **Target age**: only ads targeting these age groups.
- **Target gender**: only ads targeting women or men.
- **Unique users seen**: only ads with this reach (under 10K, 10K to 100K, over 100K).
- **Sort by**: last shown date, published date, or unique users seen.
- **Include ad details**: adds the advertiser ID, payer, registered location, ad category, objective, landing page, and full targeting. Turn it off for a faster run with the search result data only.
- **Maximum number of results**: how many ads to collect for each search query or start URL. Use 0 for no limit.
- **Proxy configuration**: Apify Proxy is enabled by default for stable results.

The country, date, type, status, age, gender, reach, and sort filters apply to search queries. Start URLs keep the filters in the URL. You can use search queries, start URLs, or both in the same run.

### Input Examples

Search ads by advertiser name or keyword:

```json
{
  "searchQueries": ["nike"],
  "country": "all",
  "adType": "all",
  "adStatus": "all",
  "gender": "all",
  "sortBy": "lastShownNewest",
  "includeDetails": true,
  "maxResults": 5,
  "proxyConfiguration": { "useApifyProxy": true }
}
```

Scrape a TikTok ad library search URL:

```json
{
  "startUrls": [
    {
      "url": "https://library.tiktok.com/ads?region=FR&start_time=1761955200000&end_time=1793059200000&adv_name=adidas&adv_biz_ids=&query_type=1&sort_type=last_shown_date,desc&ad_type=0&ad_status=0&ages=all&ad_reach=all&gender=ALL"
    }
  ],
  "includeDetails": true,
  "maxResults": 5,
  "proxyConfiguration": { "useApifyProxy": true }
}
```

### Output

Each ad is saved as one item in the dataset. Here is an example of a single item:

```json
{
  "url": "https://library.tiktok.com/ads/detail/?ad_id=1870887754684786",
  "adId": "1870887754684786",
  "advertiserName": "Snipes SE",
  "advertiserId": "6876496928549372673",
  "paidBy": "SNIPES SE",
  "advertiserRegisteredLocation": "Germany",
  "advertiserUrl": "https://library.tiktok.com/ads?adv_name=Snipes+SE&region=all&query_type=2&adv_biz_ids=6876496928549372673",
  "caption": "Retrouve les derniers articles adidas sur SNIPES",
  "adCategory": "Apparel & Accessories",
  "advertisingObjective": "Sales",
  "callToAction": "Buy now",
  "externalUrl": "https://www.snipes.com/fr-fr/b/femmes/new-balance-391?utm_source=tiktok&utm_id=__CAMPAIGN_ID__&utm_campaign=__CAMPAIGN_NAME__&utm_medium=social_paid_pf",
  "firstShownDate": "2026-07-16T00:00:00.000Z",
  "lastShownDate": "2026-09-15T00:00:00.000Z",
  "uniqueUsersSeen": "10K-100K",
  "isRemoved": false,
  "videos": [],
  "imageUrls": [],
  "targetCountries": ["FR"],
  "targetAudienceSize": "14.5M-17.8M",
  "targetingByCountry": [
    {
      "country": "FR",
      "uniqueUsersSeen": "57K",
      "ages": ["18-24", "25-34", "35-44", "45-54", "55+"],
      "genders": ["female"],
      "breakdown": [
        { "age": "18-24", "gender": "female", "uniqueUsersSeen": "20K" },
        { "age": "25-34", "gender": "female", "uniqueUsersSeen": "25K" },
        { "age": "35-44", "gender": "female", "uniqueUsersSeen": "8K" },
        { "age": "45-54", "gender": "female", "uniqueUsersSeen": "5K" },
        { "age": "55+", "gender": "female", "uniqueUsersSeen": "2K" }
      ]
    }
  ],
  "targetProvinces": [],
  "targetCities": [],
  "targetLanguages": [],
  "targetOperatingSystems": ["ALL"],
  "targetDeviceModels": [],
  "interestTargeting": null,
  "videoInteractionTargeting": null,
  "creatorInteractionTargeting": null,
  "customAudience": "No",
  "excludedAudience": "No",
  "highSpendingPower": "No"
}
```

Video ads include their video link and cover image in `videos`, for example `{ "videoUrl": "https://library.tiktok.com/...", "coverImageUrl": "https://p16-common-sign.tiktokcdn.com/..." }`.

You can download the dataset in JSON, CSV, Excel, XML, or HTML, or access it through the Apify API.

### Notes

- The library only covers ads shown in Europe (the EU, the UK, Switzerland, Norway, Iceland, Liechtenstein, and Turkey). Other TikTok pages and websites are skipped.
- TikTok returns at most 5,000 ads per search. For bigger advertisers, split the search by country, date range, or other filters.
- The date range of one search can be at most 365 days. A start URL without dates uses the library default of the last month.
- With **Include ad details** turned off, the advertiser ID, payer, category, objective, landing page, and targeting fields are empty.
- Ads removed by TikTok for a policy violation are marked with `isRemoved: true` and have no advertiser name, video, or caption.
- Reach numbers are ranges or rounded values, exactly as TikTok shows them. Small age and gender segments are hidden by TikTok and left out of `breakdown`.
- Video and image links are signed by TikTok and expire after some time, so download the media soon after the run if you need it.
- The same ad found by two queries in one run is saved only once.

### Why use the TikTok Ad Library Scraper?

- ✅ **No login needed**: works with public data only, so there is no account to manage.
- 🎯 **All library filters**: country, date range, ad type, status, age, gender, reach, and sort order, or paste any search URL from your browser.
- 🧾 **Full targeting in one item**: reach per country, age, and gender, plus audience settings, without extra steps.
- 🧹 **Clean data**: dates use one standard format and every item has the same fields.
- 🔄 **Ready for automation**: schedule runs, export to Google Sheets, or connect to Make, Zapier, and n8n.

### FAQ

#### How many ads can I scrape?

You can set any number in **Maximum number of results**. The actor keeps going until it reaches your limit or runs out of ads. See **Notes** for the limits set by TikTok.

#### Do I need a TikTok account?

No. The actor only collects publicly available data from the TikTok ad library. You do not need to log in or provide any account details.

#### Can I get all ads of one advertiser?

Yes. Open the advertiser's "See all ads" page in the library and paste its URL into **Start URLs**, or use the `advertiserUrl` value from a previous run.

#### Can I scrape ads on a schedule?

Yes. Use Apify Schedules to run the actor every hour, day, or week, and get fresh ads automatically.

#### Can I request a new feature or filter?

Yes. Right now the actor supports search queries, start URLs, and all filters of the ad library. If you need something else, such as other TikTok commercial content, get in touch and it can be added.

#### Can I get a custom or private version?

Yes. The actor can be customized for your workflow, delivered as a private version, or a new scraper can be built for a different website. Use the contact details below.

***

**Need help or want a custom solution?**

- 📧 Email: aboo.script@gmail.com
- 🧩 More scrapers: [Apify profile](https://apify.com/aboo.script)

### Image Credit

Image credit: [TikTok Commercial Content Library](https://library.tiktok.com/ads)

# Actor input Schema

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

Advertiser names or keywords to search in the TikTok ad library. Wrap a query in double quotes for an exact phrase match. Each query is scraped separately with the filters below.

## `startUrls` (type: `array`):

TikTok ad library search URLs (library.tiktok.com/ads?...) or ad detail URLs (library.tiktok.com/ads/detail/?ad_id=...). All filters in a search URL are kept. A search URL without dates uses the library default of the last month.

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

Country where the ads were shown. Applies to search queries only.

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

Only ads last shown on or after this date. Applies to search queries only. Default: one year before the end date. The date range can be at most 365 days.

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

Only ads last shown on or before this date. Applies to search queries only. Default: today.

## `adType` (type: `string`):

Ad format. Applies to search queries only.

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

Whether the ad is still running. Applies to search queries only.

## `ages` (type: `array`):

Only ads targeting these age groups. Leave empty for all ages. Applies to search queries only.

## `gender` (type: `string`):

Only ads targeting this gender. Applies to search queries only.

## `reach` (type: `array`):

Only ads with this reach. Leave empty for all. Applies to search queries only.

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

Order of the results. Applies to search queries only.

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

Open each ad to add advertiser ID, payer, registered location, ad category, objective and full targeting (countries, age, gender, reach per country, audience settings). Turn off for a faster run with the search result data only.

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

Maximum number of ads to scrape per search query or start URL. Use 0 for no limit (the library returns at most 5,000 ads per search).

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

The ad library temporarily blocks addresses that send many requests, so Apify Proxy is enabled by default.

## Actor input object example

```json
{
  "searchQueries": [
    "nike"
  ],
  "startUrls": [
    {
      "url": "https://library.tiktok.com/ads?region=FR&start_time=1761955200000&end_time=1793059200000&adv_name=adidas&adv_biz_ids=&query_type=1&sort_type=last_shown_date,desc&ad_type=0&ad_status=0&ages=all&ad_reach=all&gender=ALL"
    }
  ],
  "country": "all",
  "adType": "all",
  "adStatus": "all",
  "gender": "all",
  "sortBy": "lastShownNewest",
  "includeDetails": true,
  "maxResults": 5,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `overview` (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 = {
    "searchQueries": [
        "nike"
    ],
    "startUrls": [
        {
            "url": "https://library.tiktok.com/ads?region=FR&start_time=1761955200000&end_time=1793059200000&adv_name=adidas&adv_biz_ids=&query_type=1&sort_type=last_shown_date,desc&ad_type=0&ad_status=0&ages=all&ad_reach=all&gender=ALL"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("aboo.script/library-tiktok-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": ["nike"],
    "startUrls": [{ "url": "https://library.tiktok.com/ads?region=FR&start_time=1761955200000&end_time=1793059200000&adv_name=adidas&adv_biz_ids=&query_type=1&sort_type=last_shown_date,desc&ad_type=0&ad_status=0&ages=all&ad_reach=all&gender=ALL" }],
}

# Run the Actor and wait for it to finish
run = client.actor("aboo.script/library-tiktok-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": [
    "nike"
  ],
  "startUrls": [
    {
      "url": "https://library.tiktok.com/ads?region=FR&start_time=1761955200000&end_time=1793059200000&adv_name=adidas&adv_biz_ids=&query_type=1&sort_type=last_shown_date,desc&ad_type=0&ad_status=0&ages=all&ad_reach=all&gender=ALL"
    }
  ]
}' |
apify call aboo.script/library-tiktok-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,aboo.script/library-tiktok-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/sOZrVcdAlPL7zDhaL/builds/4LZ74nChzeEwj7PdD/openapi.json
