← All Claude Builds
Claude Code Recipe

Find Your TikTok Followers

Harvest every follower of your TikTok account into a clickable, filterable Excel spreadsheet — display names, usernames, stats, bios, and content categories. All public data, no scraping shortcuts.

~5-10
Minutes for 2k followers
10
Columns of data
1
Prompt to paste

What Is This?

A Claude Code recipe that uses the Playwright MCP plugin to log into TikTok, scroll through every follower in your followers modal, and enrich each one with public profile stats. The output is a clean Excel workbook with autofilter, clickable profile links, and follower buckets by content type — so you can sort, filter, and actually use the list instead of just admiring the number.

Nothing is scraped from behind a login. Step 3 opens your followers list (which is public on your own profile anyway), and the enrichment in Step 6 hits the same public profile pages anyone with the link can see.

What You Get

ColumnWhat It Holds
A — Follow OrderChronological number, newest follower = highest
B — NameDisplay name as a clickable HYPERLINK to the profile
C — Username@handle
D — FollowersTheir follower count
E — VideosTotal videos posted
F — Content TypeBucket (AI / Tech, Gaming, Business, Art, Music…) — filterable
G — BioTheir TikTok bio text
H — VerifiedBlue check yes/no
I — FollowingWho they follow
J — HeartsTotal likes received across their videos

How It Works

1
Claude opens TikTok in a Playwright browser. You log in manually in that window — no credentials touch Claude.
2
Followers modal opens and auto-scrolls until every follower is loaded. Claude detects when scrolling stops adding new entries.
3
Raw CSV is written with username, display name, and profile URL for each follower — order preserved.
4
Enrichment runs in parallel — Python with ThreadPoolExecutor fetches each public profile page, regex-extracts the embedded JSON blob, and pulls stats (followers, videos, hearts, bio, verified).
5
Bios get bucketed into content types via a regex keyword list (AI / Tech, Gaming, Business, etc.).
6
Final Excel is built with openpyxl: clickable name column, frozen header row, autofilter enabled, count columns number-formatted. Done.

Requirements

Quick Start

1
Open a fresh Claude Code session in a folder where you want the spreadsheet to land.
2
Paste The Prompt below into chat.
3
When Claude opens a browser window, log in to TikTok there, then come back to the chat and type logged in.
4
Wait ~5-10 minutes for a ~2k-follower account. Excel opens automatically when done.

Tips

Filter by Content Type. Click the dropdown arrow in column F to show just "AI / Tech" followers, or "Gaming" creators, etc.

Sort chronologically. Sort by column A — ascending for oldest first, descending for newest.

~2-3% of profiles come back blank. These are private, restricted, or deleted accounts that TikTok no longer serves stats for. Their row still exists with just the username.

Privacy. Only reads what's already public. The follower list is visible to anyone visiting your profile. No login required for the enrichment step.

Get the Recipe

This recipe ships as a single README — the prompt block inside is what you paste into Claude Code. Copy either panel below.

README.md
# TikTok Followers → Spreadsheet

Harvest every follower of your TikTok account into a clickable, filterable Excel spreadsheet.

**Output columns:** Follow Order (chronological), Name (clickable link), Username, Followers, Videos, Content Type (filterable), Bio, Verified, Following, Hearts.

**Time:** ~5-10 minutes for a 2,000-follower account.

## Prerequisites

- Claude Code with the **Playwright MCP** plugin enabled
- Python 3 with `openpyxl` (`pip install openpyxl`)
- A TikTok account you can log into

## How to run

Paste the prompt below into a fresh Claude Code session. When Claude opens a browser, log in to TikTok in that window, then return to chat and say "logged in".

---

## The prompt

```
Harvest my TikTok followers into an Excel spreadsheet. Steps:

1. Open https://www.tiktok.com/login via Playwright MCP. Wait until I say "logged in" before continuing. (Install the browser first if needed: npx @playwright/mcp install-browser chrome-for-testing)

2. After I confirm, evaluate this in the page to detect my username from the URL:
   location.href.match(/@([\w.\-_]+)/)[1]

3. Navigate to https://www.tiktok.com/@<my_username>. Click the clickable parent of `strong[data-e2e="followers-count"]` to open the Followers modal. Wait 2 seconds.

4. Find the scroll container inside the modal: query all elements where computed `overflow-y` is `auto` or `scroll`, pick the one with the largest scrollHeight containing `a[href^="/@"]` children. Auto-scroll loop: set scrollTop = scrollHeight, wait 900ms, repeat until child count is stable for 4 rounds.

5. Extract each follower from the container's `<li>` children:
   - profile_url = "https://www.tiktok.com" + a[href^="/@"].getAttribute('href').replace(/\?.*$/, '')
   - username = `[class*="PUniqueId"]`.textContent
   - display_name = `[class*="SpanNickname"]`.textContent
   Save to followers_raw.csv with columns: username, display_name, profile_url.

6. Write a Python script (followers_raw.csv → followers_enriched.csv) that for each profile URL fetches the page with a real browser User-Agent header (e.g. "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0 Safari/537.36"), regex-extracts the contents of `<script id="__UNIVERSAL_DATA_FOR_REHYDRATION__">`, parses as JSON, and reads `data["__DEFAULT_SCOPE__"]["webapp.user-detail"]["userInfo"]` to get:
   - user: nickname, signature (bio), verified, privateAccount
   - stats: followerCount, followingCount, videoCount, heart
   Run with `ThreadPoolExecutor(max_workers=8)`. No login required for this step — these are public profile pages. Stream rows to CSV as they complete. Report errors but continue.

7. Build the final spreadsheet with openpyxl. Merge followers_raw.csv (preserves original order) with followers_enriched.csv (joined by username). Add a "Follow Order" column where the most recent follower (first row of raw CSV) gets the highest number (total_followers) and the oldest follower gets 1. Classify each bio with a regex keyword-bucket list — examples: "AI / Tech" → /ai|claude|gpt|prompt|developer|engineer|tech/i ; "Gaming" → /gaming|gamer|twitch|esports/i ; "Business" → /entrepreneur|founder|ceo|startup/i ; "Art" → /artist|painter|illustration/i ; "Music" → /music|musician|singer|dj/i ; "Comedy" → /comedy|comedian|funny/i ; "Pets/Animals" → /dog|cat|pets|animals/i ; "Fitness" → /fitness|gym|trainer|workout/i ; etc. Default to "No content / lurker" if videoCount = 0 and bio empty, else "Creator: <bio excerpt>".

   Final column layout (in this order):
     A: Follow Order (number)
     B: Name → `=HYPERLINK("<profile_url>","<display_name>")` (clickable)
     C: Username (with @ prefix)
     D: Followers
     E: Videos
     F: Content Type
     G: Bio
     H: Verified
     I: Following
     J: Hearts (likes)

   Freeze the header row, enable autofilter on the whole range, format count columns with #,##0. Save as TIKTOK_FOLLOWERS.xlsx. Open the file when done.

Watch for: stale class names (TikTok randomizes CSS classes — always use `[class*="..."]` partial matches or data-e2e attributes), and the followers modal click target is the parent div of the count, not the strong tag itself.
```

---

## Tips

- **Filtering by Content Type:** Click the dropdown arrow in column F to filter — e.g. show only "AI / Tech" followers, or "Gaming" creators.
- **Sorting back to chronological order:** Sort by column A ascending (oldest first) or descending (newest first).
- **Follower count fields are blank for ~2-3% of profiles** — these are private/restricted/deleted accounts that TikTok no longer serves stats for. Their row still exists with just their username.
- The "Follow Order" reflects **TikTok's display order** in the followers modal — empirically chronological (newest first) but not formally guaranteed by TikTok.

## Privacy note

This tool only reads what's already public on TikTok. The follower list is visible to anyone who visits your profile. No login is required for the enrichment step (only for opening the followers modal in step 3).
PROMPT — paste into Claude Code
Harvest my TikTok followers into an Excel spreadsheet. Steps:

1. Open https://www.tiktok.com/login via Playwright MCP. Wait until I say "logged in" before continuing. (Install the browser first if needed: npx @playwright/mcp install-browser chrome-for-testing)

2. After I confirm, evaluate this in the page to detect my username from the URL:
   location.href.match(/@([\w.\-_]+)/)[1]

3. Navigate to https://www.tiktok.com/@<my_username>. Click the clickable parent of `strong[data-e2e="followers-count"]` to open the Followers modal. Wait 2 seconds.

4. Find the scroll container inside the modal: query all elements where computed `overflow-y` is `auto` or `scroll`, pick the one with the largest scrollHeight containing `a[href^="/@"]` children. Auto-scroll loop: set scrollTop = scrollHeight, wait 900ms, repeat until child count is stable for 4 rounds.

5. Extract each follower from the container's `<li>` children:
   - profile_url = "https://www.tiktok.com" + a[href^="/@"].getAttribute('href').replace(/\?.*$/, '')
   - username = `[class*="PUniqueId"]`.textContent
   - display_name = `[class*="SpanNickname"]`.textContent
   Save to followers_raw.csv with columns: username, display_name, profile_url.

6. Write a Python script (followers_raw.csv → followers_enriched.csv) that for each profile URL fetches the page with a real browser User-Agent header (e.g. "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0 Safari/537.36"), regex-extracts the contents of `<script id="__UNIVERSAL_DATA_FOR_REHYDRATION__">`, parses as JSON, and reads `data["__DEFAULT_SCOPE__"]["webapp.user-detail"]["userInfo"]` to get:
   - user: nickname, signature (bio), verified, privateAccount
   - stats: followerCount, followingCount, videoCount, heart
   Run with `ThreadPoolExecutor(max_workers=8)`. No login required for this step — these are public profile pages. Stream rows to CSV as they complete. Report errors but continue.

7. Build the final spreadsheet with openpyxl. Merge followers_raw.csv (preserves original order) with followers_enriched.csv (joined by username). Add a "Follow Order" column where the most recent follower (first row of raw CSV) gets the highest number (total_followers) and the oldest follower gets 1. Classify each bio with a regex keyword-bucket list — examples: "AI / Tech" → /ai|claude|gpt|prompt|developer|engineer|tech/i ; "Gaming" → /gaming|gamer|twitch|esports/i ; "Business" → /entrepreneur|founder|ceo|startup/i ; "Art" → /artist|painter|illustration/i ; "Music" → /music|musician|singer|dj/i ; "Comedy" → /comedy|comedian|funny/i ; "Pets/Animals" → /dog|cat|pets|animals/i ; "Fitness" → /fitness|gym|trainer|workout/i ; etc. Default to "No content / lurker" if videoCount = 0 and bio empty, else "Creator: <bio excerpt>".

   Final column layout (in this order):
     A: Follow Order (number)
     B: Name → `=HYPERLINK("<profile_url>","<display_name>")` (clickable)
     C: Username (with @ prefix)
     D: Followers
     E: Videos
     F: Content Type
     G: Bio
     H: Verified
     I: Following
     J: Hearts (likes)

   Freeze the header row, enable autofilter on the whole range, format count columns with #,##0. Save as TIKTOK_FOLLOWERS.xlsx. Open the file when done.

Watch for: stale class names (TikTok randomizes CSS classes — always use `[class*="..."]` partial matches or data-e2e attributes), and the followers modal click target is the parent div of the count, not the strong tag itself.