# TikTok Shop Top Videos Scraper - Video Sales & Ad ROAS (`zen-studio/tiktok-shop-top-videos-scraper`) Actor

Find the TikTok Shop videos that sell the most in 24 markets: revenue, views, likes, comments, shares and engagement rate per video, plus the ad flag, ad ROAS, ad share of revenue and views and TikTok's AI-video flag. Rank by keyword, category, shop, creator or product.

- **URL**: https://apify.com/zen-studio/tiktok-shop-top-videos-scraper.md
- **Developed by:** [Zen Studio](https://apify.com/zen-studio) (community)
- **Categories:** E-commerce, Social media
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.09 / 1,000 videos

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

[![See which videos sell and what ads contribute. The UK example shows 18.3% of views and 80% of estimated revenue attributed to ads.](https://api.apify.com/v2/key-value-stores/pJ7iaZsTFhR3k9tjV/records/tiktok-shop-top-videos-scraper-readme-hero-d59e850639c1.png)](https://console.apify.com/actors/cRpd4F7P1aiQgQeBU/input)

From **Zen Studio**, creators of the [Douyin Product Search Scraper](https://apify.com/zen-studio/douyin-product-search-scraper), used by **5,000+ users** to track sales and commission on China's TikTok, and the [1688 Wholesale Scraper](https://apify.com/zen-studio/1688-wholesale-scraper), used by **9,000+ users**.

### See what ads contribute to TikTok Shop video sales

- Find videos that sell. Rank shoppable videos by estimated revenue for a keyword, category, shop, creator or product.
- Compare paid views with paid sales. In the UK example, ads accounted for 18.3% of views and 80% of estimated revenue, with a reported 2.26× return on ad spend.
- **24 markets.** Choose a country and a reporting period. Sales and revenue figures are estimates.

<a href="https://console.apify.com/actors/cRpd4F7P1aiQgQeBU/input"><img src="https://api.apify.com/v2/key-value-stores/pJ7iaZsTFhR3k9tjV/records/tiktok-shop-top-videos-scraper-readme-cta-v1-37a65a802fb2.svg" width="240" height="48" alt="Try 20 top videos" /></a>

#### Find shoppable air fryer videos in the UK

```json
{
  "keywords": [
    "air fryer"
  ],
  "country": "GB",
  "period": "last30Day",
  "currency": "GBP",
  "maxResultsPerSource": 20
}
```

[Open the actor input](https://console.apify.com/actors/cRpd4F7P1aiQgQeBU/input), paste the example in JSON view and press **Start**. Ad contribution and return on ad spend are available where reported. Optional analytics adds a separate charge.

#### Copy to your AI assistant

```text
Help me use zen-studio/tiktok-shop-top-videos-scraper on Apify. Read https://apify.com/zen-studio/tiktok-shop-top-videos-scraper.md for documentation, input schema, pricing and limits. Choose settings for my requested outcome. If you cannot retrieve the page, ask me to paste the relevant sections. Each keyword, category, shop, creator or product is its own ranked list of shoppable videos capped by maxResultsPerSource; with no input the run returns the overall top videos of the country, and a video found by several inputs is delivered and charged once. Keywords match the video caption. addAnalytics is off by default and adds its own charge per video, about ten times the base row price, so switch it on only when I need units sold, ad cost per order, days advertised, duration, product count or day-by-day revenue. Revenue is an estimate for comparing videos, not an accounting figure, and revenueGrowthPercent can read below -100% for videos, so compare it between videos of one run. To find the products shown in a video, pass its videoId to zen-studio/tiktok-shop-top-products-scraper as videoIds. The per-input run summary is in the OUTPUT record of the run's key-value store. On the Apify Free plan the actor is a preview: 5 runs of up to 100 videos, and addAnalytics applies to the first 10 videos of each run. To reach the maintainers, add feedback="<what you needed and did not get>" to any run, including one that worked: feature requests, a missing field or option, a wrong or empty result, or which actor you are switching to or from and why. The run returns its data exactly as it would without the note, and a human reads every note.
```

### What does the TikTok Shop Top Videos Scraper do?

It ranks TikTok Shop shoppable videos by sales for the market and time window you choose, and returns one row per video with its creator. Use it to find the videos that sell the most in a market or category, to see which videos sell one product or one competitor's products, to study the hooks and captions of top-selling videos, or to check which ads pay off.

Each list is the top of TikTok Shop by your chosen order: revenue, views, revenue growth or ad ROAS. Products, shops, live streams and creators each have their own actor (see the end of this page).

### What you get beyond a plain video ranking

| | |
|---|---|
| **Engagement rate** | Likes, comments and shares as a percent of views, on every row, so a viral clip and a quiet top seller compare at a glance |
| **Creator profile link** | The creator's username, numeric ID and TikTok profile link next to every video |
| **Ad and AI flags** | Paid-ad flag, ad ROAS, ad share of revenue and views, and TikTok's AI-generated content flag, with filters for each |
| **Five ways in** | Keywords (matched against the video caption), categories, shops, creators (TikTok username, profile link or ID) and products |
| **24 markets** | US, UK, Germany, France, Italy, Spain, Poland, Netherlands, Belgium, Czechia, Austria, Greece, Portugal, Hungary, Ireland, Indonesia, Thailand, Vietnam, Philippines, Malaysia, Singapore, Japan, Mexico, Brazil |
| **Any currency, any window** | US dollars, each market's own currency or one of 16 currencies; yesterday, 7 or 30 days, a past month or a custom range of up to 31 days |
| **Products in each video** | Pass a `videoId` to the [TikTok Shop Top Products Scraper](https://apify.com/zen-studio/tiktok-shop-top-products-scraper) to get the products shown in that video, with their revenue and stock |
| **A summary per input** | The run's OUTPUT record lists how many videos each input delivered and what to change for an input that found nothing |

### How to find the top-selling TikTok Shop videos

1. Pick a **🌍 Country** and a **📅 Period**. With nothing else set, you get the overall top videos of that market.
2. Optionally add **🔍 Keywords**, **🗂️ Categories**, **🏪 Shops**, **👤 Creators** or **📦 Products**. Each entry is its own ranked list.
3. Set **🔢 Max results per source** (videos per list) and, if you like, a sort order and filters.
4. Press **Start** and export JSON, CSV, Excel or HTML.

#### Input options

| Parameter | Type | Default | Meaning |
|---|---|---|---|
| `keywords` | list | empty | Each keyword is its own ranked list of videos whose caption matches it, for example `air fryer` |
| `categories` | list | empty | TikTok Shop category names or IDs: `Beauty & Personal Care`, `Kitchen Appliances`, `601450` |
| `shops` | list | empty | Store links, shop IDs or exact shop names: the videos of each shop |
| `creators` | list | empty | TikTok usernames (`@name`), profile links or numeric IDs: the videos of each creator |
| `productIds` | list | empty | TikTok Shop product links or IDs: the videos selling each product |
| `country` | select | `US` | One of 24 TikTok Shop markets |
| `period` | select | `last30Day` | `lastDay` (yesterday), `last7Day` or `last30Day` |
| `month` | text | empty | A past calendar month such as `2026-10`; overrides `period` |
| `dateFrom`, `dateTo` | date | empty | Your own window of up to 31 days, ending yesterday or earlier; overrides `month` and `period` |
| `maxResultsPerSource` | number | `100` | Videos per list, 1 to 10,000 |
| `currency` | select | `USD` | `USD`, `local` (the market's own currency) or one of 16 currencies |
| `sortBy`, `ascending` | select, switch | `revenue`, off | `revenue`, `views`, `revenueGrowth` or `adsRoas`; `ascending` puts the lowest first |
| `minRevenue`, `maxRevenue` | numbers | off | Revenue range in the period, in the chosen currency |
| `minViews`, `maxViews` | numbers | off | Views range in the period |
| `minAdsRoas`, `maxAdsRoas` | numbers | off | Ad ROAS range (revenue per ad dollar) |
| `minFollowers`, `maxFollowers` | numbers | off | Creator follower range |
| `aiVideos` | select | `all` | `all`, `only` (AI-generated videos only) or `exclude` |
| `publishedWithin` | select | `any` | `any`, `last3Days`, `last7Days` or `last30Days` |
| `addAnalytics` | switch | off | Units sold, GPM, ad views, ad cost per order, days advertised, duration, product count and day-by-day revenue. Extra charge per video |

Keyword rows carry `matchStrict`, true when the caption holds every word of the keyword.

#### More input examples

The top 20 air fryer videos in the UK over the last 30 days, in British pounds:

```json
{
  "keywords": [
    "air fryer"
  ],
  "country": "GB",
  "period": "last30Day",
  "currency": "local",
  "maxResultsPerSource": 20
}
```

In our run all 20 videos had both words in the caption, led by a video with £14,993.84 in revenue and 656,440 views.

Ads that pay off: videos with an ad ROAS of at least 5 and 100,000 views or more in the last 30 days, best ROAS first:

```json
{
  "country": "US",
  "period": "last30Day",
  "minAdsRoas": 5,
  "minViews": 100000,
  "sortBy": "adsRoas",
  "maxResultsPerSource": 50
}
```

The videos selling one product, best-selling first:

```json
{
  "productIds": [
    "1732390274888863829"
  ],
  "country": "US",
  "period": "last30Day",
  "maxResultsPerSource": 100
}
```

The top 50 beauty videos in the UK last month, AI-generated videos excluded:

```json
{
  "categories": [
    "Beauty & Personal Care"
  ],
  "country": "GB",
  "month": "2026-10",
  "currency": "local",
  "aiVideos": "exclude",
  "maxResultsPerSource": 50
}
```

### What data can you extract from TikTok Shop videos?

| Group | Fields |
|---|---|
| **Video** | `videoId`, `title` (caption), `url`, `publishedAt`, `rank` |
| **Sales in the window** | `revenue`, `revenueGrowthPercent`, `views` |
| **Engagement** | `likes`, `comments`, `shares`, `engagementRatePercent` |
| **Ads and AI** | `isAd`, `adsRoas`, `adRevenueSharePercent`, `adViewSharePercent`, `isAiVideo` |
| **Creator** | `creatorId`, `creatorUsername`, `creatorUrl` |
| **Analytics (option)** | `unitsSold`, `gpm`, `adViews`, `adCpa`, `adDays`, `durationSec`, `productCount`, `dailyRevenue` |
| **Context** | `type`, `country`, `period`, `periodStart`, `periodEnd`, `currency`, `source`, `sourceInput`, `category`, `matchStrict`, `analytics`, `scrapedAt` |

#### Output example

The first row of the quick-start example above, at 100 videos (US, last 7 days, real run on 10 November 2026):

```json
{
  "type": "video",
  "videoId": "7702329049812684063",
  "title": "no but literally…",
  "url": "https://www.tiktok.com/@millennialmagss/video/7702329049812684063",
  "creatorId": "7543791020522079246",
  "creatorUsername": "millennialmagss",
  "creatorUrl": "https://www.tiktok.com/@millennialmagss",
  "revenue": 211978,
  "views": 6541778,
  "revenueGrowthPercent": -202.42,
  "adsRoas": 3.99,
  "likes": 91920,
  "shares": 2480,
  "comments": 1021,
  "engagementRatePercent": 1.46,
  "isAd": true,
  "isAiVideo": false,
  "adRevenueSharePercent": 80,
  "adViewSharePercent": 20.69,
  "publishedAt": "2026-10-30T01:31:06",
  "matchStrict": null,
  "analytics": false,
  "rank": 1,
  "country": "US",
  "period": "last7Day",
  "periodStart": null,
  "periodEnd": null,
  "currency": "USD",
  "source": "top",
  "sourceInput": "top videos US",
  "category": null,
  "scrapedAt": "2026-11-10T14:56:13Z"
}
```

In this 100-video run, 93 videos ran as paid ads and 5 carried TikTok's AI-generated flag; the median engagement rate was about 0.9%.

#### Analytics fields

With `addAnalytics` switched on, a row also carries the fields below. This excerpt shows rank 2 of the same US list with analytics (real run earlier the same day, so revenue and views differ slightly from the run above); `revenue` and `views` are included for comparison.

```json
{
  "videoId": "7700317911897869581",
  "revenue": 169475.54,
  "views": 1685042,
  "analytics": true,
  "unitsSold": 446,
  "gpm": 100.58,
  "adViews": 1681526,
  "adCpa": 91.74,
  "adDays": 6,
  "durationSec": 113.6,
  "productCount": 1,
  "dailyRevenue": [
    759.98,
    1519.96,
    14439.62,
    55858.53,
    38378.99,
    53198.6,
    5319.86
  ]
}
```

`dailyRevenue` holds one value per day of the period, oldest first; in our tests it added up to `revenue`. `gpm` is revenue per 1,000 views, `adCpa` the ad cost per order in the chosen currency, `durationSec` the video length.

#### Good to know about the figures

- **Figures update during the day.** Two runs a few hours apart can rank videos differently as new sales come in. Lists read at the same time showed the same figures for a video in our tests, so compare videos within one run.
- **Revenue growth reads differently for videos.** `revenueGrowthPercent` was below -100% for 98 of the 100 videos in our US test, including videos published inside the window. Use it to compare videos within one run, not as a percent change against the previous period.
- **Empty captions.** 10 of the 100 top videos in our US test had no caption, because the creator wrote none.
- **Publish time** is the market's local time, without a time zone offset.

#### Run summary

Besides the dataset, each run writes an **OUTPUT** record to its key-value store, also linked on the run's Output tab. This one comes from a run whose only input was not a product link or ID:

```json
{
  "delivered": 0,
  "duplicatesSkipped": 0,
  "country": "US",
  "period": "lastDay",
  "currency": "USD",
  "inputs": [
    {
      "input": "not-a-product",
      "kind": "product",
      "rows": 0,
      "status": "bad-input",
      "error": "\"not-a-product\": use the product link or the numeric product ID."
    }
  ]
}
```

### Use cases

- **Creative research for ads and UGC.** Read the captions and hooks of the videos that sell the most in your category, with their views and engagement rate, before you brief creators or write your next ad.
- **Ad performance.** See which top-selling videos ran as paid ads, their ad ROAS and how much of their revenue came from ads; filter on a minimum ROAS to find the ads that pay off.
- **Product and competitor research.** Put a product link into **Products** or a competitor's store into **Shops** to see every video selling it, ranked by revenue. Take a strong video's `videoId` into the [TikTok Shop Top Products Scraper](https://apify.com/zen-studio/tiktok-shop-top-products-scraper) to see the products in it.
- **Affiliate and creator scouting.** Find the creators behind the top-selling videos with their profile links, then compare them with the [TikTok Shop Top Creators Scraper](https://apify.com/zen-studio/tiktok-shop-top-creators-scraper).
- **AI content tracking.** Use **AI-generated videos** to keep only, or leave out, the videos TikTok flags as AI-generated, and compare how they sell.

### How much does it cost to scrape TikTok Shop videos?

You pay per video delivered: **$2.99 per 1,000 videos** on the Free plan. Bronze pays $2.79, Silver $2.49, Gold and above $2.09 per 1,000.

- **Analytics** is optional and adds its own charge per video, about ten times the base price. The Pricing tab lists the exact amount.
- A video found by several inputs is delivered and charged once. Inputs that find nothing, the run summary and failed inputs are never charged.
- Set **Max cost per run** in the run options and the run stops at that amount.
- **Apify Free plan preview:** 5 runs, each with up to 100 videos, and analytics on the first 10 videos of each run. Any paid Apify plan removes every limit.

### FAQ

**How accurate are the revenue figures?**
TikTok does not publish video revenue. `revenue` is a market estimate, made to compare and rank videos, not an accounting figure.

**How do I find viral TikTok Shop videos that actually sell?**
Leave every input empty, pick your country and a short period such as **Last 7 days**, and keep **Sort by** on **Revenue**. Switch it to **Views** for the most-watched shoppable videos, add **Min revenue** to keep only videos that sell, or set **Published** to **Last 7 days** for fresh ones.

**What does a keyword match?**
The video caption. In our UK test, `air fryer` returned 20 videos, each with both words in its caption, and `matchStrict` was true on all 20.

**Can I see every video of one shop, creator or product?**
Yes. Put the store link or shop ID into **Shops**, the TikTok username, profile link or numeric ID into **Creators**, or the product link or ID into **Products**. Each becomes its own list, ranked by revenue.

**How do I see which ads pay off?**
Every row has `isAd`, `adsRoas` (revenue per ad dollar) and the share of revenue and views that came from ads. Sort by **Ad ROAS** and add **Min revenue** or **Min views** so that tiny, highly efficient ads do not crowd the top.

**Does it flag AI-generated videos?**
Yes. `isAiVideo` carries TikTok's AI-generated content flag, and **AI-generated videos** keeps only or excludes them.

**Which countries are covered?**
24 TikTok Shop markets: the United States, the United Kingdom, Germany, France, Italy, Spain, Poland, the Netherlands, Belgium, Czechia, Austria, Greece, Portugal, Hungary, Ireland, Indonesia, Thailand, Vietnam, the Philippines, Malaysia, Singapore, Japan, Mexico and Brazil.

**Can I get a past month or my own date range?**
Yes. Set **Month** (for example `2026-10`) or **From date** and **To date** for a window of up to 31 days that ends yesterday or earlier.

**How many videos can I get?**
Up to 10,000 per input with `maxResultsPerSource`. Long lists can end earlier when fewer videos match the window and filters.

**Can I use it in my own tools or with an AI agent?**
Yes. Start runs and read results with the Apify Python and JavaScript clients, connect it to n8n, Make, Zapier or Google Sheets, trigger it on a schedule or with webhooks, or let AI agents call it through the Apify MCP server.

**Is it legal to scrape TikTok Shop?**
The actor works without any TikTok login or account. You are responsible for how you use the data, including applicable laws and TikTok's terms.

### More TikTok Shop data from Zen Studio

- [TikTok Shop Top Products Scraper](https://apify.com/zen-studio/tiktok-shop-top-products-scraper): the best-selling products by revenue, with units sold, live stock and SKU prices, and the products shown in any video.
- [TikTok Shop Top Shops Scraper](https://apify.com/zen-studio/tiktok-shop-top-shops-scraper): the best-selling shops by revenue, with affiliate and own-account sales.
- [TikTok Shop Live Sales Scraper](https://apify.com/zen-studio/tiktok-shop-live-sales-scraper): the live streams that sell the most, and which hosts are live right now.
- [TikTok Shop Top Creators Scraper](https://apify.com/zen-studio/tiktok-shop-top-creators-scraper): the affiliate creators who sell the most, with followers, categories and revenue.
- [TikTok Shop Product Scraper](https://apify.com/zen-studio/tiktok-shop-product-scraper): search products by keyword in 16 marketplaces, with variant stock and the videos promoting them.
- [TikTok Shop Review Scraper](https://apify.com/zen-studio/tiktok-shop-review-scraper): every buyer review of the products these videos sell.

### Support

Found a bug or need a field? Open an issue on the **Issues** tab and we will get back to you.

# Actor input Schema

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

Leave every source empty for the overall top videos of the country. Each keyword is its own ranked list of videos matching it (by caption), for example <code>air fryer</code> or <code>skincare</code>.

## `categories` (type: `array`):

TikTok Shop category names or IDs, each a separate list: <code>Beauty & Personal Care</code>, <code>Kitchen Appliances</code>, <code>601450</code>.

## `shops` (type: `array`):

Store links (<code>shop.tiktok.com/us/store/…/7495…</code>), shop IDs or exact shop names: the videos of each shop.

## `creators` (type: `array`):

TikTok usernames (<code>@name</code>), profile links or numeric creator IDs: the videos of each creator.

## `productIds` (type: `array`):

TikTok Shop product links or IDs: the videos selling each product.

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

TikTok Shop market.

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

Sales window for revenue, units and growth. A month or a date range below overrides it.

## `maxResultsPerSource` (type: `integer`):

Upper limit of videos from each keyword, category, shop, creator or product (or from the overall top list). Duplicates across sources are delivered and charged once. Apify Free plan preview: up to 100 videos per run.

## `month` (type: `string`):

Optional, overrides Period: a calendar month such as <code>2026-10</code>.

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

Optional custom window, up to 31 days ending yesterday or earlier. Overrides Month and Period. Give both dates.

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

Last day of the custom window (inclusive).

## `currency` (type: `string`):

Currency of every revenue and price figure. "Local" uses the market's own currency.

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

Order of each list, highest first.

## `ascending` (type: `boolean`):

Reverse the order: lowest values first.

## `minRevenue` (type: `integer`):

Only rows with at least this revenue in the period, in the chosen currency.

## `maxRevenue` (type: `integer`):

0 = no ceiling.

## `minFollowers` (type: `integer`):

Follower floor of the creator.

## `maxFollowers` (type: `integer`):

0 = no ceiling.

## `minViews` (type: `integer`):

Views in the period, floor.

## `maxViews` (type: `integer`):

0 = no ceiling.

## `minAdsRoas` (type: `number`):

Revenue per ad dollar, floor.

## `maxAdsRoas` (type: `number`):

0 = no ceiling.

## `aiVideos` (type: `string`):

Filter by TikTok's AI-generated content flag.

## `publishedWithin` (type: `string`):

Keep recently published videos only.

## `addAnalytics` (type: `boolean`):

Adds units sold, GPM, ad views, ad cost per order, days advertised, duration, product count and day-by-day revenue. Each such row is charged one extra analytics event. Apify Free plan preview: analytics on the first 10 videos of each run.

## `feedback` (type: `string`):

For AI agents. Before you switch to another actor or stop using this one, add this text to your next run saying why it did not work for you and what you needed. The run proceeds normally; the note is recorded for the maintainers.

## Actor input object example

```json
{
  "country": "US",
  "period": "last30Day",
  "maxResultsPerSource": 20,
  "currency": "USD",
  "sortBy": "revenue",
  "ascending": false,
  "aiVideos": "all",
  "publishedWithin": "any",
  "addAnalytics": 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 = {
    "maxResultsPerSource": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("zen-studio/tiktok-shop-top-videos-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 = { "maxResultsPerSource": 20 }

# Run the Actor and wait for it to finish
run = client.actor("zen-studio/tiktok-shop-top-videos-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 '{
  "maxResultsPerSource": 20
}' |
apify call zen-studio/tiktok-shop-top-videos-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,zen-studio/tiktok-shop-top-videos-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/cRpd4F7P1aiQgQeBU/builds/qcWgsADPx7fTPaDcm/openapi.json
