mcpField
S
scraping-tiktok-posts-by-music

scraping-tiktok-posts-by-music

github.com/apidojo-ioData & databases1836 installsUpdated 24w ago
Repository

About scraping-tiktok-posts-by-music

This skill uses Apify to collect TikTok posts associated with music or sound pages for downstream analysis. Results include views, engagement, creator, hashtag, and audio data, with an option to cap the number of posts.

Key features

  1. 01Collect posts from music page URLs
  2. 02Limit the number of posts
  3. 03Retrieve views and engagement metrics
  4. 04Retrieve creators and hashtags
  5. 05Retrieve video and music details

Use cases

  1. 01Analyze posts linked to a sound
  2. 02Compare engagement across related posts
  3. 03Organize creator and hashtag data

MCP support

The Apify MCP call_actor tool can run apidojo~tiktok-music-scraper; run_actor.js and the REST API are also supported.

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/apidojo-io/apidojo-skills --skill scraping-tiktok-posts-by-music

After installing, type/scraping-tiktok-posts-by-musicin Claude Code to confirm it loaded.

Details

From the project README

Scraping Tiktok Posts By Music

Raw data collection. No assumed use case — returns the full dataset for downstream analysis.


Inputs

ParameterTypeRequiredDefaultNotes
startUrlsarray✅[]TikTok music/sound page URLs
maxItemsnumberOptionalUnlimitedMaximum posts to return
customMapFunctionstringOptional—JavaScript function to transform each output object

How to Run

Using run_actor.js (recommended)
# 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}'

# 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

# 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
REST API fallback
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 call_actor tool with actor apidojo~tiktok-music-scraper and the input above.


Output Fields

FieldTypeDescription
idstringTikTok post ID
titlestringPost caption/text
viewsnumberView count
likesnumberLike count
commentsnumberComment count
sharesnumberShare count
hashtagsarrayHashtags used in post
channel.namestringCreator display name
channel.usernamestringCreator @username
channel.verifiedbooleanVerification status
uploadedAtnumberUpload timestamp (Unix)
video.urlstringVideo file URL
video.durationnumberDuration in seconds
song.idstringSound/music ID
song.titlestringSound title
song.artiststringSound artist
song.durationnumberSound duration

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.

Comments

Markdown supported