# Tiktok Trending Videos Scraper (`lexis-solutions/tiktok-trending-videos-scraper`) Actor

Discover trending TikTok videos with a powerful API 📈. Effortlessly extract data for competition monitoring, market research, and trend analysis. Enhance engagement by analyzing popular trends and content within your niche and country.

- **URL**: https://apify.com/lexis-solutions/tiktok-trending-videos-scraper.md
- **Developed by:** [Lexis Solutions](https://apify.com/lexis-solutions) (community)
- **Categories:** Social media, Videos
- **Stats:** 752 total users, 13 monthly users, 100.0% runs succeeded, 62 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $2.93 / 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 Trending Videos Scraper

![banner](https://lexis-solutions-apify.fra1.cdn.digitaloceanspaces.com/banners/tiktok-trends.png)

Discover what resonates on TikTok and enhance your engagement with your audience.

### What is TikTok Trending Videos Scraper?

TikTok Trending Videos Scraper collects **trending** TikTok videos for a **country** you choose. You set the **sort order** (video views, engagement rate, or 6-second view-through rate), **time window** (last 7 or 30 days), and optional caps—no profile URLs are required.

> ⚠️ **Session cookies (optional but recommended):** Without an authenticated session, TikTok only returns the top few public trending videos. To scrape the full list (up to 100), provide your TikTok Creative Center session cookies in the **Session Cookies** input. Cookies expire periodically — when a run reports an invalid or expired session, re-export and update them.
>
> **How to obtain your cookies:**
>
> 1. Install the [**Cookie-Editor** Chrome extension](https://chromewebstore.google.com/detail/cookie-editor/hlkenndednhfkekhgcdicdfddnkalmdm).
> 2. Go to [ads.tiktok.com](https://ads.tiktok.com) and log in.
> 3. Open the **Cookie-Editor** extension and **export your cookies** in **JSON format**.
> 4. Copy the exported cookie data and **paste it into the "Session Cookies" input** field.

[TikTok Trending Videos Tutorial: Scrape Viral TikTok Content Automatically with Apify](https://youtu.be/BiVVoHQbCW4)

### What TikTok videos data can I extract?

With this TikTok API, you will be able to extract the following data from TikTok videos:

- **Item ID:** Unique ID of the video.
- **Item URL:** Direct link to the video on TikTok.
- **Cover Image:** Thumbnail of the video.
- **Video URL:** Direct (expiring) video link.
- **Video Title:** Title/caption of the video.
- **Author:** Handle, nickname, avatar, bio, and follower count of the creator.
- **Engagement Metrics:** Video views, organic video views, engagement rate, and 6-second view-through rate (for the selected period and lifetime).
- **Top Comments:** Optional — the video's most-liked comments (when detailed data is enabled).

and more!

### Why scrape TikTok videos?

- **Competition Monitoring:** Identify what successful videos are doing right, or wrong, and how you can improve your content strategy.

- **Market Research:** Analyze popular trends and content within your niche and country

- **Data-Driven Strategy:** Use the extracted data to inform your content and marketing strategy.

- **Trend Analysis:** Monitor trends and brand sentiment, using the data to make informed decisions.

### How do I use TikTok Trending Videos Scraper?

TikTok Trending Videos Scraper is designed to be user-friendly, even if you've never extracted data from the web before. Here's how you can scrape TikTok data with this tool:

1. **Create a free Apify account** using your email.
2. **Open TikTok Trending Videos Scraper**.
3. **Choose the input parameters** you want to use.
4. **Click "Start"** and wait for the data to be extracted.
5. **Download your data** in JSON, XML, CSV, Excel, or HTML format.

### 📥 Input

The actor does **not** take TikTok profile or video URLs. You pass a **country code**, **sort order**, **period**, and optional limits—see the fields below.

| Field | Description |
| --- | --- |
| `countryCode` | Region for trending videos. TikTok currently publishes a trending videos list only for `US`, `JP`, `VN`, `TH`, and `ID`. Required. |
| `sortBy` | How to rank results: `views` (video views), `engagement` (engagement rate), or `vtr` (6-second view-through rate). |
| `period` | `7` = last 7 days, `30` = last 30 days. |
| `maxItems` | Maximum videos to collect (default in the schema: `3`; up to `100`). |
| `includeDetailedVideoData` | If `true`, fetches each video's top comments in addition to the list data; slower (one extra request per video). |
| `cookies` | Optional TikTok Creative Center session cookies (JSON export). Required to unlock the full list. |
| `proxyConfiguration` | Optional Apify Proxy settings. |

Example JSON:

```json
{
  "countryCode": "US",
  "sortBy": "views",
  "maxItems": 100,
  "period": "7",
  "includeDetailedVideoData": false,
  "cookies": [{ "name": "sessionid", "value": "<your-session-value>" }]
}
```

`includeDetailedVideoData` (optional) fetches each video's top comments. Enabling it makes the run slower as it performs an extra request per video.

### 📤 Output

The results will be wrapped into a dataset which you can find in the Storage tab. Here's an excerpt from the dataset you'd get if you apply the input parameters above:

```json
[
  {
    "id": "7649219659287334158",
    "item_id": "7649219659287334158",
    "item_url": "https://www.tiktok.com/@emilysentner/video/7649219659287334158",
    "title": "he's loving it #loveisland",
    "cover": "https://p16-common-sign.tiktokcdn-us.com/...tplv-tiktokx-origin.image?...",
    "video_url": "https://v16m-default.tiktokcdn-us.com/...",
    "content_type": 1,
    "create_time": 1780972749,
    "rank": 1,
    "country_code": "US",
    "region": "United States",
    "period": "7",
    "sort_by": "views",
    "author": {
      "id": "7065438769372987398",
      "handle": "emilysentner",
      "nickname": "Emily",
      "avatar": "https://p19-common-sign.tiktokcdn-us.com/...",
      "bio": "24 | NC",
      "followers": 1195250
    },
    "video_views": 55083015,
    "video_views_lifetime": 157573458,
    "organic_video_views": 9559044,
    "organic_video_views_lifetime": 30591250,
    "engagement_rate": 0.006171,
    "engagement_rate_lifetime": 0.009213,
    "six_seconds_vtr": 0.05298,
    "six_seconds_vtr_lifetime": 0.055773,
    "top_comments": [],
    "videoUrl": "https://v16m-default.tiktokcdn-us.com/...",
    "duration": null,
    "likes": null,
    "comments": null,
    "bookmarks": null,
    "shares": null
  }
]
```

When `includeDetailedVideoData` is `true`, each item's `top_comments` array is populated with the video's top comments, for example:

```json
{
  "top_comments": [
    {
      "id": "7653564531784778527",
      "text": "How do people watch this show",
      "likes": 38,
      "create_time": 1781984406,
      "user_id": "7043554351084651526",
      "user_name": "Yoboi Chauncey",
      "user_avatar": "https://sf16-passport-va.ibytedtos.com/..."
    }
  ]
}
```

You can choose in which format to download your TikTok data: CSV, Excel spreadsheet, JSON, JSONL, HTML table, or XML.

***

For further assistance, feel free to reach out to our support team or consult the [Apify documentation](https://docs.apify.com). Happy scraping!

### Why use TikTok Trending Videos Scraper?

- ⚡️ **Fast** - Collects trending lists efficiently for the country and filters you choose.

- 🤙 **Easy to use** - No coding required: pick country, sort order, and period in the input form and start the run.

- ☑️ **Well-Maintained** - Maintained by the Lexis Solutions team so it stays compatible with TikTok’s trending surfaces.

### FAQ

- **How to find trending videos on TikTok?**

  To find trending videos on TikTok, you can use the TikTok Trending Videos Scraper. You choose a **country**, **sort order** (video views, engagement rate, or 6-second view-through rate), and **time window** (7 or 30 days).

- **Is there a trending videos API for TikTok?**

  Currently, there is no official API for TikTok trending videos. However, you can use the TikTok Trending Videos Scraper to extract data from trending videos on TikTok.

- **How to scrape TikTok videos data?**

  To scrape trending TikTok video data, use TikTok Trending Videos Scraper on Apify: set **country**, **sortBy**, **period**, and **maxItems** (and optional **includeDetailedVideoData**), then start the actor.

- **Is scraping TikTok data legal?**

  Scraping TikTok data is legal as long as you comply with TikTok's terms of service. Make sure to read and understand TikTok's terms of service before scraping any data.

- **How much does it cost?**
  The cost for using the TikTok Trending Videos Scraper is shown on the top of this page. You can also check the Apify Store page for more information.

### Need to scrape more trends on TikTok?

👉 [TikTok Trending Creators API/Scraper](https://apify.com/lexis-solutions/tiktok-trending-creators-scraper)

👉 [TikTok Trending Songs API/Scraper](https://apify.com/lexis-solutions/tiktok-trending-songs-scraper)

👉 [TikTok Trending Hashtags API/Scraper](https://apify.com/lexis-solutions/tiktok-trending-hashtags-scraper)

***

👀 p.s.

Got feedback or need an extension?

Lexis Solutions is a [certified Apify Partner](https://apify.com/partners/find). We can help you with custom solutions or data extraction projects.

Contact us over [Email](mailto:scraping@lexis.solutions) or [LinkedIn](https://www.linkedin.com/company/lexis-solutions)

### Support Our Work 💝

If you're happy with our work and scrapers, you're welcome to leave us a company review [here](https://apify.com/partners/find/lexis-solutions/review) and leave a review for the scrapers you're subscribed to. It will take you less than a minute but it will mean a lot to us!

# Actor input Schema

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

Country code to scrape. TikTok Creative Center currently publishes a trending videos list only for these markets.

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

Metric used to rank the trending videos

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

Period to scrape

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

Maximum number of videos to scrape. TikTok Creative Center shows a maximum of 100 videos for each search.

## `includeDetailedVideoData` (type: `boolean`):

If enabled, the scraper fetches each video's top comments in addition to the list data. This makes the run slower as it performs an extra request per video.

## `cookies` (type: `array`):

Required to get the full trending list — without a logged-in session TikTok only returns the top few public videos.

1. Install the Cookie-Editor browser extension.
2. Go to https://ads.tiktok.com and log in.
3. Open the Cookie-Editor extension and export cookies as JSON.
4. Paste the exported cookie contents here.

Cookies expire periodically and must be re-exported when a run reports an invalid session.

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

Apify proxy settings.

## Actor input object example

```json
{
  "countryCode": "US",
  "sortBy": "views",
  "period": "7",
  "maxItems": 3,
  "includeDetailedVideoData": false,
  "cookies": [],
  "proxyConfiguration": {
    "useApifyProxy": false,
    "apifyProxyGroups": []
  }
}
```

# Actor output Schema

## `overview` (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 = {
    "countryCode": "US",
    "sortBy": "views",
    "period": "7",
    "cookies": []
};

// Run the Actor and wait for it to finish
const run = await client.actor("lexis-solutions/tiktok-trending-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 = {
    "countryCode": "US",
    "sortBy": "views",
    "period": "7",
    "cookies": [],
}

# Run the Actor and wait for it to finish
run = client.actor("lexis-solutions/tiktok-trending-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 '{
  "countryCode": "US",
  "sortBy": "views",
  "period": "7",
  "cookies": []
}' |
apify call lexis-solutions/tiktok-trending-videos-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,lexis-solutions/tiktok-trending-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/zKZGQORXyyBBeJtdg/builds/0lDQJ30CJs8o33UU0/openapi.json
