# TikTok Ad Library Scraper - Competitor Ads, No Login (`benthepythondev/tiktok-ad-library-scraper`) Actor

Returns the ads advertisers run on TikTok in Europe, read from TikTok's public ad library: advertiser, ad text, video or image, first and last day shown, unique users reached, and on request payer, landing page, targeting and reach by country, age and gender. By advertiser or keyword. No login.

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

## Pricing

from $0.45 / 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 Ad Library Scraper

Returns the ads advertisers run on TikTok in Europe, read from TikTok's public [ad library](https://library.tiktok.com/ads) without a login, a cookie or a browser. Enter an advertiser or a keyword and get one row per ad: advertiser, ad text, format, first and last day shown, the number of different users who saw it, the video or picture and the link to the ad. On request each row also carries who paid for the ad, the landing page, the button text, the campaign objective, the targeting and the users reached per country.

**Price (proposal):** $0.60 per 1,000 ads on the Apify Free plan, down to $0.45 from the Gold plan up. Details add the same amount per ad. A search without ads, an advertiser TikTok does not know and an ad id that does not exist cost nothing. Export to JSON, CSV or Excel, run on a schedule, call via API, or connect to Make, Zapier or n8n.

### 🔎 What is the TikTok Ad Library Scraper?

TikTok publishes every ad shown in the EU, the EEA, Switzerland, the United Kingdom and Turkey in its ad library. The page shows 12 ads at a time and has no export. This Actor makes the calls the page itself makes and returns the ads as a table: one advertiser's 304 active ads in Germany in 37 seconds in our test.

#### What data does it extract?

- **Ad:** id, link to the ad in the library, format (video, image, text), ad text, TikTok's industry label where it gives one
- **Run time:** first and last day shown, days running
- **Reach:** different users who saw the ad, as TikTok's range ("10K-100K") and as two numbers
- **Creative:** video file and cover picture, or the pictures of an image ad
- **Removed ads:** a flag, and TikTok's reasons where it publishes them
- **With details:** who paid for the ad, the advertiser's business id, country of registration and TikTok account (username, followers, profile link), landing page, button text, campaign objective
- **With details, targeting:** countries, age groups, gender, interests, languages, cities, operating systems, devices, audience lists used or excluded, size of the targeted audience
- **With details, reach:** users who saw the ad per country, and on request per country, age group and gender

#### What users report on other TikTok ad Actors, and what this one does

| Reported on the leading Actors (issue titles, 2025–2026) | Here |
|---|---|
| "Run with 0 ads", "returns SUCCEEDED with 0 ads when TikTok session-minting fails" | A search TikTok did not answer is named in the status message as not answered. A run in which no search was answered fails instead of ending green and empty. A search that really has no ads says "No ads found" |
| "Does not return all ads", "Incoherent number of ads", "Volumes not matching interface" | Lists are read by the second an ad was published, so page borders neither repeat nor drop ads: 1,200 ads of one keyword and 4,548 of one advertiser came without a repeat, and a list read this way and, right after, by place as the website pages differed in 5 of about 300 ads while TikTok was adding ads to it. The status message quotes TikTok's own count when a run stops at your limit |
| "Exact matching not being respected", "The ads doesn't correspond to advertiser ID" | An advertiser name is looked up first and the advertiser of that name with the most ads is read by its exact name. The run summary lists the namesakes ("Nike": seven advertisers) |
| "Country parameter not respected" | Countries are TikTok's own filter. In 92 detailed rows of two test runs every ad was shown in a country that was asked for |
| "No impressions", "Ads returned without statistics" | 6,876 of 6,878 rows in the tests carried the range of users reached (TikTok shows a dash for the two others, ads of a Turkish advertiser); every detailed row carried the reach per country |
| "Actor times out", "after 20 min + only 2 ads" | No browser. See the measured times below |
| "Media not retrieved for some ads" | Stated as a limit: TikTok publishes no picture for part of the image ads (see Limits) |
| Stated limit of a leading Actor: 3,600 ads per search | 4,548 ads of one search were read; the input accepts up to 20,000 |

### ⬇️ Input

| Field | Type | Default | What it does |
|---|---|---|---|
| `advertisers` | array | | Advertiser names, one search each |
| `keywords` | array | | Words in the ad text or the advertiser's name, one search each |
| `urls` | array | | Search links copied from library.tiktok.com/ads, links of single ads, or ad ids |
| `countries` | array | all | Two-letter codes (DE, FR, GB): only ads shown there |
| `startDate`, `endDate` | string | last 30 days | Only ads shown in this period (YYYY-MM-DD) |
| `adType` | string | `ALL` | `VIDEO`, `IMAGE` or `TEXT` |
| `adStatus` | string | `ALL` | `ACTIVE` or `INACTIVE` |
| `minReach` | string | `ANY` | `10K` or `100K`: only ads that at least this many users saw |
| `maxResults` | integer | 20 | Ads to save per search, newest first, up to 20,000 |
| `maxAdvertisersPerQuery` | integer | 1 | How many advertisers to read when TikTok knows several under one name |
| `includeDetails` | boolean | false | Reads each ad's own record. Second charge event |
| `includeAudienceBreakdown` | boolean | false | With details: reach per country, age group and gender |
| `onlyNewAds` | boolean | false | Deliver only ads not delivered by an earlier run of the same watch |
| `monitorId` | string | | Name of that watch |

With an empty input the Actor reads the sample advertiser Nike, so a first run shows what the rows look like.

The input names of two other TikTok ad library Actors are read as well, so a saved input keeps working: `searchTerms`, `dateFrom`, `dateTo`, `resolveAdDetails`, and `query` with `queryType`, `region`, `maxAds`, `fetchDetails`, `startUrls`.

#### Example input

A competitor's ads in Germany and Austria with details:

```json
{
  "advertisers": ["Zalando"],
  "countries": ["DE", "AT"],
  "maxResults": 200,
  "includeDetails": true
}
```

Every advertiser that uses a phrase, only ads that reached 10,000 users or more:

```json
{
  "keywords": ["protein powder"],
  "minReach": "10K",
  "maxResults": 500
}
```

A search link from the library, a single ad by link and one by id:

```json
{
  "urls": [
    "https://library.tiktok.com/ads?region=FR&adv_name=Zalando%20Lounge%20c%2Fo%20Zalando%20SE&query_type=2",
    "https://library.tiktok.com/ads/detail/?ad_id=1878252115639841",
    "1878341972086002"
  ]
}
```

### ⬆️ Output

One row per ad. A row of the default run:

```json
{
  "adId": "1878253290765633",
  "adUrl": "https://library.tiktok.com/ads/detail/?ad_id=1878253290765633",
  "advertiserName": "NIKE Retail B.V.",
  "adText": null,
  "format": "VIDEO",
  "category": null,
  "firstShownDate": "2026-10-05",
  "lastShownDate": "2026-10-05",
  "daysRunning": 1,
  "uniqueUsersSeen": "1K-10K",
  "uniqueUsersSeenMin": 1000,
  "uniqueUsersSeenMax": 10000,
  "videoUrl": "https://library.tiktok.com/api/v1/cdn/1791324973/video/aHR0cHM6Ly92NzcudGlrdG9rY2RuLmNvbS9…",
  "thumbnailUrl": "https://p16-common-sign.tiktokcdn.com/tos-no1a-p-0037-no/o8Z6NqHGIH3SALebHFQgqAWROtTfGwGaR…",
  "imageUrls": [],
  "removed": false,
  "rejectionReasons": [],
  "query": "Nike",
  "position": 2,
  "hasDetails": false,
  "scrapedAt": "2026-10-06T22:16:13.108705+00:00"
}
```

With `includeDetails`, the fields a row gets in addition (an ad of Zalando in Germany):

```json
{
  "hasDetails": true,
  "advertiserNameOnRecord": "Zalando SE",
  "advertiserBusinessId": "6876456332912755458",
  "adPaidForBy": "Zalando SE",
  "advertiserCountry": "Germany",
  "advertiserProfile": {
    "username": "zalando",
    "displayName": "Zalando",
    "followerCount": "2.2M",
    "accountType": "BLUEV_BA",
    "profileUrl": "https://www.tiktok.com/share/user/6725011622526862342?source=ad_review",
    "avatarUrl": "https://p16-common-sign.tiktokcdn-eu.com/tos-no1a-avt-0068c001-no/75d1d5edaeaf2747adbe5256d05d2821…"
  },
  "landingPageUrl": "https://www.zalando.de/?wmc=dis490_rh_tiktok.…",
  "ctaType": "Shop now",
  "campaignObjective": "Sales",
  "targetCountries": ["DE"],
  "targetAgeGroups": ["18-24", "25-34", "35-44", "45-54", "55+"],
  "targetGender": "All",
  "targetInterests": [],
  "targetVideoInteractions": null,
  "targetCreatorInteractions": null,
  "targetLanguages": [],
  "targetCities": [],
  "targetProvinces": [],
  "targetOperatingSystems": ["IPHONE"],
  "targetDevices": [],
  "targetCustomAudience": false,
  "targetExcludedAudience": true,
  "targetHighSpendingPower": false,
  "usersTargetedEstimate": "22.0M-26.8M",
  "usersTargetedMin": 22000000,
  "usersTargetedMax": 26800000,
  "uniqueUsersSeenByCountry": [
    {"country": "DE", "impressions": "3K", "min": 3000, "max": 3000}
  ]
}
```

The run also writes a `SUMMARY` record: the searches that returned nothing, the advertisers TikTok knows under each name with their ad counts, and the reason a run stopped.

### 💰 What a run costs (proposal, not yet in force)

| Apify plan | Per 1,000 ads | Per 1,000 ad details (added) |
|---|---|---|
| Free | $0.60 | $0.60 |
| Bronze | $0.55 | $0.55 |
| Silver | $0.50 | $0.50 |
| Gold, Platinum, Diamond | $0.45 | $0.45 |

Apify's standard start event ($0.00005) is the only other charge; proxies are included. Not charged: a search without ads, an advertiser name TikTok does not know, an ad id that does not exist, an ad already delivered in only-new mode, the same ad found a second time in one run, and the details of an ad whose record TikTok did not return (the row then says `hasDetails: false`). A single ad opened by its link or id always comes with its details and is charged as one ad plus one detail. Set the run's maximum charge and the Actor stops at it with the rows it has saved.

### ⏱️ Measured

These times are from a test server outside Apify (October 6 and 7, 2026) and will be replaced by measurements on Apify.

| Run | Ads | Time |
|---|---|---|
| Empty input (sample advertiser; seven namesakes are counted first) | 20 | 12 s |
| One advertiser, active ads in Germany, the whole list | 304 | 37 s |
| One keyword in Germany | 1,200 | 159 s |
| A keyword with two words, twice | 96 | 16 s |
| An advertiser with 140,000 ads, ads 3,762 to 4,548 of its list | 787 | 270 s |
| One advertiser and one keyword with details | 32 | 56 s |
| One advertiser with details | 60 | 82 s |
| Seven inputs of every kind, three of them without a result | 18 | 16 s |
| Only-new watch on an advertiser and a keyword, second run | 0 new | 17 s |

The last row is the slow case: TikTok was adding ads to that list while it was read (see Limits). Memory peaked at 83 MB. A run with details that was killed after 50 seconds with 21 ads saved went on to 60 ads when it was started again, with no ad twice and places 1 to 60 in order. Of 92 ads with details, all carried payer, advertiser id and country, objective, targeting and reach per country; 77 a landing page, 78 the advertiser's TikTok account, 2 interest targeting.

### 🔔 Watching for new ads

Turn on `onlyNewAds`, give the watch a `monitorId` and put the run on a schedule. The first run delivers the newest ads up to `maxResults`. Later runs deliver only ads published since, oldest first, and a run without news ends with zero rows and "Nothing new" (measured: 17 ads in the first run, none in a second run right after it). The memory is a key-value store named `tiktok-ad-library-monitor` in your own account; delete a record there to start a watch over.

TikTok lists an ad only once it has been shown, and that can be days after it was published. A watch therefore reads the last two days again on every run. In one advertiser's 304 active ads, 10 were first shown a day after a later ad and 2 five days after; an ad that starts running more than two days after it was published is the one a watch can miss.

### 🤖 For AI agents

Smallest useful call:

```json
{"advertisers": ["Nike"], "countries": ["DE"], "maxResults": 20}
```

Each row is one ad with `advertiserName`, `adText`, `format`, `firstShownDate`, `lastShownDate`, `uniqueUsersSeen`, `videoUrl` and `adUrl`. Add `"includeDetails": true` for `adPaidForBy`, `landingPageUrl`, `ctaType`, `campaignObjective`, `targetCountries`, `targetAgeGroups`, `targetGender` and `uniqueUsersSeenByCountry`. `advertisers`, `keywords` and `urls` take several entries at once. A search without ads returns no rows; the status message and the `SUMMARY` record name it. Only ads shown in Europe exist in this library; a country outside it is skipped with a note. No credentials are needed.

### 💡 Use cases

- 🎯 **Competitor research:** every ad a brand runs on TikTok in a country, with run time and reach, sorted newest first.
- ✍️ **Creative and copy research:** hundreds of real ads for a keyword with text, video file and button text in one table.
- 🔔 **Launch monitoring:** a scheduled watch that reports only the ads published since the last run.
- 🇪🇺 **Targeting and reach:** whom an ad was aimed at and how many users saw it per country, age group and gender.

### ⚠️ Limits, stated plainly

- **Europe only.** TikTok's library holds ads shown in the EU, the EEA, Switzerland, the United Kingdom and Turkey (33 country codes). There is no such library for the United States or other regions.
- **No spend, and reach in ranges.** TikTok publishes the number of users reached as a range ("10K-100K") or a rounded number ("3K"), and no spend.
- **Part of the image ads have no picture link.** TikTok's list carried neither picture nor video for 11 of the 20 ads of the default run, for 279 of 933 ads of a keyword search and for all 2,805 image ads of one advertiser. Video ads carried their file and cover (1,743 of 1,743 for the same advertiser).
- **Video and picture links expire.** TikTok signs them for about six hours; one link still answered after 134 minutes. Download a file soon after the run if you need it.
- **Removed ads** come without advertiser and creative; that is what TikTok shows for them.
- **Details take about a second per ad.** TikTok refuses an address that asks for ad records faster, for many hours. The Actor asks for four records, rests three seconds and changes the address when one is refused.
- **Lists: about eight ads per second of run time.** Searches start 1.25 seconds apart for the same reason, and an address is left after 250 calls.
- **Many ads published in the same second.** When an advertiser publishes more than 12 ads within one second, TikTok returns them in an order that changes from call to call. The Actor then pages by position, drops repeats, and says in the status message when it read fewer than 98% of the ads TikTok counts.
- **A keyword search counts at most 5,000 ads.** The status then says "5,000 or more".
- **One advertiser per name by default.** TikTok knows seven advertisers that begin with "Nike". The one with the most ads in your countries and dates is read; raise `maxAdvertisersPerQuery` or name the advertiser exactly for another one.
- **An ad link whose ad a search of the same run already saved** is not saved a second time.
- **TikTok fills the library with a delay.** An ad appears hours after it was first shown, at the place of the second it was published. One advertiser's list of 140,191 ads grew by 154 within 22 minutes on a weekday morning, and the 59 of them we looked at were all first shown the day before. A run is the list as it was while it was read; a run an hour later holds more ads for the same days.
- **Deep in the list of an advertiser with thousands of ads a day** a run is slower, about 3 ads per second of run time, because of the two points above. 4,548 ads of one such list were read; deeper was not measured.

### ❓ FAQ

**Do I need a TikTok account, cookies or a proxy?** No. The library is public and the Actor reads it as a visitor.

**Why do I get fewer ads than TikTok's page counts?** `maxResults` is 20 by default; raise it. Dates default to the last 30 days, as on TikTok's page. And TikTok's page starts with active ads only while this Actor reads active and inactive ones unless `adStatus` says otherwise, so the two counts differ in both directions.

**How do I get the ads of exactly one advertiser?** Write the name as the library writes it ("NIKE Retail B.V."), or pick the advertiser in the library and paste that search link into `urls`.

**What does a keyword match?** The ad text or the advertiser's name, and every word has to be there. In a test with one word, all 903 ads with a text contained it and the 30 without a text came from an advertiser with the word in its name; with two words, 96 of 96 ads had both in their text.

**Can I get ads shown in the United States?** No. TikTok publishes this library for Europe only.

**Does it download the videos?** It returns the link of the video file; the file itself is not copied, and the link expires after some hours.

**I used another TikTok ad library Actor. What is different?** The detail fields have the names used by `brilliant_gum/tiktok-ads-library-scraper` (`adPaidForBy`, `advertiserBusinessId`, `advertiserProfile`, `advertiserCountry`, `landingPageUrl`, `ctaType`, `campaignObjective`, `targetAgeGroups`, `targetGender`, `targetInterests`, `targetCountries`, `usersTargetedEstimate`, `uniqueUsersSeen`, `uniqueUsersSeenByCountry`, `audienceBreakdown`). Not offered here: `targetBehaviors` and `rejectedInCountries` (see `targetVideoInteractions`, `targetCreatorInteractions` and `rejectionReasons` instead) and TikTok's Creative Center as a second source. `data_xplorer/tiktok-ads-library-fast` returns ranges as objects with `raw`, `min` and `max` under titles like "Ad Audience"; here a range is three flat fields (`uniqueUsersSeen`, `uniqueUsersSeenMin`, `uniqueUsersSeenMax`).

**Can I run it every day?** Yes. Use a schedule with `onlyNewAds` so that you pay only for ads you have not received.

**How do I call it from code?** With the Apify API or the Python and JavaScript clients; every run returns a dataset you can fetch as JSON or CSV. It also works as a tool through Apify's MCP server.

**Is it legal?** The Actor reads what TikTok publishes for everyone under the EU's transparency rules for online advertising. Payer and advertiser names can be names of persons; GDPR, CCPA and similar rules apply to how you store and use them, and TikTok's terms apply to you as well.

### 🔗 You might also like

- [Meta Ad Library Scraper](https://apify.com/benthepythondev/meta-ad-library-scraper): Facebook and Instagram ads
- [Google Ads Transparency Scraper](https://apify.com/benthepythondev/google-ads-transparency-scraper): Google Search, YouTube and Shopping ads
- [LinkedIn Ad Library Scraper](https://apify.com/benthepythondev/linkedin-ad-library-scraper): B2B ads with run dates and targeting
- [TikTok Profile Videos Scraper](https://apify.com/benthepythondev/tiktok-profile-videos-scraper): what the same brands post without paying for it

**Keywords:** tiktok ad library scraper, tiktok ads library api, tiktok ads scraper, tiktok commercial content library, competitor tiktok ads, tiktok ad spy tool, tiktok ad creatives, tiktok ad targeting data, tiktok ads export csv, DSA ad repository, tiktok ad reach by country, tiktok advertiser search, tiktok ad monitoring, tiktok video ads download, ad intelligence europe, tiktok ads no login, tiktok ad library export

# Actor input Schema

## `advertisers` (type: `array`):

Advertiser names, one search each. TikTok's own search wants a name exactly as the library writes it, so the Actor looks the name up first and reads the advertiser of that name with the most ads in your countries and dates. The run summary lists the other advertisers TikTok knows under the name.

## `keywords` (type: `array`):

Words to look for in the ad text or the advertiser's name, one search each, for example "protein powder". An ad must contain every word. Finds the ads of every advertiser that uses them.

## `urls` (type: `array`):

Search links copied from library.tiktok.com/ads (with the filters set there), links of single ads (…/ads/detail/?ad_id=1870698295930082) or bare ad ids. A single ad always comes with its details.

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

Two-letter country codes: only ads shown there. Leave empty for all countries of the library: AT BE BG CH CY CZ DE DK EE ES FI FR GB GR HR HU IE IS IT LI LT LU LV MT NL NO PL PT RO SE SI SK TR. Applies to advertisers and keywords, not to pasted links.

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

Only ads shown on or after this day (YYYY-MM-DD). Empty means 30 days before the end date, as on TikTok's own page. The library keeps ads for about a year.

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

Only ads shown on or before this day (YYYY-MM-DD). Empty means today.

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

Keep only video, image or text ads. The filter is TikTok's own.

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

Active ads are the ones still running. TikTok's own page starts with active ads only, so its count is smaller than the one for all ads.

## `minReach` (type: `string`):

Keep only ads that at least this many different users have seen. A cheap way to get an advertiser's important ads without the thousands of small ones.

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

Ads to save for each advertiser, keyword or search link, newest first. TikTok lists 12 ads per request.

## `maxAdvertisersPerQuery` (type: `integer`):

How many advertisers to read when TikTok knows several under one name (for Nike: NIKE Retail B.V., Nike, Inc., Nike Store and more). Those with the most ads come first.

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

Reads every ad's own record: who paid for the ad, the advertiser's business id, country and TikTok account, landing page, button text, objective, targeting (countries, age groups, gender, interests, audience size) and unique users seen per country. Charged as a second event per ad.

## `includeAudienceBreakdown` (type: `boolean`):

With details: adds one entry per country, age group and gender with the unique users seen. Useful in JSON; in CSV and Excel an ad shown in many countries becomes hundreds of columns.

## `onlyNewAds` (type: `boolean`):

For scheduled runs: the first run delivers the newest ads up to the maximum, later runs with the same monitor name deliver only ads published since, so you pay only for ads that are new to you. The memory is a key-value store in your own account.

## `monitorId` (type: `string`):

Name of the memory used by the option above. Give each watch its own name; without a name the searches themselves are the name.

## Actor input object example

```json
{
  "advertisers": [
    "Nike"
  ],
  "adType": "ALL",
  "adStatus": "ALL",
  "minReach": "ANY",
  "maxResults": 20,
  "maxAdvertisersPerQuery": 1,
  "includeDetails": false,
  "includeAudienceBreakdown": false,
  "onlyNewAds": false
}
```

# Actor output Schema

## `results` (type: `string`):

No description

## `summary` (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 = {
    "advertisers": [
        "Nike"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("benthepythondev/tiktok-ad-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 = { "advertisers": ["Nike"] }

# Run the Actor and wait for it to finish
run = client.actor("benthepythondev/tiktok-ad-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 '{
  "advertisers": [
    "Nike"
  ]
}' |
apify call benthepythondev/tiktok-ad-library-scraper --silent --output-dataset

```

## MCP server setup

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