# Tiktok Trending Scraper (`xtracto/tiktok-trending-scraper`) Actor

Discover TikTok trends in real time hashtags, creators, viral videos, and music across 70+ countries with fast HTTP-only extraction - no login or proxy required

- **URL**: https://apify.com/xtracto/tiktok-trending-scraper.md
- **Developed by:** [Farhan Febrian Nauval](https://apify.com/xtracto) (community)
- **Categories:** Lead generation, Social media, Other
- **Stats:** 95 total users, 32 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.75 / 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.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## 📈 TikTok Trending Scraper

Get **trending videos** from TikTok's Explore feed, with optional region targeting. Ranked output, ready for content research, marketing analysis, and creator discovery — without an account.

> **Heads up — TikTok-side deprecation (2026-Q1).** TikTok turned off the public Hashtag, Creator, and Music trending feeds at the source. Those modes are kept in the actor for backwards compatibility but now return a single deprecation record so you know what happened. **Video trending still works** and is the recommended default.

### ✨ Why Use This Actor?

- 🚀 **Real-time trending videos** — ranked by TikTok's Explore engine
- 🌍 **Region-aware** — surface what's trending in a specific country
- 💰 **Cheap & fast** — HTTP-only, no browser, ~2 seconds per page
- ✅ **No login, no API key** — fully anonymous, no account setup
- 📊 **Stable JSON output** — ready for pipelines, databases, BI tools
- 🔁 **Up to 500 videos per run** with paginated fetching

### 🎯 Use Cases

- **Content research** — see what's trending before producing a video
- **Marketing intelligence** — track viral creators and formats in your niche
- **Influencer discovery** — find creators riding the current trend wave
- **Competitive benchmarking** — see which video styles dominate per country
- **Academic / research** — study cross-region trending patterns over time

### 📥 Input

| Field | Type | Default | Description |
|-------|------|---------|-------------|
| `content_type` | string | `"video"` | `"video"` is the only currently-working mode. `"hashtag"`, `"creator"`, `"music"` are kept for backwards compatibility but TikTok deprecated them — they return a single deprecation record. |
| `country_code` | string | `"US"` | ISO country code (e.g. `US`, `ID`, `GB`, `JP`, `BR`, `DE`). Leave empty for global. |
| `period` | string | `"7"` | Trending window in days (`7`, `30`, `120`). Currently used only by the deprecated modes; ignored for video. |
| `industry_id` | string | *(empty)* | Industry filter for hashtag mode only — see table below. |
| `sort_by` | string | `"popular"` | Hashtag: `popular` / `rise`. Creator: `follower` / `engagement` / `avg_views`. Ignored for video. |
| `limit` | integer | `20` | Max results to return. Video: 1–500. |

#### Example input

```json
{
    "content_type": "video",
    "country_code": "US",
    "limit": 20
}
```

### 📤 Output

Each record is a raw TikTok video object plus the envelope meta fields. **No field renaming** — what TikTok sends is what you get.

| Field | Type | Description |
|-------|------|-------------|
| `id` | string | Video ID |
| `desc` | string | Video caption |
| `author` | object | Creator info (`uniqueId`, `nickname`, `avatarThumb`, `verified`, …) |
| `stats` | object | Engagement metrics (`playCount`, `diggCount`, `commentCount`, `shareCount`, `collectCount`) |
| `video` | object | Media URLs (`playAddr`, `downloadAddr`, `cover`, `originCover`, `duration`, `width`, `height`) |
| `music` | object | Sound info (`id`, `title`, `authorName`, `playUrl`) |
| `challenges` | array | Hashtags attached to the video |
| `_rank` | integer | Rank position (1 = most trending) |
| `_source` | string | `"S1-explore-api"` (video) or `"S1-cc-api"` (legacy modes) |
| `_input` | object | The input parameters used for this run |
| `_scrapedAt` | string | UTC ISO 8601 timestamp |

#### Example output (video, abridged)

```json
{
  "_input": {
    "content_type": "video",
    "country_code": "US",
    "period": 7,
    "industry_id": "",
    "sort_by": "popular"
  },
  "_source": "S1-explore-api",
  "_scrapedAt": "2026-06-02T13:48:01Z",
  "_rank": 1,
  "id": "7637369500161084692",
  "desc": "Jangan asal murah, cek dulu kualitas ayam yang kamu beli! 🚨🐔",
  "createTime": 1762000000,
  "author": {
    "id": "7117389664750683162",
    "uniqueId": "snapfactsss1",
    "nickname": "Snap Facts",
    "verified": false
  },
  "stats": {
    "playCount": 8000000,
    "diggCount": 1200000,
    "commentCount": 3400,
    "shareCount": 12000,
    "collectCount": 45000
  },
  "video": {
    "duration": 21,
    "cover": "https://p16-sign-va.tiktokcdn.com/...",
    "playAddr": "https://v16-webapp-prime.tiktok.com/...",
    "width": 1080,
    "height": 1920
  },
  "music": {
    "title": "original sound - Snap Facts",
    "authorName": "snapfactsss1"
  }
}
```

#### Deprecation record (hashtag / creator / music)

When you select a deprecated content type, the dataset receives one record explaining why:

```json
{
  "_input": { "content_type": "hashtag", "country_code": "US", "period": 7, "sort_by": "popular" },
  "_source": "none",
  "_scrapedAt": "2026-06-02T13:48:01Z",
  "_warning": "endpoint_deprecated",
  "_warningDetail": "TikTok's Creative Center backend returns data=null for content_type='hashtag'. The endpoint is server-side deprecated as of 2026-Q1. Use content_type='video' for the only currently-working trending feed."
}
```

This is intentional: a failing/deprecated input should not silently produce an empty dataset — that's indistinguishable from "no trends found".

### 🛠️ How It Works

1. You give the actor a `content_type` and optional region/filters.
2. The actor warms a session, fetches the trending feed from TikTok, and paginates until your `limit` is reached.
3. Results stream into your dataset with rank position and envelope metadata.

You don't need to manage browsers, accounts, proxies, or session cookies — none of that is required for the public trending feed.

### ⚠️ Known Limits

- **Hashtag / Creator / Music modes**: TikTok deprecated the underlying Creative Center endpoints at the source. The actor returns one informative record instead of pretending to work. We'll restore those modes if TikTok brings the endpoints back.
- **Region filter on video**: TikTok serves the same Explore feed globally with mild regional re-ranking. Setting `country_code` biases results but won't return an entirely different list.
- **Rate**: One request per ~0.5 s by default. The Explore API tolerates this without rate-limiting from datacenter IPs.

### 🔗 Other TikTok Actors in This Suite

- **TikTok Comments Extractor** — comments + nested replies for any video
- **TikTok Post Detail Scraper** — full per-video metadata (download URLs, music, stats)
- **TikTok Profile + Posts Scraper** — profile info + a user's most recent posts in one call
- **TikTok Search Scraper** — search videos by keyword or hashtag
- **TikTok Top Ads Scraper** — top-performing ads from Creative Center's Top Ads dashboard

# Actor input Schema

## `content_type` (type: `string`):

What kind of trending content to scrape. ⚠️ As of 2026-Q1, TikTok deprecated the Hashtag, Creator, and Music endpoints server-side — those modes now emit a single deprecation record. Use 'Videos' for the only currently-working trending feed.

## `country_code` (type: `string`):

ISO country code to filter by region. Leave empty for global. Examples: US, GB, ID, JP, BR, DE, FR, KR, MX, AU.

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

Trending window in days. Used by hashtag/creator/music modes. Ignored for video.

## `industry_id` (type: `string`):

Filter hashtag trends by industry. Leave empty for all. Examples: 22000000000 (Apparel), 28000000000 (Sports & Outdoor), 14000000000 (Food & Beverage), 13000000000 (Financial Services), 17000000000 (Travel).

## `sort_by` (type: `string`):

Hashtag: 'popular' or 'rise'. Creator: 'follower', 'engagement', or 'avg\_views'. Defaults to 'popular' for hashtag and 'follower' for creator. Ignored for video and music.

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

Maximum number of items to return. Video: up to 500. Hashtag/Creator: up to 100. Music: up to 99.

## Actor input object example

```json
{
  "content_type": "video",
  "country_code": "US",
  "period": "7",
  "industry_id": "",
  "sort_by": "popular",
  "limit": 20
}
```

# 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 = {
    "country_code": "US"
};

// Run the Actor and wait for it to finish
const run = await client.actor("xtracto/tiktok-trending-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 = { "country_code": "US" }

# Run the Actor and wait for it to finish
run = client.actor("xtracto/tiktok-trending-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "country_code": "US"
}' |
apify call xtracto/tiktok-trending-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=xtracto/tiktok-trending-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/acts/HTShF9nQB5KtEKoOy/builds/Pf1426N0AmHNifpnK/openapi.json
