# TikTok Trending Sounds & Chart History API (`trendingtiktoksongs/tiktok-trending-sounds-history`) Actor

Export TikTok Popular and Viral Top 50 sounds for nine countries. Get ranks, sound-use counts, music links, and available dated chart history.

- **URL**: https://apify.com/trendingtiktoksongs/tiktok-trending-sounds-history.md
- **Developed by:** [Trending TikTok Songs](https://apify.com/trendingtiktoksongs) (community)
- **Categories:** Social media, Developer tools
- **Stats:** 4 total users, 3 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 1,000 chart observations

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 Sounds & Chart History API

Export TikTok Popular and Viral Top 50 sound charts as structured JSON or CSV. Choose from nine countries and get the latest validated chart or the dated observations available in a historical range.

Each dataset item represents **one sound on one country, chart, and UTC observation date**. The Actor reads a maintained chart archive. It does not search arbitrary sounds or scrape videos by sound ID.

### Quick start: latest trending sounds

```json
{
  "mode": "latest",
  "countries": ["US"],
  "chartTypes": ["popular"],
  "maxRows": 10
}
```

This returns up to 10 sound rows from the latest **validated** US Popular chart. Each row states its actual `observation_date`; the Actor does not relabel an older chart as today's data.

### Historical TikTok music charts

```json
{
  "mode": "history",
  "countries": ["US", "JP"],
  "chartTypes": ["popular", "viral"],
  "fromDate": "2026-09-01",
  "toDate": "2026-09-25",
  "maxRows": 5000
}
```

The range is inclusive and limited to 30 calendar days per run. Historical coverage can have gaps. Check the **Coverage and missing dates** output for `available_dates` and `missing_dates` for each country and chart. The Actor never invents missing observations.

Supported countries: United States (US), Germany (DE), Brazil (BR), Japan (JP), South Korea (KR), Canada (CA), France (FR), Mexico (MX), and Turkey (TR).

### Dataset fields

Every row has the same flat fields for JSON and CSV exports:

| Field | Meaning |
| --- | --- |
| `observation_date`, `country`, `chart_type`, `rank` | UTC date and ranked chart position. |
| `sound_id`, `title`, `artist` | TikTok sound ID, title, and artist. Sound IDs are strings. |
| `usage_count` | Source-reported sound-use count, **not video views**. |
| `rank_change`, `usage_change` | Change versus the previous **adjacent UTC date**, or `null` if that date or sound is unavailable. Positive rank change means the sound climbed. |
| `previous_observation_date` | Prior validated chart date when the previous calendar day exists, otherwise `null`. |
| `is_original_sound`, `is_commerce_music` | Source flags. The commerce flag does **not** grant or establish music licensing rights. |
| `duration_seconds`, `tiktok_url`, `cover_url` | Sound length and source links where available. |
| `spotify_url`, `apple_music_url`, `youtube_music_url` | Source-provided music service links when available; otherwise `null`. |
| `source_updated_at`, `collected_at` | Source chart update time and collection time. |

Rank and usage count belong to the observation date. Title, artist, artwork, and music service links come from the current normalized sound record and may have changed since that date.

### Coverage and pricing

The run's Coverage and missing dates output reports selected countries/charts, actual available and missing dates, total available records, records written, and whether the run stopped at `maxRows` or the spending limit. A zero-result request writes no dataset items and still reports coverage.

The primary billable unit is one dataset row: one sound × country × chart × UTC date. Apify's default-dataset-item event charges for rows written to the default dataset. The displayed Actor pricing is authoritative; a start event may also apply. A complete Top 50 chart produces 50 rows. Historical gaps and spending limits can reduce the number of rows written.

For reliable automation, save an Apify Task with your preferred countries, charts, and dates, or call the Actor through the Apify API. The Actor returns stored chart observations and does not need an Apify proxy.

# Actor input Schema

## `mode` (type: `string`):

Latest validated chart or available dates in a historical range.

## `countries` (type: `array`):

Chart countries to export.

## `chartTypes` (type: `array`):

Popular, Viral, or both.

## `fromDate` (type: `string`):

Required in history mode. First calendar date to include.

## `toDate` (type: `string`):

Required in history mode. Last calendar date to include; at most 30 days including the first date.

## `maxRows` (type: `integer`):

Each result is one sound on one country/chart/date. The Try form starts with 10; if omitted, latest mode uses 50 per selected chart and history mode uses 5,000.

## Actor input object example

```json
{
  "mode": "latest",
  "countries": [
    "US"
  ],
  "chartTypes": [
    "popular"
  ],
  "maxRows": 10
}
```

# Actor output Schema

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

No description

## `coverage` (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 = {
    "maxRows": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("trendingtiktoksongs/tiktok-trending-sounds-history").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 = { "maxRows": 10 }

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

```

## MCP server setup

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

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/78nG5GZvHSCwCAwDz/builds/IcDBL5MKpZMpwlCC9/openapi.json
