# TikTok Music Videos Scraper (`alien_force/tiktok-music-videos-scraper`) Actor

Scrape all public TikTok videos that use a given music/sound URL. Get captions, stats, covers, author profiles, and music details with pagination and proxy support.

- **URL**: https://apify.com/alien\_force/tiktok-music-videos-scraper.md
- **Developed by:** [Alien Force](https://apify.com/alien_force) (community)
- **Stats:** 2 total users, 1 monthly users, 50.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 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 Music Videos Scraper

### Overview

The **TikTok Music Videos Scraper** collects public videos that use a given TikTok music / sound. Paste one or more music page URLs and get structured rows with video stats, caption, author, and music details.

#### Key Features

- **Music URL input**: Accepts TikTok music / sound page URLs (the numeric ID in the URL is enough).
- **Video metadata and stats**: Caption, create time, duration, cover, views, likes, comments, shares, and saves.
- **Author details**: Username, display name, avatar, verified flag, and profile URL.
- **Music details**: Title, author, duration, and whether the sound is original.
- **Pagination**: Walks through all available videos for each sound, or stops at your max limit.
- **Exact counts**: Prefers precise count values when TikTok provides them.
- **Proxy support**: Datacenter proxies by default; switch to residential if TikTok starts blocking.
- **Fast and lightweight**: Built for quick, low-cost runs without a browser.

***

### Input Schema

#### Input Properties

1. **`startUrls`**

   - **Type**: `array`
   - **Description**: TikTok music / sound page URLs.
   - **Example**:
     ```json
     [
         { "url": "https://www.tiktok.com/music/original-sound-7660478815075912465" }
     ]
     ```

2. **`limit`**

   - **Type**: `integer`
   - **Description**: Maximum number of videos to scrape **per music URL**. Set to `0` for no limit. Default is `50`.
   - **Example**: `100`

3. **`proxyConfiguration`**

   - **Type**: `object`
   - **Description**: Proxy settings for the run. Apify Proxy datacenter IPs are used by default. If TikTok starts returning empty results, switch to the `RESIDENTIAL` group.
   - **Example**:
     ```json
     { "useApifyProxy": true }
     ```

#### Input Example

```json
{
    "startUrls": [
        {
            "url": "https://www.tiktok.com/music/original-sound-7660478815075912465"
        }
    ],
    "limit": 100,
    "proxyConfiguration": {
        "useApifyProxy": true
    }
}
```

***

### Output

One dataset row per video.

| Field | Type | Description |
| --- | --- | --- |
| `inputUrl` | string | Music URL as given in the input |
| `musicUrl` | string | Music URL (keeps the slug from input when provided) |
| `musicId` | string | Music / sound ID |
| `musicTitle` | string | Music title |
| `musicAuthorName` | string | Music author / creator |
| `musicDuration` | integer | Music duration in seconds |
| `musicOriginal` | boolean | Whether this is an original sound |
| `videoId` | string | Video ID |
| `videoUrl` | string | Canonical video URL |
| `description` | string | Video caption |
| `createTime` | integer | Video creation time (Unix timestamp, seconds) |
| `duration` | integer | Video duration in seconds |
| `cover` | string | Cover image URL |
| `playCount` | integer | Views |
| `diggCount` | integer | Likes |
| `commentCount` | integer | Comments |
| `shareCount` | integer | Shares |
| `collectCount` | integer | Saves |
| `authorId` | string | Author user ID |
| `authorUsername` | string | Author username |
| `authorNickname` | string | Author display name |
| `authorAvatar` | string | Author avatar URL |
| `authorVerified` | boolean | Verified author |
| `authorProfileUrl` | string | Author profile URL |
| `scrapedAt` | string | When the video was scraped |

#### Output Example

```json
{
    "inputUrl": "https://www.tiktok.com/music/original-sound-7660478815075912465",
    "musicUrl": "https://www.tiktok.com/music/original-sound-7660478815075912465",
    "musicId": "7660478815075912465",
    "musicTitle": "الصوت الأصلي",
    "musicAuthorName": "tomouro",
    "musicDuration": 293,
    "musicOriginal": true,
    "videoId": "7675241138294525191",
    "videoUrl": "https://www.tiktok.com/@keiyi_motovlogs/video/7675241138294525191",
    "description": "Por qué la gente lo pide, Parte 1 del video completo😛#fyp #motovlog",
    "createTime": 1787031341,
    "duration": 121,
    "cover": "https://...",
    "playCount": 123700000,
    "diggCount": 10200000,
    "commentCount": 84100,
    "shareCount": 594800,
    "collectCount": 539510,
    "authorId": "6726268700528624646",
    "authorUsername": "keiyi_motovlogs",
    "authorNickname": "Keiyi_Motovlogs",
    "authorAvatar": "https://...",
    "authorVerified": false,
    "authorProfileUrl": "https://www.tiktok.com/@keiyi_motovlogs",
    "scrapedAt": "2026-09-18T19:00:00.000Z"
}
```

#### Handling of missing and blocked inputs

Inputs that yield no videos are kept out of the dataset and reported in the **`RUN_REPORT`** record in the run's key-value store, alongside a warning in the log. Each entry lists the original `input`, the resolved `musicId` and `musicUrl`, a `reason` (`empty`, `invalidInput`, or `requestFailed`), and a human-readable `message`.

- **Music with no public videos**: skipped as `empty`.
- **Input without a usable music ID**: skipped as `invalidInput`. If *no* input yields a music ID, the run fails with an input error.
- **Blocked request**: automatically retried. If every retry fails before any video is saved, the input is skipped as `requestFailed`. A run where *all* targets were blocked fails with a clear message. If some videos were already saved, the run keeps those rows and only logs a warning.

The run's status message always reports how many videos were scraped and how many inputs were skipped.

# Actor input Schema

## `startUrls` (type: `array`):

TikTok music / sound page URLs, for example https://www.tiktok.com/music/Wolf-Ticket-7674469540130916390?lang=en

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

Maximum number of videos to scrape for each music URL. Leave empty or set to 0 for no limit.

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

Select proxies to be used by your crawler. Datacenter proxies are used by default; switch to RESIDENTIAL if TikTok starts blocking requests.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://www.tiktok.com/music/Wolf-Ticket-7674469540130916390?lang=en"
    }
  ],
  "limit": 50,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# 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 = {
    "startUrls": [
        {
            "url": "https://www.tiktok.com/music/Wolf-Ticket-7674469540130916390?lang=en"
        }
    ],
    "limit": 50,
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("alien_force/tiktok-music-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 = {
    "startUrls": [{ "url": "https://www.tiktok.com/music/Wolf-Ticket-7674469540130916390?lang=en" }],
    "limit": 50,
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("alien_force/tiktok-music-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 '{
  "startUrls": [
    {
      "url": "https://www.tiktok.com/music/Wolf-Ticket-7674469540130916390?lang=en"
    }
  ],
  "limit": 50,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call alien_force/tiktok-music-videos-scraper --silent --output-dataset

```

## MCP server setup

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