# TikTok Music/Sound Scraper (`crawlerbros/tiktok-music-scraper`) Actor

Scrape TikTok music/sound metadata and the posts that use a particular sound. Input music URLs or IDs. No cookies required.

- **URL**: https://apify.com/crawlerbros/tiktok-music-scraper.md
- **Developed by:** [Crawler Bros](https://apify.com/crawlerbros) (community)
- **Categories:** Automation, Social media, Videos
- **Stats:** 2 total users, 1 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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 Music Scraper

Scrape TikTok sound and music pages to collect track metadata and the full list of videos that use a given sound. Accepts music page URLs or bare numeric IDs and returns a metadata row per sound followed by post rows for every video using that sound. No login or cookies required.

### What this actor does

- Accepts TikTok music page URLs or raw numeric sound IDs as input
- Emits a metadata row per sound with title, author, duration, cover images, video count, copyright flags, and DSP streaming links (Spotify, Apple Music, etc.)
- Paginates the sound's video list and emits a post row for each video using the sound
- Captures full post metadata: caption, author profile, engagement stats, hashtags, and video details
- Supports toggling metadata rows and post rows independently so you can fetch just stats or just videos
- Empty fields are omitted

### Output per music metadata record

- `rowType` — always `"music"`
- `musicId` — unique TikTok sound ID
- `musicTitle` — sound/track title
- `authorName` — creator display name
- `duration` — duration in seconds
- `isCopyrighted` — whether the sound has a copyright restriction
- `isCommerceMusic` — whether this is a licensed commercial track
- `isOriginal` — whether this is a user-created original sound
- `videoCount` — total videos using this sound on TikTok
- `playUrl` — streamable audio URL (expires)
- `coverLarge` — large cover image URL
- `coverMedium` — medium cover image URL
- `album` — album name (when present, for commercial tracks)
- `tt2dsp` — object with links to Spotify, Apple Music, and other streaming platforms (when present)
- `author.id` — creator's TikTok user ID
- `author.username` — creator handle
- `author.displayName` — creator display name
- `author.verified` — verification status
- `author.avatarUrl` — creator profile image URL
- `author.followerCount` — creator follower count
- `shareMeta.title` — share title text
- `shareMeta.desc` — share description text
- `scrapedAt` — ISO 8601 timestamp of when the record was collected

### Output per post record

- `rowType` — always `"post"`
- `matchedMusicId` — the sound ID this video is associated with
- `postId` — unique TikTok video ID
- `postUrl` — direct URL to the video
- `caption` — full caption text
- `likeCount` — total likes
- `commentCount` — total comments
- `shareCount` — total shares
- `playCount` — total plays/views
- `author.id` — author's TikTok user ID
- `author.username` — author handle
- `author.displayName` — author display name
- `author.verified` — verification status
- `author.avatarUrl` — author profile image URL
- `hashtags` — array of hashtag names parsed from caption
- `scrapedAt` — ISO 8601 timestamp of when the record was collected

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `musicUrls` | string[] | — | TikTok music page URLs. Example: `https://www.tiktok.com/music/original-sound-7595604258835401494` |
| `musicIds` | string[] | — | Bare numeric sound IDs (15–20 digits). Alternative to full URLs. |
| `maxPostsPerSound` | integer | 30 | Maximum videos to collect per sound (0–500). Set to 0 to skip post rows. |
| `includeMusicMetadata` | boolean | `true` | Emit a metadata row per sound with title, stats, cover images, and DSP links. |
| `includePosts` | boolean | `true` | Emit post rows for videos using each sound. |

#### Example: single sound by URL

```json
{
  "musicUrls": ["https://www.tiktok.com/music/original-sound-7595604258835401494"],
  "maxPostsPerSound": 30,
  "includeMusicMetadata": true,
  "includePosts": true
}
````

#### Example: multiple sounds by ID

```json
{
  "musicIds": ["7595604258835401494", "7234567890123456789"],
  "maxPostsPerSound": 50,
  "includeMusicMetadata": true,
  "includePosts": true
}
```

#### Example: metadata-only (no video scraping)

```json
{
  "musicIds": ["7595604258835401494"],
  "includeMusicMetadata": true,
  "includePosts": false
}
```

#### Example: large-scale video collection for a viral sound

```json
{
  "musicUrls": ["https://www.tiktok.com/music/original-sound-7595604258835401494"],
  "maxPostsPerSound": 500,
  "includeMusicMetadata": false,
  "includePosts": true
}
```

### Use cases

- **Music labels and A\&R teams** tracking how often a track is being used on TikTok and which creators are driving virality
- **Content marketers** identifying trending sounds to incorporate into brand video campaigns
- **UGC researchers** collecting all videos using a specific sound for trend analysis or sentiment studies
- **Podcast and media teams** monitoring original sounds tied to news events or cultural moments
- **Influencer platforms** discovering creators building audiences around a particular music niche
- **Rights management teams** auditing the spread of copyrighted audio across user-generated content

### FAQ

**Q: Do I need a TikTok account, login, or cookies?**\
A: No. The actor uses TikTok's public music API without authentication.

**Q: How do I find a sound's numeric ID?**\
A: Open any TikTok music page in a browser. The URL format is `/music/sound-name-XXXXXXXXXXXXXXXXX` — the final numeric segment is the ID. You can pass the full URL or just the ID.

**Q: How many videos can I collect per sound?**\
A: Up to 500 per sound. TikTok returns approximately 30 videos per page and the actor paginates automatically.

**Q: Do video and audio play URLs expire?**\
A: Yes. TikTok signs all media CDN URLs with a short-lived token. Download or cache media within a few hours of scraping. The `mediaUrlExpiresAt` field indicates when signed URLs expire.

**Q: What are the DSP links in `tt2dsp`?**\
A: DSP stands for Digital Service Provider. These are links to Spotify, Apple Music, and similar streaming platforms. They only appear for licensed commercial tracks; user-created original sounds do not have DSP links.

**Q: Can I get only the sound stats without scraping videos?**\
A: Yes. Set `includePosts: false` and `includeMusicMetadata: true` to get only the metadata row for each sound.

**Q: What does `isOriginal` mean?**\
A: When `isOriginal` is `true`, the sound was recorded by a TikTok user rather than uploaded from a commercial music catalog.

### Related TikTok Scrapers

Build a complete TikTok data pipeline with our full suite:

| Scraper | URL |
|---|---|
| TikTok Post Scraper | https://apify.com/crawlerbros/tiktok-post-scraper |
| TikTok Profile Scraper | https://apify.com/crawlerbros/tiktok-profile-scraper |
| TikTok Comments Scraper | https://apify.com/crawlerbros/tiktok-comments-scraper |
| TikTok Search Scraper | https://apify.com/crawlerbros/tiktok-search-scraper |
| TikTok Hashtag Scraper | https://apify.com/crawlerbros/tiktok-hashtag-scraper |
| TikTok Transcript Scraper | https://apify.com/crawlerbros/tiktok-transcript-scraper |
| TikTok Followers Scraper | https://apify.com/crawlerbros/tiktok-followers-scraper |
| TikTok Mention Scraper | https://apify.com/crawlerbros/tiktok-mention-scraper |
| TikTok Profile Mention Scraper | https://apify.com/crawlerbros/tiktok-profile-mention-scraper |
| TikTok Playlist Scraper | https://apify.com/crawlerbros/tiktok-playlist-scraper |
| TikTok Explore Scraper | https://apify.com/crawlerbros/tiktok-explore-scraper |
| TikTok For You Scraper | https://apify.com/crawlerbros/tiktok-for-you-scraper |
| TikTok Downloader | https://apify.com/crawlerbros/tiktok-downloader-api |
| TikTok Ads Library Scraper | https://apify.com/crawlerbros/tiktok-ads-library-scraper-pro |
| TikTok Top Ads Scraper | https://apify.com/crawlerbros/tiktok-top-ads-scraper |
| TikTok Hashtag Trends Scraper | https://apify.com/crawlerbros/tiktok-hashtag-trends-scraper |
| TikTok LIVE Scraper | https://apify.com/crawlerbros/tiktok-live-scraper |

# Actor input Schema

## `musicUrls` (type: `array`):

TikTok music page URLs. Example: https://www.tiktok.com/music/original-sound-7653138974420077343

## `musicIds` (type: `array`):

Numeric TikTok music/sound IDs as strings (15–20 digits). Alternative to providing full URLs.

## `maxPostsPerSound` (type: `integer`):

Maximum number of video posts to scrape per music/sound. Set to 0 to skip post scraping (equivalent to includePosts: false).

## `includeMusicMetadata` (type: `boolean`):

Emit a metadata row for each music/sound with title, author, duration, cover images, DSP links, and video count.

## `includePosts` (type: `boolean`):

Emit post rows for videos that use each sound. Posts include full video metadata, author info, and engagement stats.

## Actor input object example

```json
{
  "musicUrls": [
    "https://www.tiktok.com/music/original-sound-7595604258835401494"
  ],
  "musicIds": [
    "7595604258835401494"
  ],
  "maxPostsPerSound": 5,
  "includeMusicMetadata": true,
  "includePosts": true
}
```

# Actor output Schema

## `data` (type: `string`):

Dataset containing music metadata rows (rowType='music') and/or post rows (rowType absent). Use the 'rowType' field to distinguish: music rows have musicTitle, videoCount, coverLarge; post rows have postId, caption, likeCount.

# 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 = {
    "musicUrls": [
        "https://www.tiktok.com/music/original-sound-7595604258835401494"
    ],
    "musicIds": [
        "7595604258835401494"
    ],
    "maxPostsPerSound": 5,
    "includeMusicMetadata": true,
    "includePosts": true
};

// Run the Actor and wait for it to finish
const run = await client.actor("crawlerbros/tiktok-music-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 = {
    "musicUrls": ["https://www.tiktok.com/music/original-sound-7595604258835401494"],
    "musicIds": ["7595604258835401494"],
    "maxPostsPerSound": 5,
    "includeMusicMetadata": True,
    "includePosts": True,
}

# Run the Actor and wait for it to finish
run = client.actor("crawlerbros/tiktok-music-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 '{
  "musicUrls": [
    "https://www.tiktok.com/music/original-sound-7595604258835401494"
  ],
  "musicIds": [
    "7595604258835401494"
  ],
  "maxPostsPerSound": 5,
  "includeMusicMetadata": true,
  "includePosts": true
}' |
apify call crawlerbros/tiktok-music-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "TikTok Music/Sound Scraper",
        "description": "Scrape TikTok music/sound metadata and the posts that use a particular sound. Input music URLs or IDs. No cookies required.",
        "version": "1.0",
        "x-build-id": "hMhaVFxHtC0iSWDyZ"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/crawlerbros~tiktok-music-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-crawlerbros-tiktok-music-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/crawlerbros~tiktok-music-scraper/runs": {
            "post": {
                "operationId": "runs-sync-crawlerbros-tiktok-music-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/crawlerbros~tiktok-music-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-crawlerbros-tiktok-music-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "musicUrls": {
                        "title": "Music/Sound URLs",
                        "type": "array",
                        "description": "TikTok music page URLs. Example: https://www.tiktok.com/music/original-sound-7653138974420077343",
                        "items": {
                            "type": "string"
                        }
                    },
                    "musicIds": {
                        "title": "Music IDs",
                        "type": "array",
                        "description": "Numeric TikTok music/sound IDs as strings (15–20 digits). Alternative to providing full URLs.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "maxPostsPerSound": {
                        "title": "Max Posts Per Sound",
                        "minimum": 0,
                        "maximum": 500,
                        "type": "integer",
                        "description": "Maximum number of video posts to scrape per music/sound. Set to 0 to skip post scraping (equivalent to includePosts: false).",
                        "default": 30
                    },
                    "includeMusicMetadata": {
                        "title": "Include Music Metadata",
                        "type": "boolean",
                        "description": "Emit a metadata row for each music/sound with title, author, duration, cover images, DSP links, and video count.",
                        "default": true
                    },
                    "includePosts": {
                        "title": "Include Posts Using This Sound",
                        "type": "boolean",
                        "description": "Emit post rows for videos that use each sound. Posts include full video metadata, author info, and engagement stats.",
                        "default": true
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
