# TikTok Trends Scraper (`kaix/tiktok-trends-scraper`) Actor

Scrape the videos that trend on TikTok now and the top videos of any hashtag. Each hashtag also comes with its video count and view count. Each video comes with its hashtags, author, music, video details, and stats (views, likes, comments, shares, saves).

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

## Pricing

from $0.08 / 1,000 videos

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 Trends Scraper - Trending Videos and Hashtag Analytics

Get the videos that trend on TikTok now, and the top videos of any hashtag, with
their stats. Every video is one item in the Dataset: description, hashtags,
creation time, author with follower counts, music, video details, and counts of
views, likes, comments, shares, and saves. Every hashtag that you add also gives
one item with its video count and its view count.

Run it with no input to get a fresh sample of trending videos in about half a
minute. Add hashtag URLs to compare hashtags and to read their top videos.

### Use cases

#### Trend monitoring

See what is popular on TikTok right now: which videos, creators, sounds, and
hashtags. Run the same input on an Apify schedule and compare the runs.

```json
{
  "resultsLimit": 100
}
```

Use `videoId`, `desc`, `hashtags`, `music.title`, `author.uniqueId`,
`stats.views`, `stats.likes`, and `stats.shares`.

#### Hashtag analytics

Compare how big hashtags are. Each hashtag gives one item with its video count
and view count.

```json
{
  "hashtagUrls": [
    "https://www.tiktok.com/tag/space",
    "https://www.tiktok.com/tag/astronomy"
  ],
  "resultsLimit": 20
}
```

Filter the Dataset on `type` equal to `hashtag`. Use `name`, `stats.videos`, and
`stats.views`.

#### Content research for a niche

Read the top videos of a hashtag, and see which creators, sounds, and
co-occurring hashtags go with it.

```json
{
  "hashtagUrls": ["https://www.tiktok.com/tag/space"],
  "resultsLimit": 150
}
```

Use `author.uniqueId`, `author.followers`, `desc`, `hashtags`, `music.title`,
`stats.views`, and `stats.likes`.

#### Sound and creator discovery

Find the sounds and creators in the trending videos. Sort by `stats.views`, or
count how often a `music.id` or an `author.uniqueId` appears.

Use `music.id`, `music.title`, `author.uniqueId`, `author.followers`, and
`stats.views`.

#### Growth tracking

Run a hashtag on an Apify schedule. Watch `stats.videos` and `stats.views` on
the hashtag item to see how fast the hashtag grows. Join the video items of the
runs on `videoId`, and watch `stats.views`, `stats.likes`, and `stats.shares`
move over time.

### Choose what to collect

| Starting point                | Input                       | Use it for                            |
| ----------------------------- | --------------------------- | ------------------------------------- |
| The trending videos           | No input                    | A sample of what trends now           |
| Fewer or more trending videos | `resultsLimit`              | Keep a run short, or read more        |
| One or more hashtags          | `hashtagUrls`               | The hashtag counts and the top videos |
| Trending videos and hashtags  | `hashtagUrls` and the limit | Both in one run                       |

The trending videos are always read first. To keep only hashtag data, filter the
Dataset on `source` equal to `hashtag`, or on `type` equal to `hashtag`.

### What each item includes

- Video: ID, URL, description and its language, creation time, hashtags,
  mentions, and effects
- Video details: duration, size in pixels, format, bitrate, and cover links
- Author: handle, display name, bio, verified flag, avatar link, and follower,
  following, like, and video counts
- Stats: views, likes, comments, shares, saves, and reposts
- Music: ID, title, author, album, duration, and links
- Flags: ad, and whether duets, stitches, and sharing are on
- Photo posts: the image links
- Source: `explore` for a trending video, `hashtag` for a hashtag video, and the
  hashtag URL from your input
- Position: the `rank` of a video among the videos of its hashtag
- Hashtag item: ID, name, description, video count, view count, and image link

### Read the trending videos

Run the Actor with an empty input, or set `resultsLimit`:

```json
{
  "resultsLimit": 100
}
```

The Actor saves up to 100 trending videos. The default is 50. The highest value
is 1000.

The trending videos are a sample that TikTok picks. It changes from run to run,
and it is not a ranking. A trending video has `rank` set to `null` for this
reason. Two runs a few minutes apart share some videos and differ in others.

### Read the videos of hashtags

Add hashtag URLs:

```json
{
  "hashtagUrls": ["https://www.tiktok.com/tag/space"],
  "resultsLimit": 30
}
```

For each hashtag, the Actor saves one hashtag item, then up to 30 videos. A
hashtag URL looks like `https://www.tiktok.com/tag/<name>`.

The `rank` of a hashtag video is its position among the videos of the hashtag,
starting at 1. TikTok sets this order. It is not the order of views or of time.

A hashtag gives about 140 to 175 videos. A higher `resultsLimit` does not give
more videos for a hashtag.

### How results are ordered and limited

**Order.** The Actor saves the trending videos first. It then handles
`hashtagUrls` in input order. For each hashtag, the hashtag item comes first,
then the videos of the hashtag in `rank` order. An error item goes to the Errors
dataset.

**Limit.** `resultsLimit` applies to the trending videos and to each hashtag, not
to the complete run. The Actor stops at exactly that number of videos. The
hashtag items do not count.

**Same video twice.** A video appears once in one source. It can appear again in
another source: the trending videos and a hashtag, or two hashtags. Its `source`
and `inputUrl` tell you the source. The same URL twice in `hashtagUrls` is read
once.

### Input

All input fields are optional. An empty input reads the trending videos.

<details>
<summary>Complete input example</summary>

This example uses every input field.

```json
{
  "hashtagUrls": [
    "https://www.tiktok.com/tag/space",
    "https://www.tiktok.com/tag/astronomy"
  ],
  "resultsLimit": 50,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

</details>

#### Input reference

| Parameter              | Type               | Default                  | Effect                                                                                  |
| ---------------------- | ------------------ | ------------------------ | --------------------------------------------------------------------------------------- |
| **hashtagUrls**        | string\[]           | empty                    | TikTok hashtag URLs. The Actor saves a hashtag item and the top videos of each hashtag. |
| **resultsLimit**       | integer, 1 to 1000 | `50`                     | Upper limit on saved videos for the trending videos and for each hashtag.               |
| **proxyConfiguration** | object             | `{"useApifyProxy":true}` | Connection settings for the run. Keep the default.                                      |

- A hashtag URL looks like `https://www.tiktok.com/tag/<name>`. An entry that is
  not a hashtag URL gives an error item. The other entries are still read.
- A `resultsLimit` below 1 or above 1000 stops the run before collection. The
  message names the problem.
- Unknown input fields are ignored.

### Output

Each Dataset item is one video or one hashtag. A source that the Actor could not
read gives one error item in the Errors dataset, not in the Dataset. The field
`type` says `video` or `hashtag`. Every documented video field is present in every video item.
A value that is not available is `null`, an empty list, or `0` for a count. The
fields `author`, `stats`, `music`, and `video` are objects.

#### Sample video

This is a trending video. The links are removed. It is not a saved Dataset item.

<details>
<summary>Open the video JSON</summary>

```json
{
  "type": "video",
  "source": "explore",
  "inputUrl": null,
  "rank": null,
  "videoId": "7701970319132724500",
  "videoUrl": "https://www.tiktok.com/@themarshmallowco/video/7701970319132724500",
  "desc": "Who can scoop the MOST Marshmallow with their weak hand? 😅 #marshmallow #candy #satisfying #smallbusiness #challenge #fyp",
  "descLanguage": "en",
  "createTime": "1793260800",
  "locationCreated": null,
  "categories": [],
  "hashtags": [
    "marshmallow",
    "candy",
    "satisfying",
    "smallbusiness",
    "challenge",
    "fyp"
  ],
  "mentions": [],
  "effects": ["Real blond"],
  "isAd": false,
  "isAiGenerated": null,
  "isPinned": null,
  "duetEnabled": true,
  "stitchEnabled": true,
  "shareEnabled": true,
  "captionLanguages": ["eng-US"],
  "images": [],
  "video": {
    "duration": 38,
    "width": 1080,
    "height": 1920,
    "ratio": "1080p",
    "definition": "1080p",
    "format": "mp4",
    "codec": "h264",
    "bitrate": 1906409,
    "size": 9179601,
    "cover": "[link removed]",
    "originCover": "[link removed]",
    "dynamicCover": "[link removed]"
  },
  "author": {
    "id": "6773121564491105286",
    "uniqueId": "themarshmallowco",
    "nickname": "The Marshmallow Co.",
    "verified": true,
    "signature": "Handcrafted Gourmet Marshmallows ☁️ \nMade in🇦🇺 Ship to AUS, US, + more! Shop👇",
    "createTime": null,
    "private": false,
    "seller": null,
    "avatar": "[link removed]",
    "followers": 1700000,
    "following": 81,
    "likes": 44600000,
    "videos": 889,
    "likesGiven": 417
  },
  "stats": {
    "views": 3600000,
    "likes": 98400,
    "comments": 97,
    "shares": 786,
    "saves": 2047,
    "reposts": 0
  },
  "music": {
    "id": "7701970376885390081",
    "title": "original sound - The Marshmallow Co.",
    "author": "The Marshmallow Co.",
    "album": null,
    "duration": 38,
    "playUrl": "[link removed]",
    "cover": "[link removed]"
  }
}
```

A video of a hashtag has the same fields. Its `source` is `hashtag`, its
`inputUrl` is the hashtag URL from your input, and its `rank` is a number.

</details>

#### Sample hashtag

The link is removed. It is not a saved Dataset item.

<details>
<summary>Open the hashtag JSON</summary>

```json
{
  "type": "hashtag",
  "inputUrl": "https://www.tiktok.com/tag/space",
  "hashtagId": "12827",
  "name": "space",
  "desc": "Look to the stars and tell us what you see.",
  "isCommerce": false,
  "image": "[link removed]",
  "stats": {
    "videos": 3497724,
    "views": 96243507211
  }
}
```

</details>

#### Field reference

| Field              | Type and contents                                                                            |
| ------------------ | -------------------------------------------------------------------------------------------- |
| `type`             | string. `video` for a video item.                                                            |
| `source`           | string. `explore` for a trending video, `hashtag` for a video of a hashtag.                  |
| `inputUrl`         | string or `null`. The hashtag URL from your input. `null` for a trending video.              |
| `rank`             | number or `null`. The position among the videos of the hashtag, from 1. `null` for trending. |
| `videoId`          | string. The video ID.                                                                        |
| `videoUrl`         | string. The link to the video.                                                               |
| `desc`             | string. The description. It is empty when the video has none.                                |
| `descLanguage`     | string or `null`. The language code of the description, such as `en`.                        |
| `createTime`       | string or `null`. The creation time in Unix seconds, such as `"1793260800"`.                 |
| `locationCreated`  | string or `null`. Always `null` in this Actor.                                               |
| `categories`       | string\[]. Always empty in this Actor.                                                        |
| `hashtags`         | string\[]. The hashtags of the description, without `#`.                                      |
| `mentions`         | string\[]. The accounts that the description mentions, without `@`.                           |
| `effects`          | string\[]. The names of the effects that the video uses.                                      |
| `isAd`             | boolean or `null`. `true` for a paid ad.                                                     |
| `isAiGenerated`    | boolean or `null`. Always `null` in this Actor.                                              |
| `isPinned`         | boolean or `null`. Always `null` in this Actor.                                              |
| `duetEnabled`      | boolean or `null`. Whether other users can make a duet with the video.                       |
| `stitchEnabled`    | boolean or `null`. Whether other users can stitch the video.                                 |
| `shareEnabled`     | boolean or `null`. Whether the video can be shared.                                          |
| `captionLanguages` | string\[]. The caption languages that the video offers, such as `eng-US`.                     |
| `images`           | string\[]. The image links of a photo post. Empty for a video.                                |

**`video`**

| Field                | Type and contents                                            |
| -------------------- | ------------------------------------------------------------ |
| `video.duration`     | number. The duration in seconds. It is `0` for a photo post. |
| `video.width`        | number or `null`. The width in pixels.                       |
| `video.height`       | number or `null`. The height in pixels.                      |
| `video.ratio`        | string or `null`. The resolution label, such as `1080p`.     |
| `video.definition`   | string or `null`. The quality label, such as `1080p`.        |
| `video.format`       | string or `null`. The file format, such as `mp4`.            |
| `video.codec`        | string or `null`. The video codec, such as `h264`.           |
| `video.bitrate`      | number or `null`. The bitrate in bits per second.            |
| `video.size`         | number or `null`. The file size in bytes.                    |
| `video.cover`        | string or `null`. A link to the cover image.                 |
| `video.originCover`  | string or `null`. A link to the original cover image.        |
| `video.dynamicCover` | string or `null`. A link to the animated cover.              |

**`author`**

| Field               | Type and contents                                                |
| ------------------- | ---------------------------------------------------------------- |
| `author.id`         | string. The account ID.                                          |
| `author.uniqueId`   | string. The handle, without `@`.                                 |
| `author.nickname`   | string. The display name.                                        |
| `author.verified`   | boolean or `null`. Whether the account is verified.              |
| `author.signature`  | string or `null`. The bio.                                       |
| `author.createTime` | string or `null`. Always `null` in this Actor.                   |
| `author.private`    | boolean or `null`. Whether the account is private.               |
| `author.seller`     | boolean or `null`. Always `null` in this Actor.                  |
| `author.avatar`     | string or `null`. A link to the avatar image.                    |
| `author.followers`  | number or `null`. The follower count.                            |
| `author.following`  | number or `null`. The count of accounts that the author follows. |
| `author.likes`      | number or `null`. The total likes that the account received.     |
| `author.videos`     | number or `null`. The video count of the account.                |
| `author.likesGiven` | number or `null`. The count of videos that the account liked.    |

**`stats`**

| Field            | Type and contents                               |
| ---------------- | ----------------------------------------------- |
| `stats.views`    | number. The play count.                         |
| `stats.likes`    | number. The like count.                         |
| `stats.comments` | number. The comment count.                      |
| `stats.shares`   | number. The share count.                        |
| `stats.saves`    | number. The count of users who saved the video. |
| `stats.reposts`  | number. The repost count.                       |

**`music`**

| Field            | Type and contents                                    |
| ---------------- | ---------------------------------------------------- |
| `music.id`       | string or `null`. The sound ID.                      |
| `music.title`    | string or `null`. The sound title.                   |
| `music.author`   | string or `null`. The name of the sound author.      |
| `music.album`    | string or `null`. The album, when the sound has one. |
| `music.duration` | number or `null`. The duration in seconds.           |
| `music.playUrl`  | string or `null`. A link to the audio file.          |
| `music.cover`    | string or `null`. A link to the sound cover image.   |

- The values in `stats` are the values at the time of the run. They change over
  time.
- TikTok rounds large counts, such as `followers` of `1700000`.
- Image and audio links expire after about two days. Download the files soon
  after the run if you need them.

#### Hashtag fields

| Field          | Type and contents                                                                      |
| -------------- | -------------------------------------------------------------------------------------- |
| `type`         | string. `hashtag` for a hashtag item.                                                  |
| `inputUrl`     | string. The hashtag URL from your input.                                               |
| `hashtagId`    | string. The hashtag ID.                                                                |
| `name`         | string. The hashtag, without `#`.                                                      |
| `desc`         | string. The description of the hashtag. It is empty when the hashtag has none.         |
| `isCommerce`   | boolean or `null`. Whether TikTok marks the hashtag as a commerce hashtag.             |
| `image`        | string or `null`. A link to the hashtag image. It is `null` when the hashtag has none. |
| `stats.videos` | number or `null`. The number of videos with the hashtag.                               |
| `stats.views`  | number or `null`. The total views of the videos with the hashtag.                      |

- `stats.videos` and `stats.views` are the figures that TikTok shows for the
  hashtag. They do not have to match the number of videos that the hashtag
  gives. One test hashtag showed 96 videos and gave 141.
- The hashtag item comes before the videos of the hashtag.

#### Which fields are empty for which input

These video fields are always empty in this Actor: `locationCreated`,
`categories`, `isAiGenerated`, `isPinned`, `author.createTime`, and
`author.seller`. The Actor still saves them. Each value is `null` or an empty list.
Other fields can still be empty for one video, for example when the video has no
captions.

The trending videos and the hashtag videos have the same fields. Only these
fields differ:

| Field      | Trending videos | Hashtag videos |
| ---------- | --------------- | -------------- |
| `source`   | `explore`       | `hashtag`      |
| `inputUrl` | `null`          | Hashtag URL    |
| `rank`     | `null`          | From 1         |

#### Error items

A source that the Actor cannot read gives one error item in the Errors dataset.
The Dataset holds only videos and hashtags. The run goes on with the next
source.

```json
{
  "inputUrl": "https://www.tiktok.com/tag/zzznosuchtag84726153",
  "error": "The hashtag does not exist or is not available.",
  "errorCode": "HASHTAG_UNAVAILABLE"
}
```

An error item has three fields:

| Field       | Type and contents                                                            |
| ----------- | ---------------------------------------------------------------------------- |
| `inputUrl`  | string or `null`. The entry from your input. `null` for the trending videos. |
| `error`     | string. A short sentence that says what went wrong.                          |
| `errorCode` | string. One of the codes below.                                              |

| `errorCode`           | Meaning                                                                            |
| --------------------- | ---------------------------------------------------------------------------------- |
| `NOT_A_HASHTAG_URL`   | The entry of `hashtagUrls` is not a hashtag URL.                                   |
| `HASHTAG_UNAVAILABLE` | The hashtag does not exist or is not available.                                    |
| `READ_FAILED`         | The trending videos or the videos of a hashtag could not be read. Try again later. |

### Limits and field notes

#### How many videos can I collect?

`resultsLimit` is an upper limit for the trending videos and for each hashtag, not
a required result count. The Actor can save fewer videos.

- The trending videos are a sample that changes between runs. `resultsLimit`
  goes up to 1000.
- A hashtag gives about 140 to 175 videos. In our tests, one hashtag gave 150
  videos and another 141. A hashtag with a large video count still gives about
  140 to 175 videos.

#### How long does a run take?

These times are from our tests. Times can differ from run to run.

| Run                                                     | Time              |
| ------------------------------------------------------- | ----------------- |
| The trending videos with the default limit of 50        | about 30 s        |
| 150 trending videos and one hashtag of 150 videos       | about 80 s        |
| A hashtag that does not exist, with 1 trending video    | about 20 s        |
| 1000 trending videos and two hashtags of about 150 each | about 2.5 minutes |

A source that cannot be read at all takes longer: about 1.5 minutes for the
trending videos and about 3 minutes for a hashtag in our tests.

#### Are the trending videos always the same?

No. TikTok picks them, and they change from run to run. Use `createTime` to see
the age of each video, and `stats.views` to sort them.

#### Are the hashtag videos recent?

Not always. TikTok picks the videos of a hashtag, and many of them are old.

#### Which videos are available?

The Actor reads public data only. Private accounts and age-gated videos are not
available.

#### Why are some fields empty?

Not every video has every field, and some fields are always empty in this
Actor. The Actor still saves the video. See
[Which fields are empty for which input](#which-fields-are-empty-for-which-input).

#### What happens when a source fails?

The Actor gives an error item, writes a warning to the log, and continues with
the next source. The items that it already saved stay in the Dataset.

If nothing at all can be read, the run fails with the message "No video could be
read. Check the input and try again." The error items stay in the Errors dataset.
Invalid input also fails the run with a message that names the problem.

#### Can a video disappear after I collect it?

Yes. A creator can delete a video or make it private at any time. Compare runs
of the same input to find the videos that are gone.

### Similar Actors

- [TikTok Video Comments Scraper](https://apify.com/kaix/tiktok-comments-scraper).
  The comments of TikTok videos, with replies and video stats.
- [TikTok Shop Scraper](https://apify.com/kaix/tiktok-shop-scraper). TikTok Shop
  product, seller, offer, delivery, and review data.
- [Instagram Scraper](https://apify.com/kaix/instagram-scraper). Public
  Instagram profiles, posts, reels, comments, and places.
- [YouTube Scraper](https://apify.com/kaix/youtube-scraper). YouTube videos,
  channels, playlists, comments, captions, and live chat.

# Actor input Schema

## `hashtagUrls` (type: `array`):

Optional list of TikTok hashtag URLs, for example https://www.tiktok.com/tag/space. Each hashtag gives one hashtag item with its video count and view count, then its top videos. The trending videos are always included. Leave the list empty to get only the trending videos.

## `resultsLimit` (type: `integer`):

Maximum number of videos to save from the trending list and from each hashtag. A hashtag list holds about 170 videos, so a higher number gives no more videos for a hashtag.

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

Connection settings. The default works for most runs.

## Actor input object example

```json
{
  "hashtagUrls": [
    "https://www.tiktok.com/tag/space"
  ],
  "resultsLimit": 50,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

No description

## `errors` (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 = {
    "hashtagUrls": [
        "https://www.tiktok.com/tag/space"
    ],
    "resultsLimit": 50,
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("kaix/tiktok-trends-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 = {
    "hashtagUrls": ["https://www.tiktok.com/tag/space"],
    "resultsLimit": 50,
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("kaix/tiktok-trends-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 '{
  "hashtagUrls": [
    "https://www.tiktok.com/tag/space"
  ],
  "resultsLimit": 50,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call kaix/tiktok-trends-scraper --silent --output-dataset

```

## MCP server setup

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