Back to blog

How to Scrape TikTok Data: The Complete Guide for Developers

by Simon Balfe ·

TikTok holds an enormous amount of publicly available data: creator profiles, video metadata, comments, trending hashtags, engagement metrics, and more. If you are building an influencer marketing platform, a social listening tool, or a research dashboard, you need a reliable way to get that data into your application.

This guide covers every approach to scraping TikTok data, from building your own scraper to using a dedicated API, with working code examples you can run today.

What is TikTok scraping?

TikTok scraping is the process of programmatically extracting public data from TikTok. This includes creator profiles, video metadata, comments, hashtags, trending content, and engagement statistics.

Businesses and developers scrape TikTok for many reasons:

  • Influencer marketing: Finding creators in specific niches and evaluating their engagement
  • Market research: Understanding what content performs well in a given category
  • Competitive analysis: Tracking competitor brand mentions and campaign performance
  • Content strategy: Identifying trending sounds, hashtags, and content formats
  • Academic research: Studying social media behavior and content virality

What data can you scrape from TikTok?

Here is what is publicly available and commonly extracted:

Data typeWhat you get
ProfilesUsername, bio, follower count, following count, total likes, video count, verified status
VideosCaption, view count, likes, comments, shares, saves, duration, cover image, sound used
CommentsComment text, author, like count, reply count, timestamps, pinned status
HashtagsHashtag name, associated video counts, trending status
Trending feedCurrently trending videos by region with full engagement metrics
Search resultsUsers and content matching keyword queries
Sounds/musicSong details, usage counts, associated videos

Methods to scrape TikTok data

1. TikTok’s official Research API

TikTok offers a Research API, but it comes with significant limitations. Access requires a 4+ week approval process and is restricted to academic researchers at US and EU non-profit universities. Commercial use is prohibited. The API covers only 8 endpoints, rate limits you to 1,000 requests per day, and data is typically 2 to 10 days stale.

For most developers and businesses, this is not a viable option.

2. Building a custom scraper

You can build your own TikTok scraper using tools like Playwright, Puppeteer, or Selenium. This gives you full control but comes with real costs:

  • TikTok actively blocks datacenter IP addresses
  • The frontend changes frequently, breaking scrapers every few weeks
  • You need residential proxy infrastructure ($50 to $500/month)
  • Ongoing maintenance runs 5 to 10 hours per month
  • At $150/hour developer time, that is $750 to $1,500/month just for upkeep

For learning projects, building a scraper is a great exercise. For production use, the economics rarely make sense.

A dedicated TikTok API like CreatorCrawl gives you structured JSON responses, consistent schemas, sub-second response times, and zero maintenance burden. You make HTTP requests and get clean data back.

This is the approach most production applications use, and it is what the rest of this guide focuses on.

Step-by-step: Scraping TikTok data with CreatorCrawl

Prerequisites

  1. Sign up for CreatorCrawl (250 free credits, no card required)
  2. Generate an API key from your dashboard
  3. Have Python 3.7+ or Node.js 18+ installed

Scraping a TikTok profile

Python:

import requests

API_KEY = "your_api_key_here"
BASE_URL = "https://api.creatorcrawl.com/v1"

response = requests.get(
    f"{BASE_URL}/tiktok/profile",
    params={"handle": "charlidamelio"},
    headers={"x-api-key": API_KEY}
)

data = response.json()
user = data["user"]
stats = data["stats"]

print(f"Username: {user['uniqueId']}")
print(f"Followers: {stats['followerCount']:,}")
print(f"Total likes: {stats['heartCount']:,}")
print(f"Videos: {stats['videoCount']:,}")
print(f"Verified: {user['verified']}")

JavaScript:

const API_KEY = 'your_api_key_here'
const BASE_URL = 'https://api.creatorcrawl.com/v1'

const response = await fetch(
  `${BASE_URL}/tiktok/profile?handle=charlidamelio`,
  { headers: { 'x-api-key': API_KEY } }
)

const data = await response.json()
const { user, stats } = data

console.log(`Username: ${user.uniqueId}`)
console.log(`Followers: ${stats.followerCount.toLocaleString()}`)
console.log(`Total likes: ${stats.heartCount.toLocaleString()}`)
console.log(`Videos: ${stats.videoCount}`)
console.log(`Verified: ${user.verified}`)

Scraping a creator’s videos

Pull all videos from a profile with pagination:

Python:

def get_all_videos(handle):
    all_videos = []
    cursor = None

    while True:
        params = {"handle": handle}
        if cursor:
            params["max_cursor"] = cursor

        response = requests.get(
            f"{BASE_URL}/tiktok/profile/videos",
            params=params,
            headers={"x-api-key": API_KEY}
        )

        data = response.json()
        videos = data.get("aweme_list", [])
        all_videos.extend(videos)

        if not data.get("has_more"):
            break
        cursor = data.get("max_cursor")

    return all_videos

videos = get_all_videos("charlidamelio")
for video in videos[:5]:
    stats = video.get("statistics", {})
    print(f"Caption: {video.get('desc', '')[:60]}")
    print(f"Views: {stats.get('play_count', 0):,}")
    print(f"Likes: {stats.get('digg_count', 0):,}")
    print()

Scraping TikTok comments

Extract comments from any TikTok video:

JavaScript:

const videoUrl = 'https://www.tiktok.com/@charlidamelio/video/7321456789012345678'

const response = await fetch(
  `${BASE_URL}/tiktok/video/comments?url=${encodeURIComponent(videoUrl)}`,
  { headers: { 'x-api-key': API_KEY } }
)

const data = await response.json()

for (const comment of data.comments) {
  console.log(`@${comment.user.unique_id}: ${comment.text}`)
  console.log(`  Likes: ${comment.digg_count} | Replies: ${comment.reply_comment_total}`)
}

Get the current trending feed for any region:

Python:

response = requests.get(
    f"{BASE_URL}/tiktok/get-trending-feed",
    params={"region": "US"},
    headers={"x-api-key": API_KEY}
)

trending = response.json()

for video in trending["aweme_list"][:10]:
    stats = video["statistics"]
    print(f"@{video['author']['unique_id']}: {video['desc'][:50]}")
    print(f"  Views: {stats['play_count']:,} | Likes: {stats['digg_count']:,}")

Searching for TikTok users

Find creators matching a keyword:

Python:

response = requests.get(
    f"{BASE_URL}/tiktok/search/users",
    params={"query": "fitness coach"},
    headers={"x-api-key": API_KEY}
)

results = response.json()

for result in results["users"]:
    user = result["user_info"]
    print(f"@{user['unique_id']} - {user['nickname']}")
    print(f"  Followers: {user['follower_count']:,}")
    print(f"  Videos: {user['aweme_count']}")

Scraping publicly available data is generally permissible, but there are important boundaries to respect:

  • Only collect public data. Never attempt to access private accounts or data behind authentication.
  • Respect robots.txt. When building your own scrapers, check TikTok’s robots.txt directives.
  • Follow data protection laws. GDPR, CCPA, and similar regulations apply to personal data even when it is publicly posted. Have a legitimate purpose for collection and handle data responsibly.
  • Use an API when possible. APIs provide a cleaner legal position than raw scraping because you are accessing data through a structured interface rather than circumventing technical measures.

Using an API like CreatorCrawl means you are working with structured data endpoints rather than reverse-engineering the TikTok frontend, which is a cleaner approach from both a legal and practical standpoint.

Why an API beats building your own scraper

FactorCustom scraperAPI (CreatorCrawl)
Setup timeDays to weeks30 seconds
Maintenance5-10 hours/monthZero
Monthly cost$820-2,200 (time + infra)$29-299 (pay per use)
Data formatRaw HTML to parseClean JSON
ReliabilityBreaks on frontend changesConsistent uptime
Response time3-10 seconds (browser)Sub-second
ScalingComplex infrastructureJust make more requests

For production applications, a dedicated API saves you time, money, and headaches. Start with 250 free credits and see how much faster it is than maintaining a scraper.

Next steps

Once you have your TikTok data pipeline working:

Explore CreatorCrawl

More from the Blog