# TikTok Ads Scraper (`neuro-scraper/tiktok-ads-scraper`) Actor

TikTok Ads Scraper: ads from the TikTok Ad Library (EU/EEA/UK) by keyword or advertiser - ad id, advertiser, ad text, format, first and last shown dates, days running, reach, impressions, spend range, video and image links.

- **URL**: https://apify.com/neuro-scraper/tiktok-ads-scraper.md
- **Developed by:** [Neuro Scraper](https://apify.com/neuro-scraper) (community)
- **Categories:** Social media, Lead generation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.19 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
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 Scraper

The TikTok Ads Scraper collects ads from the TikTok Ad Library - the public transparency library of ads shown in the EU, EEA, UK and Switzerland. Search by advertiser name or keyword, pick countries and a date range, and the TikTok Ads Scraper returns every matching ad with its ad id, advertiser, ad text, format, first and last shown date, days running, unique-user reach range, impressions, video link, cover and image links. With Include ad details the TikTok Ads Scraper also asks for each ad's detail record: landing page, call to action, objective, advertiser business id and country, "paid for by", targeted countries, age groups, genders, audience size and reach per country.

> **Also from us:** [Facebook Reels Scraper](https://apify.com/neuro-scraper/facebook-reels-scraper) - download Facebook Reels with captions, views, likes and comments.

#### What the TikTok Ads Scraper does

For every search term and country the TikTok Ads Scraper opens the library search, follows the library's own next-page cursor (12 ads per page) until it has your number of ads, and streams the rows to your dataset. Searches run in parallel - 24 ads in about 8 seconds.

- Ads by advertiser name or by keyword in the ad text, in any supported country (the country list is read from the library at run time).
- Date range (start/end date or the last N days), time zone and sort order (last shown, impressions, published date).
- Ad id, advertiser, ad text, format, status, first/last shown date and days running.
- Reach range (unique users seen), impressions, video link, cover image and image links.
- Optional ad details: landing page, call to action, objective, advertiser business id and country, paid for by, targeting and reach per country.
- Optional reach breakdown per country x age group x gender.
- Filter by format (video or image), search by ad id.

#### Who uses the TikTok Ads Scraper

Performance marketers use the TikTok Ads Scraper to see which creatives competitors run in Europe and for how long. Agencies collect ad examples for pitches. Brand-safety and compliance teams monitor who advertises with their brand name. Researchers study political and commercial ads under the DSA. Schedule the TikTok Ads Scraper daily to follow new ads of an advertiser.

### How to use the TikTok Ads Scraper

1. Open the TikTok Ads Scraper and enter advertiser names or keywords in **Search terms** (e.g. `nike`).
2. Choose **Countries** (EU/EEA/UK/CH codes such as FR, DE, IT) and a date range or **Period (days)**.
3. Set **Max ads per term and country** and the sort order.
4. Switch on **Include ad details** when you need landing pages and targeting.
5. Click **Start** and export the dataset as JSON, CSV, Excel or HTML, or read it with the API.

### Input options of the TikTok Ads Scraper

Every option of the TikTok Ads Scraper is explained below: what it does, how it works, its values and default, an example and a tip.

#### Search terms (`searchTerms`)

`searchTerms` - the advertiser names or keywords to search, one per line. Each term is searched in every country of Countries, so 2 terms x 3 countries = 6 searches that run in parallel.

- **Type:** array; **default:** `none`
- **Example:** `"searchTerms": ["nike", "temu"]`
- **Tip:** Advertiser names work best with Search by = advertiser.

#### Search query (single) (`query`)

`query` - one search term as a single text. The TikTok Ads Scraper adds it to Search terms. Handy for API calls that send one string.

- **Type:** string; **default:** `none`
- **Example:** `"query": "adidas"`
- **Tip:** For several terms use Search terms.

#### Keyword (alias) (`keyword`)

`keyword` - the same as Search query under another name, kept so inputs from other tools work. The TikTok Ads Scraper adds it to Search terms and removes duplicates.

- **Type:** string; **default:** `none`
- **Example:** `"keyword": "shein"`
- **Tip:** Use only one of the aliases.

#### Advertiser name (`advertiserName`)

`advertiserName` - one advertiser name to search for. The TikTok Ads Scraper adds it to Search terms; with Search by = advertiser it matches advertiser names.

- **Type:** string; **default:** `none`
- **Example:** `"advertiserName": "NIKE Retail B.V."`
- **Tip:** Copy the exact name from an earlier row to narrow results.

#### Ad ids (`adIds`)

`adIds` - TikTok ad ids or Ad Library ad links. The TikTok Ads Scraper searches each country's library for the id and returns only the matching ad.

- **Type:** array; **default:** `none`
- **Example:** `"adIds": ["1882139943394434"]`
- **Tip:** Ids come from the `adId` column of an earlier run.

#### Countries (`countries`)

`countries` - two-letter codes of the countries to search (EU/EEA/UK/CH: FR, DE, IT, ES, NL, PL, SE, GB...). The list of supported countries is read from the library on every run; an unsupported code is logged and skipped.

- **Type:** array; **default:** `none`
- **Example:** `"countries": ["FR", "DE"]`
- **Tip:** Each country is a separate search with its own limit.

#### Country (single) (`country`)

`country` - one country code as a single text, added to Countries. "all" searches every supported country in one search.

- **Type:** string; **default:** `none`
- **Example:** `"country": "DE"`
- **Tip:** Use Countries for several codes.

#### Start date (`startDate`)

`startDate` - ads shown on or after this date (YYYY-MM-DD), read in the Time zone below. When empty, Period (days) decides.

- **Type:** string; **default:** `none`
- **Example:** `"startDate": "2026-10-01"`
- **Tip:** Combine with End date for a fixed window.

#### End date (`endDate`)

`endDate` - ads shown on or before this date (YYYY-MM-DD). When empty, today.

- **Type:** string; **default:** `none`
- **Example:** `"endDate": "2026-10-31"`
- **Tip:** End date must be after Start date.

#### Period (days) (`period`)

`period` - when Start date is empty: ads shown in the last N days (1-365). Default 30.

- **Type:** integer; **default:** `30`
- **Example:** `"period": 90`
- **Tip:** Longer periods return more ads per advertiser.

#### Time zone (`timezone`)

`timezone` - time zone in which Start date and End date are read, e.g. "Europe/Paris". Default UTC.

- **Type:** string; **default:** `"UTC"`
- **Example:** `"timezone": "Europe/Berlin"`
- **Tip:** Use the market's time zone for exact day boundaries.

#### Sort by (`sortBy`)

`sortBy` - order of the ads, the same choices as the library: last shown date newest/oldest first, impressions high/low, published date newest/oldest.

- **Type:** string; **default:** `"last_shown_date,desc"`; **allowed:** last_shown_date,desc, last_shown_date,asc, impression,desc, impression,asc, create_time,desc, create_time,asc
- **Example:** `"sortBy": "impression,desc"`
- **Tip:** impression,desc shows the biggest ads first.

#### Search by (`searchType`)

`searchType` - advertiser = the term is matched against advertiser names (default); keyword = against the ad text.

- **Type:** string; **default:** `"advertiser"`; **allowed:** advertiser, keyword
- **Example:** `"searchType": "keyword"`
- **Tip:** Use keyword for product or campaign words.

#### Ad format (`adType`)

`adType` - keeps all ads, only video ads or only image ads. The format is read from the media of each ad.

- **Type:** string; **default:** `"ALL"`; **allowed:** ALL, VIDEO, IMAGE
- **Example:** `"adType": "VIDEO"`
- **Tip:** Some ads carry no media in the search answer - they are kept with ALL only.

#### Interface language (`adLanguage`)

`adLanguage` - language code for the texts the library translates (en, fr, de...).

- **Type:** string; **default:** `"en"`
- **Example:** `"adLanguage": "en"`
- **Tip:** Keep en for English labels.

#### Include ad details (`resolveAdDetails`)

`resolveAdDetails` - also asks the library for each ad's detail record and adds landing page, call to action, objective, subject, advertiser business id and country, paid for by, targeted countries, age groups, genders, audience size and reach per country. Details are read one at a time per search; when the library does not answer 4 detail requests in a row, the run stops asking and keeps the search data.

- **Type:** boolean; **default:** `false`
- **Example:** `"resolveAdDetails": true`
- **Tip:** Use it on small, focused runs.

#### Include reach breakdown (`includeAudienceBreakdown`)

`includeAudienceBreakdown` - adds `audienceBreakdown`: reach per country x age group x gender for every ad (one entry per combination, up to ~45 per country). Turns on Include ad details.

- **Type:** boolean; **default:** `false`
- **Example:** `"includeAudienceBreakdown": true`
- **Tip:** Great for audience analysis; it makes rows large.

#### Max ads per term and country (`maxItems`)

`maxItems` - how many ads to collect per search term and country (1-3,600). The library returns 12 ads per page and the run follows its next-page cursor until the limit or the end.

- **Type:** integer; **default:** `50`
- **Example:** `"maxItems": 50`
- **Tip:** 2 terms x 2 countries x 50 = up to 200 rows.

#### Max pages per term (`maxPages`)

`maxPages` - upper limit of library pages (12 ads each) per term and country. 0 = no page limit, Max ads decides.

- **Type:** integer; **default:** `0`
- **Example:** `"maxPages": 3`
- **Tip:** A quick way to cap long searches.

#### Max concurrency (`maxConcurrency`)

`maxConcurrency` - how many term + country searches run at the same time (1-20).

- **Type:** integer; **default:** `5`
- **Example:** `"maxConcurrency": 5`
- **Tip:** Raise it for long lists of terms.

#### Proxy configuration (`proxyConfiguration`)

`proxyConfiguration` - the proxy for the requests. The library answers the run's own connection; a proxy is optional.

- **Type:** object; **default:** `{"useApifyProxy": true, "apifyProxyGroups": ["RESIDENTIAL"]}`
- **Example:** `"proxyConfiguration": {"useApifyProxy": false}`
- **Tip:** Keep the default unless your runs are blocked.

### Ready-to-copy TikTok Ads Scraper inputs

**Latest ads of one advertiser in France**

```json
{
  "searchTerms": [
    "nike"
  ],
  "countries": [
    "FR"
  ],
  "maxItems": 50
}
```

**Keyword search in two countries with details**

```json
{
  "searchTerms": [
    "running shoes"
  ],
  "searchType": "keyword",
  "countries": [
    "DE",
    "IT"
  ],
  "maxItems": 20,
  "resolveAdDetails": true
}
```

**Biggest video ads of a period**

```json
{
  "searchTerms": [
    "temu"
  ],
  "countries": [
    "ES"
  ],
  "startDate": "2026-10-01",
  "endDate": "2026-10-31",
  "sortBy": "impression,desc",
  "adType": "VIDEO"
}
```

### Output of the TikTok Ads Scraper

One row per ad. A shortened example row of the TikTok Ads Scraper:

```
{
  "adId": "1879962057245361",
  "advertiserName": "Yundooo Technology International Company Limited",
  "adTitle": "Messi from Temu",
  "adFormat": "video",
  "firstShownDate": "2026-10-26",
  "lastShownDate": "2026-10-26",
  "daysRunning": 1,
  "uniqueUsersSeen": "0-1K",
  "adImpressions": 0,
  "region": "FR",
  "keyword": "temu"
}
```

#### Every output field of the TikTok Ads Scraper

| Field | Meaning |
|---|---|
| `source` | Always `library`. |
| `recordType` | Always `ad`. |
| `rank` | Position of the ad in the search results (1 = first). |
| `adId` | TikTok ad id. |
| `id` | Same as adId. |
| `advertiserName` | Advertiser name. |
| `brandName` | Same as advertiserName. |
| `author` | Same as advertiserName. |
| `adTitle` | Ad text. |
| `title` | Ad text. |
| `adText` | Ad text. |
| `adFormat` | `video`, `image`, or the library's type code when the ad has no media in the answer. |
| `adFormatLabel` | Video / Image. |
| `type` | Library type code. |
| `adStatus` | `active` or `removed`. |
| `auditStatus` | Library audit status code. |
| `sorAuditStatus` | Statement-of-reasons audit status code. |
| `showMode` | Library display mode (1 = media shown, 2 = media not shown in the list). |
| `firstShownDate` | First day the ad was shown. |
| `lastShownDate` | Last day the ad was shown. |
| `daysRunning` | Days between first and last shown, inclusive. |
| `uniqueUsersSeen` | Reach range, e.g. "10K-100K". |
| `usersTargetedEstimate` | Same reach range. |
| `adImpressions` | Impressions number the library shows. |
| `cost` | Spend range when the library shows it. |
| `budgetRange` | Same as cost. |
| `rejectionReasons` | Rejection reasons for removed ads. |
| `rejectedInCountries` | Country where a removed ad was rejected. |
| `videoUrl` | Link to the ad video. |
| `adVideoUrl` | Same as videoUrl. |
| `coverUrl` | Cover image of the video. |
| `thumbnailUrl` | Same as coverUrl. |
| `imageUrls` | Image links of the ad. |
| `videoCount` | Number of videos. |
| `imageCount` | Number of images. |
| `region` | Country searched. |
| `country_code` | Same as region. |
| `keyword` | Search term of the row. |
| `searchType` | advertiser or keyword. |
| `orderBy` | Sort order used. |
| `periodStart` | Start of the date range. |
| `periodEnd` | End of the date range. |
| `periodDays` | Length of the date range in days. |
| `detailUrl` | Ad Library page of the ad. |
| `detailsUrl` | Same as detailUrl. |
| `detailFetched` | true when the detail record was read. |
| `scrapedAt` | Time of the run (UTC). |
| `landingPageUrl` | Landing page of the ad (only with Include ad details). |
| `adLandingUrl` | Same as landingPageUrl. |
| `link` | Same as landingPageUrl. |
| `landing_page` | Same as landingPageUrl. |
| `ctaType` | Call-to-action button (only with Include ad details). |
| `campaignObjective` | Advertising objective (only with Include ad details). |
| `objective` | Same as campaignObjective. |
| `industryName` | Subject / industry of the ad (only with Include ad details). |
| `industry` | Same as industryName. |
| `advertiserBusinessId` | Advertiser business id (only with Include ad details). |
| `advertiserCountry` | Country where the advertiser is registered (only with Include ad details). |
| `adPaidForBy` | Who paid for the ad (only with Include ad details). |
| `advertiserProfile` | Linked TikTok account when given (only with Include ad details). |
| `targetCountries` | Targeted countries (only with Include ad details). |
| `targetAgeGroups` | Targeted age groups (only with Include ad details). |
| `targetGender` | Targeted genders (only with Include ad details). |
| `targetAudienceType` | Custom audience used: Yes/No (only with Include ad details). |
| `targetInterests` | Interest targeting (only with Include ad details). |
| `targetBehaviors` | Video and creator interaction targeting (only with Include ad details). |
| `targetAudienceSize` | Target audience size range (only with Include ad details). |
| `uniqueUsersSeenByCountry` | Reach range per country (only with Include ad details). |
| `targeting` | Other targeting: cities, provinces, languages, devices, OS, spending power, exclusions (only with Include ad details). |
| `audienceBreakdown` | Reach per country x age x gender (only with Include reach breakdown). |
| `displayMode` | Library display mode of the detail (only with Include ad details). |

### Which columns can be empty, and why

Measured on the 24-row test run (2 advertisers in France, details off) and a details run:

- `landingPageUrl`, `adLandingUrl`, `link`, `landing_page`, `ctaType`, `campaignObjective`, `objective`, `industryName`, `industry`, `advertiserBusinessId`, `advertiserCountry`, `adPaidForBy`, `advertiserProfile`, `targetCountries`, `targetAgeGroups`, `targetGender`, `targetAudienceType`, `targetInterests`, `targetBehaviors`, `targetAudienceSize`, `uniqueUsersSeenByCountry`, `targeting`, `displayMode`: filled only with Include ad details (they are in the ad's detail record, not in the search answer). Measured 2026-11-22: the library answered 1 of 48 detail requests and replied "system busy" to the rest, so even with the option on these columns can stay empty when the library is busy; `detailFetched` tells you per row.
- `audienceBreakdown`: only with Include reach breakdown (and when the detail record was answered).
- `videoUrl`, `adVideoUrl`, `coverUrl`, `thumbnailUrl`, `imageUrls`: empty for ads the library lists without media (showMode 2, 8 of 24 in the test); the detail record fills them when it is answered.
- `cost`, `budgetRange`: the library leaves the spend empty for commercial ads (24 of 24 empty in the test).
- `rejectionReasons`, `rejectedInCountries`: empty for ads that were not removed (every active ad).
- `advertiserProfile`, `targetInterests`: empty when the advertiser linked no TikTok account / used no interest targeting.

### How much does the TikTok Ads Scraper cost?

The TikTok Ads Scraper uses pay-per-event pricing: you pay per ad row. Example: 2 advertisers x 3 countries x 50 ads = 300 rows; at $1.49 per 1,000 rows that is about $0.45, plus a very small platform usage (the 24-row test used $0.0005).

### Use the TikTok Ads Scraper with the API

```python
from apify_client import ApifyClient
client = ApifyClient("<YOUR_API_TOKEN>")
run = client.actor("neuro-scraper/tiktok-ads-scraper").call(run_input={"searchTerms": ["nike"], "countries": ["FR"], "maxItems": 50})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)
```

You can also start the TikTok Ads Scraper over plain HTTP (`POST https://api.apify.com/v2/acts/neuro-scraper~tiktok-ads-scraper/run-sync-get-dataset-items?token=...`), schedule it, and connect it to Make, Zapier, n8n, Google Sheets, Slack or webhooks.

### Why choose the TikTok Ads Scraper

- Fast: the TikTok Ads Scraper runs every term and country in parallel - 24 ads in 7.4 seconds.
- Follows the library's own next-page cursor up to 3,600 ads per search.
- Detail records with landing page, objective and targeting on demand.
- No login, no cookies of yours, no API key.

### FAQ about the TikTok Ads Scraper

**Which countries are covered?**

The countries of the TikTok Ad Library: the EU, EEA, UK and Switzerland. The list is read from the library on every run.

**Why are there no ads from the US?**

The TikTok Ad Library lists ads shown in Europe only.

**How many ads can the TikTok Ads Scraper return?**

Up to 3,600 per term and country - the library pages 12 ads at a time and the TikTok Ads Scraper follows its cursor.

**Why are detail columns empty?**

Either Include ad details is off, or the library did not answer the detail request (it replies "system busy" under load). Check `detailFetched`.

**Can the TikTok Ads Scraper search by keyword?**

Yes - set Search by = keyword.

**Does the TikTok Ads Scraper download videos?**

No, it returns the video links; download them with any tool.

**Can I schedule the TikTok Ads Scraper?**

Yes. Schedule the TikTok Ads Scraper daily with Period (days) = 1 to collect the newest ads.

**Does the TikTok Ads Scraper need a TikTok account?**

No. The TikTok Ads Scraper works without login.

**Can I export TikTok Ads Scraper data to Excel?**

Yes - JSON, CSV, Excel, HTML or the API.

**How do I track one advertiser with the TikTok Ads Scraper?**

Put the advertiser name in Search terms, keep Search by = advertiser and schedule the TikTok Ads Scraper; compare `adId` and `lastShownDate` between runs.

**What about Creative Center Top Ads?**

The TikTok Ads Scraper covers the Ad Library. Creative Center metrics (CTR, likes) are not available without a TikTok-computed request signature.

### Related Actors

| Actor | What it extracts |
|---|---|
| [tiktok-scraper](https://apify.com/neuro-scraper/tiktok-scraper) | TikTok videos and profiles |
| [facebook-reels-scraper](https://apify.com/neuro-scraper/facebook-reels-scraper) | Facebook Reels with captions and views |
| [linkedin-ads-scraper](https://apify.com/neuro-scraper/linkedin-ads-scraper) | LinkedIn Ad Library ads |

### Disclaimer

The TikTok Ads Scraper collects publicly listed ads only. It does not log in and collects no personal data. Use the data in line with the applicable laws and terms.

# Actor input Schema

## `searchTerms` (type: `array`):

Advertiser names or keywords, one per line (e.g. "nike", "temu"). Each term is searched in every country.

## `query` (type: `string`):

One search term as a single text. Added to Search terms.

## `keyword` (type: `string`):

Same as Search query - kept so inputs from other tools work.

## `advertiserName` (type: `string`):

Optional advertiser name to search for. Added to Search terms.

## `adIds` (type: `array`):

Optional TikTok ad ids or Ad Library ad links. The run searches the ad library of each country for the id and returns the matching ad.

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

Two-letter codes of EU/EEA/UK countries (FR, DE, IT, ES, NL, PL, SE, GB...). Every term is searched in every country. The list of supported countries is read from the library at run time.

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

One country code as a single text. Added to Countries. "all" = every supported country in one search.

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

Ads shown on or after this date (YYYY-MM-DD). Default: the period below.

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

Ads shown on or before this date (YYYY-MM-DD). Default: today.

## `period` (type: `integer`):

Used when Start date is empty: ads shown in the last N days.

## `timezone` (type: `string`):

Time zone of Start date and End date (e.g. "Europe/Paris", "America/New_York"). Default UTC.

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

Order of the ads, as in the library: last shown date or impressions, newest/highest first or last.

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

advertiser = the term is matched against advertiser names (default); keyword = against the ad text.

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

Keep all ads, only video ads or only image ads.

## `adLanguage` (type: `string`):

Language code for texts the library translates (en, fr, de...).

## `resolveAdDetails` (type: `boolean`):

Also ask the library for each ad's detail record (targeting, paid-for-by, reach per country). When the library does not answer it, the row keeps the search data and `detailFetched` is false.

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

Adds `audienceBreakdown`: reach per country x age group x gender for each ad (one list entry per combination). Turns on Include ad details.

## `maxItems` (type: `integer`):

How many ads to collect per search term and country. The library pages 12 ads at a time and follows its own next-page cursor.

## `maxPages` (type: `integer`):

Upper limit of library pages (12 ads each) per term and country. 0 = no page limit (Max ads decides).

## `maxConcurrency` (type: `integer`):

How many term + country searches run in parallel.

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

Proxy for the requests. Default: Apify residential.

## Actor input object example

```json
{
  "searchTerms": [
    "nike"
  ],
  "countries": [
    "FR"
  ],
  "period": 30,
  "timezone": "UTC",
  "sortBy": "last_shown_date,desc",
  "searchType": "advertiser",
  "adType": "ALL",
  "adLanguage": "en",
  "resolveAdDetails": false,
  "includeAudienceBreakdown": false,
  "maxItems": 50,
  "maxPages": 0,
  "maxConcurrency": 5,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

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

One row per result, in the run's default dataset.

# 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 = {
    "searchTerms": [
        "nike"
    ],
    "countries": [
        "FR"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("neuro-scraper/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 = {
    "searchTerms": ["nike"],
    "countries": ["FR"],
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("neuro-scraper/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 '{
  "searchTerms": [
    "nike"
  ],
  "countries": [
    "FR"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call neuro-scraper/tiktok-ads-scraper --silent --output-dataset

```

## MCP server setup

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