scraping-tiktok-posts-by-music
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseScraping Tiktok Posts By Music
按音乐抓取TikTok帖子
Raw data collection. No assumed use case — returns the full dataset for downstream analysis.
原始数据收集。不预设使用场景——返回完整数据集供下游分析。
Inputs
输入参数
| Parameter | Type | Required | Default | Notes |
|---|---|---|---|---|
| array | ✅ | | TikTok music/sound page URLs |
| number | Optional | Unlimited | Maximum posts to return |
| string | Optional | — | JavaScript function to transform each output object |
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
| array | ✅ | | TikTok音乐/音效页面URL |
| number | 可选 | 无限制 | 要返回的最大帖子数量 |
| string | 可选 | — | 用于转换每个输出对象的JavaScript函数 |
How to Run
运行方法
Using run_actor.js (recommended)
使用run_actor.js(推荐)
bash
undefinedbash
undefinedQuick answer (table)
Quick answer (table)
node scripts/run_actor.js --actor "apidojo~tiktok-music-scraper" --input '{"startUrls": ["https://www.tiktok.com/music/Song-Title-123456"], "maxItems": 100}'
node scripts/run_actor.js --actor "apidojo~tiktok-music-scraper" --input '{"startUrls": ["https://www.tiktok.com/music/Song-Title-123456"], "maxItems": 100}'
Save as CSV
Save as CSV
node scripts/run_actor.js --actor "apidojo~tiktok-music-scraper" --input '{"startUrls": ["https://www.tiktok.com/music/Song-Title-123456"], "maxItems": 100}' --output results.csv --format csv
node scripts/run_actor.js --actor "apidojo~tiktok-music-scraper" --input '{"startUrls": ["https://www.tiktok.com/music/Song-Title-123456"], "maxItems": 100}' --output results.csv --format csv
Save as JSON
Save as JSON
node scripts/run_actor.js --actor "apidojo~tiktok-music-scraper" --input '{"startUrls": ["https://www.tiktok.com/music/Song-Title-123456"], "maxItems": 100}' --output results.json --format json
undefinednode scripts/run_actor.js --actor "apidojo~tiktok-music-scraper" --input '{"startUrls": ["https://www.tiktok.com/music/Song-Title-123456"], "maxItems": 100}' --output results.json --format json
undefinedREST API fallback
备用REST API
bash
curl -X POST "https://api.apify.com/v2/acts/apidojo~tiktok-music-scraper/runs" \
-H "Authorization: Bearer $APIFY_TOKEN" \
-H "Content-Type: application/json" \
-d '{"startUrls": ["https://www.tiktok.com/music/Song-Title-123456"], "maxItems": 100}'If Apify MCP is available:
Use the Apify MCP tool with actor and the input above.
call_actorapidojo~tiktok-music-scraperbash
curl -X POST "https://api.apify.com/v2/acts/apidojo~tiktok-music-scraper/runs" \
-H "Authorization: Bearer $APIFY_TOKEN" \
-H "Content-Type: application/json" \
-d '{"startUrls": ["https://www.tiktok.com/music/Song-Title-123456"], "maxItems": 100}'如果Apify MCP可用:使用Apify MCP的工具,指定actor为并传入上述输入参数。
call_actorapidojo~tiktok-music-scraperOutput Fields
输出字段
| Field | Type | Description |
|---|---|---|
| string | TikTok post ID |
| string | Post caption/text |
| number | View count |
| number | Like count |
| number | Comment count |
| number | Share count |
| array | Hashtags used in post |
| string | Creator display name |
| string | Creator @username |
| boolean | Verification status |
| number | Upload timestamp (Unix) |
| string | Video file URL |
| number | Duration in seconds |
| string | Sound/music ID |
| string | Sound title |
| string | Sound artist |
| number | Sound duration |
| 字段 | 类型 | 描述 |
|---|---|---|
| string | TikTok帖子ID |
| string | 帖子标题/文案 |
| number | 浏览量 |
| number | 点赞数 |
| number | 评论数 |
| number | 分享数 |
| array | 帖子中使用的话题标签 |
| string | 创作者显示名称 |
| string | 创作者@用户名 |
| boolean | 认证状态 |
| number | 上传时间戳(Unix格式) |
| string | 视频文件URL |
| number | 视频时长(秒) |
| string | 音效/音乐ID |
| string | 音效标题 |
| string | 音效艺术家 |
| number | 音效时长(秒) |
Edge Cases
边缘情况
- No music URL: Requires TikTok sound page URL. Tell user to find the sound on TikTok and copy the URL.
- Copyrighted sound: May have fewer results in some regions.
- Trending sound: May return thousands of posts — use maxItems to cap.
- Sound removed: Returns empty dataset.
- 无音乐URL:需要提供TikTok音效页面URL。告知用户在TikTok上找到该音效并复制其URL。
- 受版权保护的音效:在部分地区可能返回较少结果。
- 热门音效:可能返回数千条帖子——使用maxItems参数限制数量。
- 音效已移除:返回空数据集。