Skip to main content
skill CX Codex

scraping-tiktok-user-data — Claude Code skill: how to install

Scrapes a TikTok creator's video history and engagement metrics through Apify. Built for auditing competitor feeds and collecting view counts or comments.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add apidojo-io/apidojo-skills --skill scraping-tiktok-user-data -a claude-code
Open on GitHub

What scraping-tiktok-user-data does

The skill queries the apidojo/tiktok-user-scraper actor on Apify to extract video history from a profile link. It collects individual video metrics such as views, likes, comments, shares, duration, and hashtags.

Execution happens through run_actor.js, the Apify MCP server, or standard curl calls. Datasets can be saved directly as CSV or JSON files. The scraper can also pull follower and following lists when needed.

You must configure the APIFY_TOKEN environment variable before running it. The actor uses pay-per-result pricing. Pass maxVideos to control API expenses. Private accounts always return zero videos.

What it helps with

  • extract video history and engagement stats from a TikTok profile
  • export TikTok post metrics directly to CSV or JSON files
  • track view counts and comment totals across a creator feed
  • retrieve follower and following lists for a given handle

Example prompts for the agent

  • Fetch the latest 50 videos from TikTok user @creator and save the metrics to a CSV file
  • Scrape all posts and view counts for this TikTok profile URL

How to install scraping-tiktok-user-data

1Skills CLI (Vercel)

npx skills add apidojo-io/apidojo-skills --skill scraping-tiktok-user-data -a claude-code

2Manually: put the files in place

~/.claude/skills/scraping-tiktok-user-data/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/scraping-tiktok-user-data/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about scraping-tiktok-user-data

How do I install scraping-tiktok-user-data in Claude Code?

Run npx skills add apidojo-io/apidojo-skills --skill scraping-tiktok-user-data -a claude-code. The skill file installs to ~/.claude/skills/scraping-tiktok-user-data/SKILL.md.

What does scraping-tiktok-user-data do?

It runs the apidojo/tiktok-user-scraper actor on Apify to gather a creator's video feed alongside engagement metrics for every post.

What setup is required before scraping?

Set the APIFY_TOKEN environment variable. To avoid extra costs under Apify pay-per-result billing, set the maxVideos parameter.

Source text

SKILL.md · Apache-2.0
---
name: scraping-tiktok-user-data
description: >
  Scrapes detailed TikTok user data and recent video history using apidojo's TikTok User
  scraper on Apify. Triggers when the user asks to: get all videos from a TikTok account,
  fetch a TikTok creator's recent posts and stats, export a TikTok user's video history,
  scrape all TikTok content from a specific creator, get TikTok post data by username,
  or collect video-level metrics from a TikTok profile. Returns per-video view count,
  likes, comments, shares, captions, and timestamps for a given account.
  Ideal for creator analysis, content auditing, and competitive benchmarking.
license: Apache-2.0
metadata:
  author: apidojo
  version: "1.0"
  apify-actor: apidojo/tiktok-user-scraper
---

# 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

| Parameter | Type | Required | Default | Notes |
|-----------|------|----------|---------|-------|
| `startUrls` | array | ✅ | `[]` | TikTok profile URLs or video URLs (extracts author from videos) |
| `getFollowers` | boolean | Optional | `false` | Also extract complete follower lists |
| `getFollowing` | boolean | Optional | `false` | Also extract complete following lists |
| `maxItems` | number | Optional | Unlimited | Maximum users to return |
| `customMapFunction` | string | Optional | — | 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):**
```bash
# 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:**
```bash
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`:
```bash
curl "https://api.apify.com/v2/actor-runs/$RUN_ID?token=$APIFY_TOKEN" | grep '"status"'
```

Fetch results:
```bash
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.

© apidojo · Apache-2.0 · apidojo-io/apidojo-skills

Similar skills

All skills for Browser and scraping →

From the same set96

extracting-google-paa-questions-for-seo Pulls Google People Also Ask questions for SEO planning, then sorts them by intent and turns the findings into a usable content outline. CX Codex +1 804installs finding-industry-event-coverage-google Searches Google for industry conference press and event recaps via Apify. Categorizes articles and extracts key announcement signals into structured tables. CX Codex +1 803installs scraping-tweets-from-account This skill pulls tweets, replies and media from a public Twitter/X account through apidojo's tweet scraper on Apify. Handy when you need a dataset for someone else's profile. CX Codex +1 802installs analyzing-youtube-competitor-channel-strategy This skill examines a competitor’s YouTube strategy, video mix, publishing rhythm, and engagement. Use it when a channel benchmark needs data behind it. CX Codex +1 800installs monitoring-instagram-brand-mentions Collects public Instagram posts that mention a brand through hashtags, tags, or product names. Useful for review, complaint, and user-generated content analysis. CX Codex +1 797installs researching-internet-slang-and-cultural-trends Searches Urban Dictionary through Apify for slang and cultural terms. Use it to inspect meme language, social media wording, or brand-related vocabulary. CX Codex +1 796installs analyzing-competitor-instagram-content-strategy This skill pulls a competitor's recent Instagram posts and shows which formats and themes earn them engagement. Useful when you need to read someone else's content plan. CX Codex +1 796installs extracting-youtube-comments-for-research Pulls YouTube comments from videos and channels through Apify, then sorts them into themes, questions and sentiment. Useful when you need to know what viewers actually say. CX Codex +1 794installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor