Skip to main content
skill CX Codex

tiktok-research · bradautomates — Claude Code skill: TikTok video analysis

Pulls videos from tracked accounts through Apify, flags engagement outliers, and has AI break down the top 5 clips.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add bradautomates/head-of-content --skill tiktok-research -a claude-code
Open on GitHub

What tiktok-research does

The skill fetches recent posts from a list of accounts via the Apify TikTok Scraper, scores engagement from likes, comments, shares, saves and views, then keeps videos whose rate clears the mean plus a standard-deviation threshold. Defaults: threshold 2.0, a 30-day window, up to 50 videos per account, sorted by latest.

A second skill, video-content-analyzer, takes over next. It examines up to 5 top clips and extracts the hook technique, content structure, retention moves and CTA strategy. You end up with a run folder holding raw.json, outliers.json, video-analysis.json and report.md, the last one carrying tables of hooks, formats, CTAs and trending hashtags and sounds.

Before any of that, you need APIFY_TOKEN and GEMINI_API_KEY in the environment or .env, the apify-client and google-genai Python packages, and your accounts listed in .claude/context/tiktok-accounts.md. Skip the token and the first script dies immediately, so run the setup check from SKILL.md first.

What it helps with

  • find clips that took off for competitors this month
  • separate engagement outliers from ordinary posts
  • reverse-engineer the hook formula behind top videos
  • build a report of trending hashtags and sounds
  • generate content ideas from someone else's win

Example prompts for the agent

  • Run tiktok research on the accounts in my list for the last 30 days
  • Find outliers across these TikTok accounts and analyze the top 5 videos
  • Build a report on hooks and structure from the best videos in this niche

How to install tiktok-research

1Skills CLI (Vercel)

npx skills add bradautomates/head-of-content --skill tiktok-research -a claude-code

2Manually: put the files in place

~/.claude/skills/tiktok-research/SKILL.md

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

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

Questions about tiktok-research

How do I install tiktok-research in Claude?

Run npx skills add bradautomates/head-of-content --skill tiktok-research -a claude-code. The skill lands at ~/.claude/skills/tiktok-research/SKILL.md.

What does tiktok-research do?

It fetches videos from tracked accounts through Apify, detects engagement outliers, analyzes the top 5 with AI and writes a report of replicable hook formulas.

What do I need before running it?

APIFY_TOKEN and GEMINI_API_KEY in the environment or .env, the apify-client and google-genai packages, and your accounts in .claude/context/tiktok-accounts.md.

Source text

SKILL.md · MIT
---
name: tiktok-research
description: |
  Research high-performing TikTok videos from tracked accounts using Apify's TikTok Scraper.
  Identifies outlier content, analyzes top 5 videos with AI, and generates reports with actionable hook formulas.

  Use when asked to:
  - Find trending TikTok content in a niche
  - Research what's performing on TikTok
  - Identify high-performing video patterns
  - Analyze competitors' TikTok content
  - Generate content ideas from TikTok trends
  - Run TikTok research
  - Find viral TikToks
  - Analyze hooks and content structure

  Triggers: "tiktok research", "tt research", "find trending tiktoks", "analyze tiktok accounts",
  "what's working on tiktok", "content research tiktok", "tiktok analysis", "tiktok trends"
---

# TikTok Research

Research high-performing TikTok videos, identify outliers, and analyze top video content for hooks and structure.

## Prerequisites

- `APIFY_TOKEN` environment variable or in `.env`
- `GEMINI_API_KEY` environment variable or in `.env`
- `apify-client` and `google-genai` Python packages
- Accounts configured in `.claude/context/tiktok-accounts.md`

Verify setup:
```bash
python3 -c "
import os
try:
    from dotenv import load_dotenv
    load_dotenv()
except ImportError:
    pass
from apify_client import ApifyClient
from google import genai
assert os.environ.get('APIFY_TOKEN'), 'APIFY_TOKEN not set'
assert os.environ.get('GEMINI_API_KEY'), 'GEMINI_API_KEY not set'
" && echo "Prerequisites OK"
```

## Workflow

### 1. Create Run Folder

```bash
RUN_FOLDER="tiktok-research/$(date +%Y-%m-%d_%H%M%S)" && mkdir -p "$RUN_FOLDER" && echo "$RUN_FOLDER"
```

### 2. Fetch Content

```bash
python3 .claude/skills/tiktok-research/scripts/fetch_tiktok.py \
  --days 30 \
  --limit 50 \
  --sorting latest \
  --output {RUN_FOLDER}/raw.json
```

Parameters:
- `--days`: Days back to search (default: 30)
- `--limit`: Max videos per account (default: 50)
- `--sorting`: "latest", "popular", or "oldest" (default: latest)
- `--usernames`: Override accounts file with specific usernames

### 3. Identify Outliers

```bash
python3 .claude/skills/tiktok-research/scripts/analyze_posts.py \
  --input {RUN_FOLDER}/raw.json \
  --output {RUN_FOLDER}/outliers.json \
  --threshold 2.0
```

Output JSON contains:
- `total_videos`: Number of videos analyzed
- `outlier_count`: Number of outliers found
- `topics`: Top hashtags, sounds, and keywords
- `accounts`: List of accounts analyzed
- `outliers`: Array of outlier videos with engagement metrics

### 4. Analyze Top Videos with AI

```bash
python3 .claude/skills/video-content-analyzer/scripts/analyze_videos.py \
  --input {RUN_FOLDER}/outliers.json \
  --output {RUN_FOLDER}/video-analysis.json \
  --platform tiktok \
  --max-videos 5
```

Extracts from each video:
- Hook technique and replicable formula
- Content structure and sections
- Retention techniques
- CTA strategy

See the `video-content-analyzer` skill for full output schema and hook/format types.

### 5. Generate Report

Read `{RUN_FOLDER}/outliers.json` and `{RUN_FOLDER}/video-analysis.json`, then generate `{RUN_FOLDER}/report.md`.

**Report Structure:**

```markdown
# TikTok Research Report

Generated: {date}

## Top Performing Hooks

Ranked by engagement. Use these formulas for your content.

### Hook 1: {technique} - @{username}
- **Opening**: "{opening_line}"
- **Why it works**: {attention_grab}
- **Replicable Formula**: {replicable_formula}
- **Engagement**: {diggCount} likes, {commentCount} comments, {playCount} views
- [Watch Video]({webVideoUrl})

[Repeat for each analyzed video]

## Content Structure Patterns

| Video | Format | Pacing | Key Retention Techniques |
|-------|--------|--------|--------------------------|
| @username | {format} | {pacing} | {techniques} |

## CTA Strategies

| Video | CTA Type | CTA Text | Placement |
|-------|----------|----------|-----------|
| @username | {type} | "{cta_text}" | {placement} |

## All Outliers

| Rank | Username | Likes | Comments | Shares | Views | Engagement Rate |
|------|----------|-------|----------|--------|-------|-----------------|
[List all outliers with metrics and links]

## Trending Topics

### Top Hashtags
[From outliers.json topics.hashtags]

### Top Sounds
[From outliers.json topics.sounds]

### Top Keywords
[From outliers.json topics.keywords]

## Actionable Takeaways

[Synthesize patterns into 4-6 specific recommendations]

## Accounts Analyzed
[List accounts]
```

Focus on actionable insights. The "Top Performing Hooks" section with replicable formulas should be prominent.

## Quick Reference

Full pipeline:
```bash
RUN_FOLDER="tiktok-research/$(date +%Y-%m-%d_%H%M%S)" && mkdir -p "$RUN_FOLDER" && \
python3 .claude/skills/tiktok-research/scripts/fetch_tiktok.py -o "$RUN_FOLDER/raw.json" && \
python3 .claude/skills/tiktok-research/scripts/analyze_posts.py -i "$RUN_FOLDER/raw.json" -o "$RUN_FOLDER/outliers.json" && \
python3 .claude/skills/video-content-analyzer/scripts/analyze_videos.py -i "$RUN_FOLDER/outliers.json" -o "$RUN_FOLDER/video-analysis.json" -p tiktok
```

Then read both JSON files and generate the report.

## Engagement Metrics

**Engagement Score**: `likes + (3 x comments) + (2 x shares) + (2 x saves) + (0.05 x views)`

**Outlier Detection**: Videos with engagement rate > mean + (threshold x std_dev)

**Engagement Rate**: (score / followers) x 100

## TikTok-Specific Fields

- `diggCount`: Likes/hearts
- `shareCount`: Shares
- `playCount`: Video views
- `commentCount`: Comments
- `collectCount`: Saves/bookmarks
- `authorFollowers`: Creator's follower count
- `musicName`: Sound used in video
- `musicOriginal`: Whether sound is original

© bradautomates · MIT · bradautomates/head-of-content

Similar skills

Everything for Marketing and content →

tiktok-research by other authors comes first.

From the same set4

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