# TikTok Top Ads Scraper (`parsebird/tiktok-top-ads-scraper`) Actor

Scrape TikTok Creative Center Top Ads by market, period, industry, objective, language, Spark format and likes tier. Get ad copy, brand, likes, CTR tier, budget, video URLs, landing page and keywords. Export JSON, CSV, Excel.

- **URL**: https://apify.com/parsebird/tiktok-top-ads-scraper.md
- **Developed by:** [ParseBird](https://apify.com/parsebird) (community)
- **Stats:** 3 total users, 3 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.69 / 1,000 tiktok 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 Top Ads Scraper

TikTok Top Ads Scraper extracts the best-performing ads from [TikTok Creative Center Top Ads](https://ads.tiktok.com/business/creativecenter/inspiration/topads/pc/en) with ad copy, brand, likes, CTR tier, budget level, industry, objective, Spark ad flag and video links, filtered by market, period, industry, objective, language, ad format and likes tier.

<table width="100%" style="width:100%"><tr>
<td style="border-left:4px solid #25F4EE;padding:12px 16px;font-weight:600">
Collect up to 3,000 TikTok top ads per run, far beyond the 20 that one Creative Center list shows, and optionally add each ad's landing page, comments, shares and markets for ad spy, creative research and competitor tracking.
</td>
</tr></table>
<br>
<table width="100%" style="width:100%">
<tr>
<td colspan="4" style="padding:10px 14px;background:#010101;border:none;border-radius:4px 4px 0 0">
<span style="color:#FFFFFF;font-size:14px;font-weight:700;letter-spacing:0.5px">ParseBird TikTok Suite</span>
<span style="color:#25F4EE;font-size:13px">&nbsp;&nbsp;&bull;&nbsp;&nbsp;Trends, ads, LIVE, shop, stories, slideshows &amp; videos</span>
</td>
</tr>
<tr>
<td style="padding:10px 14px;border:1px solid #E7E5E4;border-right:none;border-top:none;vertical-align:top;width:25%;background:#FFFFFF">
<a href="https://apify.com/parsebird/tiktok-trends-scraper" style="color:#1C1917;text-decoration:none;font-weight:700;font-size:13px">TikTok Trends Scraper</a><br>
<span style="color:#78716C;font-size:11px">Trending hashtags, sounds, creators</span>
</td>
<td style="padding:10px 14px;border:1px solid #E7E5E4;border-right:none;border-top:none;vertical-align:top;width:25%;background:#FFFFFF">
<a href="https://apify.com/parsebird/tiktok-ads-scraper" style="color:#1C1917;text-decoration:none;font-weight:700;font-size:13px">TikTok Ads Scraper</a><br>
<span style="color:#78716C;font-size:11px">Creative Center Top Ads</span>
</td>
<td style="padding:10px 14px;border:1px solid #E7E5E4;border-right:none;border-top:none;vertical-align:top;width:25%;background:#161823">
<a href="https://apify.com/parsebird/tiktok-top-ads-scraper" style="color:#FFFFFF;text-decoration:none;font-weight:700;font-size:13px">TikTok Top Ads Scraper</a><br>
<span style="color:#25F4EE;font-size:11px;font-weight:600">You are here</span>
</td>
<td style="padding:10px 14px;border:1px solid #E7E5E4;border-top:none;vertical-align:top;width:25%;background:#FFFFFF">
<a href="https://apify.com/parsebird/tiktok-live-search-scraper" style="color:#1C1917;text-decoration:none;font-weight:700;font-size:13px">TikTok Live Search Scraper</a><br>
<span style="color:#78716C;font-size:11px">LIVE rooms broadcasting now</span>
</td>
</tr>
<tr>
<td style="padding:10px 14px;border:1px solid #E7E5E4;border-right:none;border-top:none;border-radius:0 0 0 4px;vertical-align:top;width:25%;background:#FFFFFF">
<a href="https://apify.com/parsebird/tiktok-shop-reviews-scraper" style="color:#1C1917;text-decoration:none;font-weight:700;font-size:13px">TikTok Shop Reviews Scraper</a><br>
<span style="color:#78716C;font-size:11px">Product reviews and ratings</span>
</td>
<td style="padding:10px 14px;border:1px solid #E7E5E4;border-right:none;border-top:none;vertical-align:top;width:25%;background:#FFFFFF">
<a href="https://apify.com/parsebird/tiktok-story-viewer" style="color:#1C1917;text-decoration:none;font-weight:700;font-size:13px">TikTok Story Viewer</a><br>
<span style="color:#78716C;font-size:11px">Active stories, no-watermark video</span>
</td>
<td style="padding:10px 14px;border:1px solid #E7E5E4;border-right:none;border-top:none;vertical-align:top;width:25%;background:#FFFFFF">
<a href="https://apify.com/parsebird/tiktok-slideshow-downloader" style="color:#1C1917;text-decoration:none;font-weight:700;font-size:13px">TikTok Slideshow Downloader</a><br>
<span style="color:#78716C;font-size:11px">Photo-mode posts as image files</span>
</td>
<td style="padding:10px 14px;border:1px solid #E7E5E4;border-top:none;border-radius:0 0 4px 0;vertical-align:top;width:25%;background:#FFFFFF">
<a href="https://apify.com/parsebird/tiktok-video-downloader" style="color:#1C1917;text-decoration:none;font-weight:700;font-size:13px">TikTok Video Downloader</a><br>
<span style="color:#78716C;font-size:11px">MP4 videos to your cloud storage</span>
</td>
</tr>
</table>

##### Copy to your AI assistant

Copy this block into ChatGPT, Claude, Cursor, or any LLM to start using this actor.

```text
TikTok Top Ads Scraper (Apify actor parsebird/tiktok-top-ads-scraper) scrapes TikTok Creative Center Top Ads (ads.tiktok.com/business/creativecenter/inspiration/topads). Call it with the Apify API client: client.actor("parsebird/tiktok-top-ads-scraper").call(run_input={"maxItems": 100, "countryCode": "US", "period": "30"}). Inputs: maxItems (integer 1-3000, default 100); extractDetails (boolean, default false; adds landing page, comments, shares, markets, objectives, ad source; billed as a separate details event); countryCode (two-letter market such as US, GB, DE, FR, JP, BR, or empty for all); period ("7", "30" or "180" days, default "30"); industry (Creative Center industry name such as "Beauty & Personal Care", "Apps", "Games", "E-Commerce (Non-app)"); objective (campaign_objective_traffic, campaign_objective_app_install, campaign_objective_conversion, campaign_objective_video_view, campaign_objective_reach, campaign_objective_lead_generation, campaign_objective_product_sales); adLanguage (two-letter code such as en, es, ja); adFormat ("Spark ads" or "Non-Spark ads"); likeTier ("1" = Top 1-20% ... "5" = Top 81-100%); orderBy (for_you, like, ctr, impression, cvr, play_2s_rate, play_6s_rate); keyword (matched against ad text and brand). Output: one row per ad with adId, adTitle, brandName, ctr, ctrTier, likes, costScore, budgetLevel, industryName, industryGroup, objectiveName, isSparkAd, adFormatLabel, isSearch, videoId, durationSec, width, height, coverUrl, videoUrl720p (and other resolutions), rank, the filters used, detailUrl, creativeCenterUrl, scrapedAt, and with details: landingPageUrl, comments, shares, countries, objectives, adSource, keywords, tags. API docs: https://apify.com/parsebird/tiktok-top-ads-scraper/api. Get a token: https://console.apify.com/settings/integrations
```

### What is TikTok Top Ads Scraper?

**TikTok Top Ads Scraper** turns TikTok's [Creative Center Top Ads](https://ads.tiktok.com/business/creativecenter/inspiration/topads/pc/en) library into structured data. Top Ads is TikTok's public gallery of high-performing ads, ranked by reach, likes, CTR, conversion rate and view rates. The scraper returns **every ad's copy, brand, likes, CTR tier, budget level, industry, campaign objective, Spark ad flag, video duration, cover image and video URLs**, and with details on, **the landing page, comments, shares and the markets where it ran**.

It works as a **TikTok Creative Center API** alternative: no TikTok account and no browser. The easiest way to try it is to keep the example settings (US, last 30 days), click **Start**, and download the ads as JSON, CSV or Excel a few seconds later.

### What can TikTok Top Ads Scraper do?

- 🎯 **Every Creative Center filter**: market, period (7, 30 or 180 days), industry, campaign objective, ad language, Spark or non-Spark format and likes tier.
- ↕️ **Seven sort orders**: For You, Likes, CTR, Reach, CVR, 2-second and 6-second view rate.
- 📦 **Up to 3,000 ads per run**: one Creative Center list stops at 20 ads, so the scraper splits your filters into narrower lists and merges them without duplicates.
- 🔗 **Full ad details** (optional): landing page URL, comments, shares, markets, all campaign objectives and ad source.
- 🎬 **Video assets**: cover image, video URLs per resolution, duration and size.
- 🔍 **Keyword filter**: keep only ads whose text or brand mentions your keyword.

As an Apify Actor it also gives you [scheduling](https://docs.apify.com/platform/schedules) for weekly ad monitoring, a [REST API](https://docs.apify.com/api/v2), [integrations](https://apify.com/integrations) with Google Sheets, Zapier, Make, Slack and webhooks, and exports to JSON, CSV, Excel, XML and HTML.

### What data can you extract from TikTok Top Ads?

| Field | Description |
|-------|-------------|
| `adId`, `adTitle`, `brandName` | Creative Center ad ID, ad text and brand |
| `likes` | Likes on the ad |
| `ctr`, `ctrTier` | CTR percentile from Creative Center (0.15 = "Top 15%"; lower is better) |
| `costScore`, `budgetLevel` | Budget level 0/1/2 = Low/Medium/High |
| `industryName`, `industryGroup`, `objectiveName` | Industry, parent industry and campaign objective |
| `isSparkAd`, `adFormatLabel`, `isSearch` | Spark ad flag and search placement flag |
| `videoId`, `durationSec`, `width`, `height` | Video metadata |
| `coverUrl`, `videoUrl720p` (and other resolutions) | Cover image and video file links |
| `rank` | Position in your results |
| `countryCode`, `periodDays`, `orderBy`, `industryLabel`, `filterObjective`, `adLanguage`, `adFormat`, `likeTier`, `keyword` | The filters used for the row |
| `detailUrl`, `creativeCenterUrl` | Ad page and list page on Creative Center |
| `landingPageUrl`, `comments`, `shares`, `countries`, `objectives`, `adSource` | Full ad details (with **Fetch full ad details**) |

### How to scrape TikTok Top Ads

1. Open [TikTok Top Ads Scraper](https://apify.com/parsebird/tiktok-top-ads-scraper) in Apify Console.
2. Set **Max top ads** and pick a **Market** and **Period**.
3. Optionally narrow by **Industry**, **Campaign objective**, **Ad language**, **Ad format** or **Likes**, and choose **Sort by**.
4. Turn on **Fetch full ad details** if you need landing pages, comments and shares.
5. Click **Start**.
6. Download the ads from the **Output** tab as JSON, CSV, Excel, XML or HTML, or read them through the [API](https://apify.com/parsebird/tiktok-top-ads-scraper/api).

### Input parameters

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| `maxItems` | integer | No | 100 | Top ads to save, up to 3,000 |
| `extractDetails` | boolean | No | `false` | Add landing page, comments, shares, markets, objectives and ad source |
| `countryCode` | string | No | all markets | Market, e.g. `US`, `GB`, `DE`, `FR`, `JP`, `BR` |
| `period` | string | No | `30` | `7`, `30` or `180` days |
| `industry` | string | No | all | Creative Center industry, e.g. `Beauty & Personal Care`, `Games`, `Apps` |
| `objective` | string | No | all | e.g. `campaign_objective_conversion`, `campaign_objective_traffic` |
| `adLanguage` | string | No | all | Two-letter language code, e.g. `en`, `es`, `ja` |
| `adFormat` | string | No | all | `Spark ads` or `Non-Spark ads` |
| `likeTier` | string | No | all | `1` (Top 1-20%) to `5` (Top 81-100%) |
| `orderBy` | string | No | `for_you` | `for_you`, `like`, `ctr`, `impression`, `cvr`, `play_2s_rate`, `play_6s_rate` |
| `keyword` | string | No | — | Keep ads whose text or brand contains these words |
| `proxyConfiguration` | object | No | off | Switches to Apify Proxy automatically if TikTok blocks requests |

**Input examples**

Quick start (US, last 30 days):

```json
{ "maxItems": 100, "countryCode": "US", "period": "30" }
```

UK beauty Spark ads in English, best CTR first, with details:

```json
{
  "maxItems": 100,
  "extractDetails": true,
  "countryCode": "GB",
  "period": "30",
  "industry": "Beauty & Personal Care",
  "adLanguage": "en",
  "adFormat": "Spark ads",
  "orderBy": "ctr"
}
```

### Output example

```json
{
  "adId": "7678457872176676872",
  "adTitle": "AD adding a little extra collagen support to my routine with @Kiehlsuki 1cc Collashot Plump Serum ✨💗 ...",
  "brandName": "kiehl's",
  "ctr": 0.15,
  "ctrTier": "Top 15%",
  "likes": 2707,
  "costScore": 2,
  "budgetLevel": "High",
  "industryName": "Beauty & Personal Care",
  "industryGroup": "Beauty & Personal Care",
  "objectiveKey": "campaign_objective_reach",
  "objectiveName": "Reach",
  "isSparkAd": true,
  "adFormatLabel": "Spark ads",
  "isSearch": true,
  "videoId": "v24044gl0000da65e5vog65tf8ro28pg",
  "durationSec": 19.367,
  "width": 576,
  "height": 1024,
  "coverUrl": "https://p16-common-sign.tiktokcdn.com/...",
  "videoUrl720p": "https://v16m-default.tiktokcdn.com/...",
  "rank": 2,
  "countryCode": "GB",
  "periodDays": 30,
  "orderBy": "ctr",
  "industryLabel": "Beauty & Personal Care",
  "adLanguage": "en",
  "adFormat": "1",
  "filterAdFormatLabel": "Spark ads",
  "detailUrl": "https://ads.tiktok.com/business/creativecenter/topads/7678457872176676872/pc/en?period=30&countryCode=GB",
  "creativeCenterUrl": "https://ads.tiktok.com/business/creativecenter/inspiration/topads/pc/en?period=30&region=GB&order_by=ctr",
  "detailFetched": true,
  "landingPageUrl": "https://www.kiehls.co.uk/skin-care/category/facial-oils-serums/1cc-collashot-plump-serum/WW0368KIE.html?...",
  "comments": 7,
  "shares": 12,
  "countries": ["GB"],
  "objectives": ["Reach", "Video Views", "Traffic"],
  "adSource": "Others",
  "scrapedAt": "2026-10-05T13:43:37.457Z"
}
```

Long URLs are shortened above. Video and cover links are signed by TikTok and expire after a while, so download files you need soon after the run.

### How to use the TikTok Top Ads API

**Python**

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_APIFY_TOKEN>")
run = client.actor("parsebird/tiktok-top-ads-scraper").call(run_input={
    "maxItems": 500,
    "countryCode": "US",
    "period": "30",
    "industry": "Games",
    "orderBy": "like",
})
for ad in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(ad["likes"], ad["ctrTier"], ad["adTitle"][:60])
```

**JavaScript**

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: '<YOUR_APIFY_TOKEN>' });
const run = await client.actor('parsebird/tiktok-top-ads-scraper').call({
    maxItems: 200,
    countryCode: 'GB',
    period: '7',
    extractDetails: true,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items.map((ad) => [ad.brandName, ad.landingPageUrl]));
```

Get your token in [Apify Console → Integrations](https://console.apify.com/settings/integrations). Full endpoint reference is on the [API tab](https://apify.com/parsebird/tiktok-top-ads-scraper/api).

### Use cases

- **TikTok ad spy**: see which ads perform best in your industry and market, and how competitors pitch.
- **Creative research**: study hooks, durations and Spark vs non-Spark formats of high-CTR ads.
- **Landing page and offer research**: collect where top ads send traffic and which offers they promote.
- **Trend monitoring**: schedule a weekly run per market and track how the top ads change.
- **Agency reporting**: export top ads by industry into Google Sheets for client pitches.

### How it works

1. Your filters are sent to Creative Center's Top Ads list, the same data the website shows.
2. Because one list shows at most 20 ads, the scraper splits the filters into narrower lists (format, objective, likes tier, industry, market, language and sort order) and merges the results without duplicates.
3. With details on, each ad's detail page data is added.
4. Rows are saved in the order of your **Sort by** choice, up to **Max top ads**.

### How much does it cost to scrape TikTok Top Ads?

TikTok Top Ads Scraper uses pay-per-event pricing with two events:

| Event | Free | Bronze | Silver | Gold |
|-------|------|--------|--------|------|
| `result`, per 1,000 ads | **$0.99** | **$0.89** | **$0.79** | **$0.69** |
| `details`, per 1,000 ads with full details | **$1.99** | **$1.79** | **$1.59** | **$1.39** |

`details` is charged only when **Fetch full ad details** is on and the details were fetched. For example, 1,000 ads cost $0.99 on the Free plan, or $2.98 with full details. Compute and proxy costs are included in the event price, and you can set a maximum spend per run in Apify Console.

### FAQ

**How many ads can I get?**
Up to 3,000 per run. Broad filters reach that: a global 180-day run collected 3,000 ads in about 70 seconds in our tests. Narrow filter combinations can have far fewer ads on Creative Center; the run then saves all it finds and says how many were listed.

**How does the keyword filter work?**
Creative Center's own keyword search is only available to logged-in users, so the scraper collects top ads for your other filters and keeps those whose ad text or brand name contains your keyword. Keyword runs search more lists, so they take longer, and matches can be rare: "nike" matched 3 ads out of about 4,500 global 180-day top ads.

**What does `ctr` mean?**
Creative Center shows CTR as a percentile among top ads, not a raw click rate. `0.15` means "Top 15%", and lower values are better.

**Are keywords and tags included?**
The `keywords` and `tags` fields are filled when Creative Center provides them for an ad. In our tests on 1,000 ads with details they were empty for every ad, while landing pages were available for about 70% of them.

**Why are some `isSparkAd` values null?**
Spark status comes from Creative Center's Spark / non-Spark lists. A few ads appear in neither list during a run, and their status stays unknown.

**Do I need a TikTok account or proxy?**
No. Runs start without a proxy and switch to Apify Proxy automatically if TikTok blocks the requests.

**Something is missing or not working?**
Open an issue on the **Issues** tab and we will look into it.

### Is it legal to scrape TikTok Creative Center?

Our scrapers are ethical and do not extract any private user data, such as email addresses, gender, or location. They only extract what the user has chosen to share publicly. We therefore believe that our scrapers, when used for ethical purposes by Apify users, are safe. However, you should be aware that your results could contain personal data. Personal data is protected by the GDPR in the European Union and by other regulations around the world. You should not scrape personal data unless you have a legitimate reason to do so. If you're unsure whether your reason is legitimate, consult your lawyers. You can also read our blog post on the [legality of web scraping](https://blog.apify.com/is-web-scraping-legal/).

### Other TikTok scrapers

| Actor | What it scrapes |
|-------|-----------------|
| [TikTok Ads Scraper](https://apify.com/parsebird/tiktok-ads-scraper) | Creative Center Top Ads with concise or detailed output |
| [TikTok Trends Scraper](https://apify.com/parsebird/tiktok-trends-scraper) | Trending hashtags, sounds, creators and videos |
| [TikTok Live Search Scraper](https://apify.com/parsebird/tiktok-live-search-scraper) | TikTok LIVE rooms by keyword |
| [TikTok Shop Reviews Scraper](https://apify.com/parsebird/tiktok-shop-reviews-scraper) | TikTok Shop product reviews |
| [TikTok Slideshow Downloader](https://apify.com/parsebird/tiktok-slideshow-downloader) | Photos from TikTok slideshow posts |
| [TikTok Story Viewer](https://apify.com/parsebird/tiktok-story-viewer) | Active public TikTok stories by username |

# Changelog

This Actor's version history is a separate document: https://apify.com/parsebird/tiktok-top-ads-scraper/changelog.md

# Actor input Schema

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

Maximum number of top ads to save (up to 3,000). The scraper splits your filters into narrower Creative Center lists to collect more than the 20 ads one list shows; very narrow filters can have fewer ads.

## `extractDetails` (type: `boolean`):

Add each ad's landing page, keywords, tags, comments, shares, markets and ad source. Billed as a separate details event per ad.

## `countryCode` (type: `string`):

Country where the ads ran. Leave empty for all markets.

## `period` (type: `string`):

Time window of the Top Ads ranking.

## `industry` (type: `string`):

Keep only ads from one industry. Leave empty for all industries.

## `objective` (type: `string`):

Advertiser's campaign goal. Leave empty for all objectives.

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

Two-letter language code of the ad, e.g. <code>en</code>, <code>es</code>, <code>ja</code>, <code>pt</code>, <code>de</code>. Leave empty for all languages.

## `adFormat` (type: `string`):

Spark ads are boosted organic TikTok posts; non-Spark ads are uploaded by the advertiser.

## `likeTier` (type: `string`):

Keep only ads in one likes tier, as on Creative Center.

## `orderBy` (type: `string`):

Order of the top ads, like the Sort menu on Creative Center.

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

Keep only ads whose text or brand name contains these words, e.g. <code>nike</code> or <code>skincare</code>.

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

Runs start without a proxy and switch to Apify Proxy automatically if TikTok blocks the requests.

## Actor input object example

```json
{
  "maxItems": 20,
  "extractDetails": false,
  "countryCode": "US",
  "period": "30",
  "industry": "",
  "objective": "",
  "adFormat": "",
  "likeTier": "",
  "orderBy": "for_you",
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `dataset` (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 = {
    "maxItems": 20,
    "countryCode": "US",
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("parsebird/tiktok-top-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 = {
    "maxItems": 20,
    "countryCode": "US",
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("parsebird/tiktok-top-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 '{
  "maxItems": 20,
  "countryCode": "US",
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call parsebird/tiktok-top-ads-scraper --silent --output-dataset

```

## MCP server setup

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