DEV Community

agenthustler
agenthustler

Posted on

Scraping TikTok in 2026: Videos, Profiles & Hashtags (Without Getting Blocked)

TikTok is the fastest-growing content platform in the world — 1.5B+ monthly active users, 34 million videos uploaded daily. If you're doing influencer research, trend discovery, brand monitoring, or competitive analysis, you need TikTok data.

But scraping TikTok is notoriously hard. Here's how to do it reliably in 2026.


Why Scrape TikTok?

  • Influencer research: Find creators in your niche, compare engagement rates, track growth
  • Trend discovery: Spot trending hashtags and sounds before they peak
  • Brand monitoring: Track mentions, UGC, and sentiment around your brand
  • Competitor analysis: See what content your competitors post and what performs
  • Content strategy: Identify what formats, lengths, and hooks drive views in your category

The Challenge: TikTok's Bot Detection

TikTok doesn't make it easy. Their anti-bot system is multi-layered:

1. Browser Fingerprinting

TikTok checks canvas fingerprints, WebGL renderer info, installed fonts, screen resolution, timezone, and dozens of other browser properties. Simple HTTP requests get blocked instantly.

2. Behavioral Analysis

They track mouse movements, scroll patterns, and timing between actions. Bots that navigate too fast or too predictably get flagged.

3. IP Reputation

Datacenter IPs are blocked aggressively. Even residential proxies get throttled if they generate too many requests.

4. Dynamic Rendering

Much of TikTok's content loads via JavaScript. The HTML source contains almost nothing — you need a real browser engine to render the page.

This is why most TikTok scrapers on the market have terrible reviews (2.0/5 stars is common). They work for a week, then TikTok updates their detection, and everything breaks.

What Data Can You Extract?

When scraping works properly, you can pull:

Field Example
Video URL https://www.tiktok.com/@user/video/123
Title/Description "3 Python tricks you didn't know #coding"
View count 2,450,000
Likes 189,000
Comments 4,200
Shares 12,800
Author username @pythontips
Author followers 850,000
Sound/Music "original sound - pythontips"
Hashtags #coding, #python, #learnpython
Posted date 2026-03-15T14:30:00Z
Duration 47 seconds

A Scraper That Actually Works

I built TikTok Scraper on Apify to solve the reliability problem. It uses full browser automation with stealth techniques that survive TikTok's detection updates.

It has 3 modes:

Mode 1: Profile Scraping

Get all recent videos from any public creator.

Input:

{
  "mode": "profile",
  "profiles": ["@charlidamelio", "@khaby.lame"],
  "maxVideos": 50
}
Enter fullscreen mode Exit fullscreen mode

Use case: Track a creator's posting frequency, engagement trends, and content themes over time.

Mode 2: Hashtag Scraping

Get top/trending videos for any hashtag.

Input:

{
  "mode": "hashtag",
  "hashtags": ["python", "webdev", "coding"],
  "maxVideos": 100
}
Enter fullscreen mode Exit fullscreen mode

Use case: Discover what content performs best for hashtags in your niche. Find emerging creators.

Mode 3: Single Video Detail

Get full details for a specific video URL.

Input:

{
  "mode": "video",
  "urls": ["https://www.tiktok.com/@user/video/7345678901234567890"]
}
Enter fullscreen mode Exit fullscreen mode

Use case: Deep-dive into a specific viral video — exact engagement numbers, sound used, hashtags.

Python Code Example

Here's how to use it programmatically with the Apify Python client:

from apify_client import ApifyClient

client = ApifyClient("YOUR_APIFY_TOKEN")

# Scrape trending videos for #ecommerce
run = client.actor("cryptosignals/tiktok-scraper").call(
    run_input={
        "mode": "hashtag",
        "hashtags": ["ecommerce"],
        "maxVideos": 50,
    }
)

# Get results
videos = list(client.dataset(run["defaultDatasetId"]).iterate_items())

# Find top performers
for video in sorted(videos, key=lambda v: v.get("views", 0), reverse=True)[:10]:
    print(f"{video['views']:>12,} views | {video['title'][:60]}")
    print(f"             Likes: {video.get('likes', 0):,} | "
          f"Comments: {video.get('comments', 0):,} | "
          f"Shares: {video.get('shares', 0):,}")
    print(f"             By: {video.get('author', 'unknown')}")
    print()
Enter fullscreen mode Exit fullscreen mode

Install the client:

pip install apify-client
Enter fullscreen mode Exit fullscreen mode

Use Case: TikTok Trend Tracker for E-Commerce

Here's a practical example. Say you sell fitness products and want to know what's trending on FitTok.

Step 1: Scrape trending hashtags weekly

HASHTAGS = ["fitnessmotivation", "homegym", "proteinshake",
            "workoutroutine", "gymtok"]

all_videos = []
for tag in HASHTAGS:
    run = client.actor("cryptosignals/tiktok-scraper").call(
        run_input={"mode": "hashtag", "hashtags": [tag], "maxVideos": 30}
    )
    videos = list(client.dataset(run["defaultDatasetId"]).iterate_items())
    all_videos.extend(videos)
Enter fullscreen mode Exit fullscreen mode

Step 2: Analyze what's working

import collections

# Find which sounds are trending
sounds = collections.Counter(v.get("sound", "") for v in all_videos)
print("Top sounds this week:")
for sound, count in sounds.most_common(10):
    print(f"  {count}x — {sound}")

# Find engagement patterns
high_engagement = [v for v in all_videos if v.get("likes", 0) > 50000]
avg_duration = sum(v.get("duration", 0) for v in high_engagement) / len(high_engagement)
print(f"\nAvg duration of viral videos: {avg_duration:.0f}s")
Enter fullscreen mode Exit fullscreen mode

Step 3: Act on insights

  • Spot a trending sound? Use it in your next product video.
  • See a format getting high engagement? Adapt it for your brand.
  • Notice a competitor's video going viral? Analyze what made it work.

This turns TikTok from a black box into a data-driven content strategy tool.

Getting Started

The TikTok Scraper launches this week on Apify. Starting April 3, it's $4.99/month — which gets you reliable extraction across all 3 modes.

You can also run it on Apify's free tier to test it out first.

Links:


Have questions about scraping TikTok or want a feature added? Drop a comment below.

Top comments (0)