mcpField
S
scraping-tiktok-user-data

scraping-tiktok-user-data

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

About scraping-tiktok-user-data

A data skill that exports a TikTok creator’s video history with engagement metrics for each video. It complements account-level profile data with video-level details and uses the Apify user scraper.

Key features

  1. 01TikTok creator video-history export
  2. 02Per-video views and engagement metrics
  3. 03Profile or video URL input
  4. 04JSON dataset retrieval

Use cases

  1. 01Reviewing a creator’s video performance
  2. 02Building a video-level engagement dataset

MCP support

Can run the Apify TikTok user scraper through the optional Apify MCP server.

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/apidojo-io/apidojo-skills --skill scraping-tiktok-user-data

After installing, type/scraping-tiktok-user-datain Claude Code to confirm it loaded.

Details

From the project README

Scraping TikTok User Data

Exports a creator's full video history with per-video engagement metrics. Complements scraping-tiktok-profile-data (account-level) with video-level detail.

Prerequisites

  • APIFY_TOKEN environment variable set
  • Optional: Apify MCP server installed

Inputs

ParameterTypeRequiredDefaultNotes
startUrlsarray✅[]TikTok profile URLs or video URLs (extracts author from videos)
getFollowersbooleanOptionalfalseAlso extract complete follower lists
getFollowingbooleanOptionalfalseAlso extract complete following lists
maxItemsnumberOptionalUnlimitedMaximum users to return
customMapFunctionstringOptional—JavaScript function to transform each output object

Workflow

Progress:
- [ ] Step 1: Run tiktok-user-scraper
- [ ] Step 2: Poll for SUCCEEDED
- [ ] Step 3: Deliver video dataset
Step 1: Run the Actor

Recommended — run_actor.js (handles waiting, output, and file saving automatically):

# Quick answer (prints table to chat)
node scripts/run_actor.js \
  --actor "apidojo~tiktok-user-scraper" \
  --input '{"param": "value"}'

# Save as CSV
node scripts/run_actor.js \
  --actor "apidojo~tiktok-user-scraper" \
  --input '{"param": "value"}' \
  --output YYYY-MM-DD_results.csv --format csv

# Save as JSON
node scripts/run_actor.js \
  --actor "apidojo~tiktok-user-scraper" \
  --input '{"param": "value"}' \
  --output YYYY-MM-DD_results.json --format json

APIFY_TOKEN must be set in environment or .env file.

If Apify MCP is available:

Tool: apify:run-actor
Actor: "apidojo~tiktok-user-scraper"
Input:
{
  "username": "<handle>",
  "maxVideos": 50
}

REST API fallback:

curl -X POST \
  "https://api.apify.com/v2/acts/apidojo~tiktok-user-scraper/runs?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"username": "<handle>", "maxVideos": 50}'

Save id as RUN_ID. Poll until status = SUCCEEDED:

curl "https://api.apify.com/v2/actor-runs/$RUN_ID?token=$APIFY_TOKEN" | grep '"status"'

Fetch results:

curl "https://api.apify.com/v2/actor-runs/$RUN_ID/dataset/items?token=$APIFY_TOKEN&format=json"
Step 2: Handle Edge Cases
  • Private account: Returns 0 videos. Inform user.
  • Account with < requested videos: Return all available; note count in output.
  • Deleted videos in feed: Skip entries with missing playCount fields.

Output Format

# TikTok Video History: @<username>
Videos collected: N

| Video ID | Caption (truncated) | Views | Likes | Comments | Shares | Duration | Posted |
|----------|---------------------|-------|-------|----------|--------|----------|--------|
| ...      | ...                 | ...   | ...   | ...      | ...    | ...      | ...    |

Available fields: videoId, desc, playCount, diggCount, commentCount, shareCount,
duration, createTime, videoUrl, musicTitle, hashtags

Troubleshooting

0 videos returned: Account is private or username incorrect. Pay-per-result billing: This actor uses pay-per-result pricing — set maxVideos to control cost.

Comments

Markdown supported