# TikTok Trending Scraper (`axery/tiktok-trending-scraper`) Actor

Scrape trending videos from TikTok Explore feed with country targeting, engagement metrics, author info & media links. Fast HTTP-only, no login or proxy.

- **URL**: https://apify.com/axery/tiktok-trending-scraper.md
- **Developed by:** [Axery](https://apify.com/axery) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.75 / 1,000 trending video 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/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 Scraper

Discover and scrape **real-time trending videos** from TikTok's Explore feed with optional region/country targeting. Get ranked viral content, creator profiles, engagement metrics, sounds, and media URLs — without logging in or using expensive headless browsers.

***

### ✨ Features

- 🚀 **Real-time Trending Videos**: Extracted directly from TikTok's Explore feed engine.
- 🌍 **Region & Country Targeting**: Surface what's viral in specific countries (e.g., `US`, `ID`, `GB`, `JP`, `BR`, `DE`, `FR`, etc.) or global.
- ⚡ **Super Fast & Lightweight**: Pure HTTP-only extraction (~0.5s per batch), no slow browser emulation.
- 🛡️ **No Login or API Key Required**: Fully anonymous, zero setup or credentials needed.
- 📊 **Complete Engagement Stats**: Plays, likes (diggs), comments, shares, saves (collects), and duration.
- 🎬 **Rich Media & Audio Data**: High-res covers, direct playback URLs, and background sound/music metadata.
- 🔁 **Paginated Scraping**: Fetch from 1 up to 500 trending videos per run with rank numbering.

***

### 🎯 Use Cases

- **Content & Viral Research**: Spot viral sounds, memes, and hooks before creating your next campaign.
- **Competitor & Market Intelligence**: Analyze video styles, durations, and creator formats that dominate per country.
- **Influencer & Creator Discovery**: Find fast-growing creators riding the current algorithm wave.
- **Automated Social Dashboards**: Ingest daily trending feeds directly into BI tools, Google Sheets, or databases.

***

### 📥 Input Parameters

| Field | Type | Default | Description |
|---|---|---|---|
| `content_type` | `string` | `"video"` | Mode: `"video"` (real-time Explore feed). Legacy modes (`"hashtag"`, `"creator"`, `"music"`) return an informative deprecation notice as TikTok discontinued them at the source in 2026-Q1. |
| `country_code` | `string` | `"US"` | 2-letter ISO country code (e.g. `US`, `ID`, `GB`, `JP`, `BR`, `DE`, `FR`). Leave empty for global trending. |
| `limit` | `integer` | `20` | Maximum number of items to return (1 to 500). |
| `period` | `string` | `"7"` | Trending window in days (`7`, `30`, `120`). Kept for legacy compatibility. |
| `industry_id` | `string` | `""` | Optional industry filter ID for hashtag mode. |
| `sort_by` | `string` | `"popular"` | Sort criteria (`popular` or `rise`). |
| `proxyConfiguration` | `object` | `{"useApifyProxy": false}` | Optional Apify proxy settings. |

#### Example Input

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

***

### 📤 Output Structure

Each item returned in the dataset represents a trending video ranked by TikTok's algorithm:

```json
{
  "_input": {
    "content_type": "video",
    "country_code": "US",
    "limit": 20
  },
  "_source": "S1-explore-api",
  "_scrapedAt": "2026-10-21T01:48:09Z",
  "_rank": 1,
  "id": "7696513215093558546",
  "desc": "Check out this amazing viral video! #trending #fyp",
  "createTime": 1792400000,
  "author": {
    "id": "7117389664750683162",
    "uniqueId": "viralcreator",
    "nickname": "Viral Creator",
    "verified": false,
    "avatarThumb": "https://p16-sign-va.tiktokcdn.com/..."
  },
  "stats": {
    "playCount": 18700000,
    "diggCount": 1300000,
    "commentCount": 3255,
    "shareCount": 55300,
    "collectCount": 19700
  },
  "video": {
    "duration": 28,
    "width": 1080,
    "height": 1920,
    "cover": "https://p16-sign-va.tiktokcdn.com/...",
    "playAddr": "https://v16-webapp-prime.tiktok.com/..."
  },
  "music": {
    "id": "7117389664750683999",
    "title": "Original Sound - Viral Creator",
    "authorName": "viralcreator",
    "playUrl": "https://sf16-ies-music-va.tiktokcdn.com/..."
  }
}
```

***

### 💻 Integration Examples

#### Python (`apify-client`)

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_API_TOKEN>")

run_input = {
    "content_type": "video",
    "country_code": "US",
    "limit": 20
}

run = client.actor("axery/tiktok-trending-scraper").call(run_input=run_input)

for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(f"#{item['_rank']} @{item['author']['uniqueId']}: {item['stats']['playCount']:,} plays")
```

#### Node.js (`apify-client`)

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

const input = {
    content_type: 'video',
    country_code: 'US',
    limit: 20
};

const run = await client.actor('axery/tiktok-trending-scraper').call(input);
const { items } = await client.dataset(run.defaultDatasetId).listItems();

console.log(`Fetched ${items.length} trending videos.`);
```

***

### ⚡ Performance & Reliability

- **High Success Rate**: Employs browser TLS fingerprint impersonation to prevent bot blocking.
- **Low Compute Cost**: Consumes minimal compute units (0.001 CU per run) due to asynchronous HTTP fetching.
- **Graceful Deprecation Handling**: If deprecated modes (`hashtag`, `creator`, `music`) are requested, returns an explicit diagnostic message instead of an ambiguous empty dataset.

# Actor input Schema

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

What kind of trending content to scrape. As of 2026-Q1, TikTok deprecated Hashtag, Creator, and Music feeds server-side at the source — those modes emit an informative deprecation record. Use 'Videos' for real-time trending feed.

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

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

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

Maximum number of items to return (1-500).

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

Trending window in days. Kept for backwards compatibility; 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). Kept for legacy compatibility.

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

Hashtag: 'popular' or 'rise'. Creator: 'follower', 'engagement', or 'avg_views'. Defaults to 'popular'. Ignored for video and music.

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

Optional proxy settings. By default, HTTP-only extraction works directly without proxies.

## Actor input object example

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

# Actor output Schema

## `videos` (type: `string`):

Rank, caption, creator, plays, likes, comments, shares, saves, and duration.

## `items` (type: `string`):

Every record with all fields including rank, author info, engagement stats, music, and media URLs.

# 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("axery/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 = {}

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

```

## MCP server setup

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