# Tiktok Trending Videos Insights (`codebyte/tiktok-trending-videos-insights`) Actor

Extract trending TikTok videos data by region, time period, and engagement metrics. Perfect for content creators, marketers, and researchers tracking viral content.

- **URL**: https://apify.com/codebyte/tiktok-trending-videos-insights.md
- **Developed by:** [Codebyte](https://apify.com/codebyte) (community)
- **Categories:** Videos, Social media
- **Features:** Full permissions
- **Stats:** 403 total users, 5 monthly users, 100.0% runs succeeded, 21 bookmarks
- **User rating**: 1.00 out of 5 stars

## Pricing

$1.00 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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 Insights

### 🎯 Purpose

Extract valuable insights from trending TikTok videos to power your content strategy. This actor helps you discover what's currently popular on TikTok across different regions and time periods.

### ✨ Key Features

- **Regional Filtering**: Access trending content from specific countries
- **Flexible Time Ranges**: Filter videos by different time periods (e.g., last 7 days)
- **Customizable Sorting**: Order results by:
  - Views
  - Likes
  - Comments
  - Shares
- **Bulk Data**: Retrieve up to 500 trending videos in a single run

### 💡 Use Cases

- Content creators seeking trending topics and formats
- Marketing teams researching viral content patterns
- Social media managers planning content calendars
- Brands monitoring competitor performance
- Researchers analyzing TikTok trends

### 📊 Output Data

For each trending video, you'll receive:

- Video ID and URL
- Cover image URL
- Video duration
- Video title/description
- Country/region information

For the Video URL, TikTok Creative Center returns a placeholder username @mnm_pipi.
TikTok routes video URLs based on the video ID, not the username.
The Video URL is valid and will resolve correctly but it does not contain the actual username for the video.

### 🔧 Input Configuration

Simple JSON configuration allows you to:

- Select target country
- Define time period
- Choose sorting metric
- Set result limit

### 🎯 Perfect For

- Social Media Managers
- Content Creators
- Digital Marketing Agencies
- Brand Strategists
- Market Researchers

Get data-driven insights to inform your TikTok strategy and stay ahead of trending content in your target market.

### Input

```json
{
    "country": "US",
    "period": "7",
    "order_by": "vv",
    "limit": 500
}
```

### Output

```json
[
    {
	    "country_code": "US",
	    "cover": "https://p16-sign-va.tiktokcdn.com/tos-maliva-p-0068c799-us/oAA9UFAKigdaBX64B43kZ4XiICiBRukJvUIOE~tplv-noop.image?x-expires=1736814853&x-signature=7rRK%2Becmb6DK4sIZ9zj4mF1dY2A%3D",
	    "duration": 27,
	    "id": "7458063335150374187",
	    "item_id": "7458063335150374187",
	    "item_url": "https://www.tiktok.com/@mnm_pipi/video/7458063335150374187",
	    "region": "United States",
	    "title": "#NaturesBountyPartner Supplements like this from @Nature’s Bounty and well-balanced meals are the key to optimal health! Learn more at naturesbounty.com. *These statements have not been evaluated by the Food and Drug Administration. This product is not intended to diagnose, treat, cure, or prevent any disease."
    },
    ...
]
```

![TikTok Trending Videos Insights Example Output](https://i.imghippo.com/files/qGH5834sxQ.png)

# Actor input Schema

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

Select the country for which you want to retrieve trending videos.

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

The period for which you want to retrieve trending videos.

## `order_by` (type: `string`):

The order in which the videos are retrieved.

## `limit` (type: `integer`):

The maximum number of videos to retrieve.

## Actor input object example

```json
{
  "country": "US",
  "period": "7",
  "order_by": "vv"
}
```

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("codebyte/tiktok-trending-videos-insights").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 = {}

# Run the Actor and wait for it to finish
run = client.actor("codebyte/tiktok-trending-videos-insights").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 '{}' |
apify call codebyte/tiktok-trending-videos-insights --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,codebyte/tiktok-trending-videos-insights"
        }
    }
}
```

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/an8OFVjsbtQaK2mT8/builds/JxGt0Tq1vqFyoMG3i/openapi.json
