Learn How to Scrape Tiktok Videos with Python

Last Updated on April 14, 2026

TikTok now has roughly and creators upload an estimated 23 million videos every single day. If you've ever tried to collect data from even a fraction of that firehose, you already know the pain.

Here's what usually happens: you search "scrape TikTok videos with Python," copy a snippet from a tutorial (or ask ChatGPT to write one), run it, and get… nothing. Empty HTML. A 403 error. Or the dreaded "Process finished with exit code 0" with zero output. I've watched this exact cycle play out in dozens of GitHub issues and Reddit threads, and it's the reason I put this guide together. We'll cover three Python methods that actually work in 2025, a full walkthrough for downloading the actual .mp4 video files (not just metadata — which is what every other tutorial stops at), and a comparison table so you can pick the right approach for your use case. If you don't need Python at all, I'll also cover no-code alternatives like that can get you the same data in about two clicks.

What Does "Scraping TikTok Videos" Actually Mean?

Before we get into code, it's worth clarifying what people mean when they say "scrape TikTok videos" — because the phrase covers two very different things:

  1. Extracting video metadata: Captions, hashtags, like counts, comment counts, share counts, view counts, post dates, author info. This is what most tutorials focus on.
  2. Downloading the actual video files (.mp4): Getting the video itself saved to your machine. This is what most people actually want when they type "scrape TikTok videos" — and it's the part almost nobody covers.

This guide covers both. Every method below can extract metadata and give you the download URLs you need to save the .mp4 files.

Why Scrape TikTok Videos with Python?

With and TikTok Shop generating , the business reasons to tap into TikTok data are substantial. Here are the use cases I see most often:

| Use Case | What You're Scraping | Who It's For | |---|---|---| | Influencer & Marketing Research | Engagement rates, follower counts, content formats, hashtag performance | Marketing teams, agencies | | Content Strategy | Trending hashtags, viral video formats, posting cadence | Content creators, social media managers | | Brand Monitoring | Mentions, campaign reach, audience sentiment | Brand managers, PR teams | | Competitive Intelligence | Competitor video performance, ad creatives, TikTok Shop listings | E-commerce, product teams | | Market Research | Emerging trends, audience behavior, product discovery | Analysts, hedge funds, research firms | | Archival & Compliance | Video files for internal review or record-keeping | Legal, compliance, agencies |

The commercial stakes are real: US TikTok ad revenue is forecast at $23.4 billion in 2026, and affiliate creators generate in top TikTok Shop categories. If you're in e-commerce or influencer marketing, this data has direct dollar value.

Why Your Basic Python Code Fails on TikTok

If you've already tried something like this and gotten nowhere, you're in good company:

1import requests
2from bs4 import BeautifulSoup
3resp = requests.get("https://www.tiktok.com/@someuser")
4soup = BeautifulSoup(resp.text, "html.parser")
5# ...and then nothing useful is in the HTML

The reason is straightforward: TikTok is one of the hardest platforms to scrape. A basic requests.get() returns a mostly-empty HTML shell because the actual content is rendered by JavaScript in the browser. On top of that, TikTok deploys an aggressive anti-bot stack that includes behavioral detection, TLS fingerprinting, a that generates request signatures, and dynamic CSS selectors that change without notice.

tiktok-anti-bot-wall.webp

Per the Imperva 2025 Bad Bot Report, automated traffic surpassed human traffic for the first time in 2024 — bots now account for . TikTok is well aware of this and has built its defenses accordingly.

Here's a quick diagnostic table so you can figure out what's going wrong and jump to the right method:

| Symptom | Likely Cause | Method That Fixes It | |---|---|---| | Empty HTML / no data | JS-rendered content; requests can't execute JavaScript | Method 1 (Hidden JSON) or Method 3 (Playwright) | | 403 / Access Denied | Missing or wrong headers; anti-bot detection | Method 1 with proper headers | | Data works once, then stops | Rate limiting / IP block | Proxy rotation (all methods) | | Login wall appears | Session/cookie requirement | Method 3 (browser with saved session) | | ChatGPT-generated code returns nothing | TikTok structure changed since model training data | All 3 methods (up-to-date approaches) |

The rate limit threshold is roughly 30–60 requests per minute per IP before you start getting soft blocks or CAPTCHAs. Datacenter IPs get flagged within minutes — residential or mobile proxies are essentially mandatory for any volume.

Overview: 3 Methods to Scrape TikTok Videos with Python

Here's the roadmap. Each method has different trade-offs, and I'll cover all three with working code:

  1. Hidden JSON Extraction — Parse the __UNIVERSAL_DATA_FOR_REHYDRATION__ script tag embedded in TikTok pages. Fastest, simplest, no browser needed.
  2. TikTok's Internal API — Call the undocumented /api/post/item_list/ endpoint directly for bulk data with cursor-based pagination.
  3. Browser Automation with Playwright — Render pages in a headless browser to handle infinite scroll, dynamic content, and login walls.

All three methods can also be used to download the actual .mp4 video files — I cover that in a dedicated section after the method walkthroughs. A full comparison table comes at the end so you can make an informed decision.

Method 1: Scrape TikTok Videos Using Hidden JSON (Beginner-Friendly)

This is the approach I recommend starting with. TikTok embeds a massive JSON blob inside a <script> tag with the id __UNIVERSAL_DATA_FOR_REHYDRATION__ on virtually every page load. This blob contains all the profile and video data that the front-end JavaScript would normally render — which means you can grab it with a single HTTP request, no browser required.

What You Need

  • Python 3.8+
  • requests (or httpx)
  • beautifulsoup4 (or parsel)
  • Proper headers: User-Agent, Referer, Accept-Language

Install the dependencies:

1pip install requests beautifulsoup4

Step-by-Step: Extract TikTok Video Data from the Script Tag

Step 1: Send a GET request with realistic browser headers.

This is where most beginners fail. If you send a bare requests.get() without headers, TikTok returns a 403 or a CAPTCHA page. You need at minimum a current browser User-Agent and a Referer header.

1import requests
2from bs4 import BeautifulSoup
3import json
4url = "https://www.tiktok.com/@charlidamelio"
5headers = {
6    "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36",
7    "Referer": "https://www.tiktok.com/",
8    "Accept-Language": "en-US,en;q=0.9",
9}
10resp = requests.get(url, headers=headers)

Step 2: Parse the HTML and locate the hydration script tag.

1soup = BeautifulSoup(resp.text, "html.parser")
2script_tag = soup.find("script", id="__UNIVERSAL_DATA_FOR_REHYDRATION__")

If script_tag is None, TikTok either blocked you (check the status code) or changed the tag ID (rare but possible).

Step 3: Load the script content as JSON.

1data = json.loads(script_tag.string)

Step 4: Navigate the JSON structure to extract video metadata.

The structure nests under __DEFAULT_SCOPE__. For a user profile page:

1user_detail = data["__DEFAULT_SCOPE__"]["webapp.user-detail"]
2user_info = user_detail["userInfo"]
3# Profile stats
4stats = user_info["stats"]
5print(f"Followers: {stats['followerCount']}, Likes: {stats['heartCount']}")
6# Video list (first page of videos)
7item_list = user_detail.get("itemList", [])
8for video in item_list:
9    print(video["desc"])  # Caption
10    print(video["stats"]["playCount"])  # Views
11    print(video["video"]["playAddr"])  # Video download URL (no watermark)
12    print(video["video"]["downloadAddr"])  # Video download URL (with watermark)

Step 5: Extract video download URLs.

The playAddr field typically provides a cleaner version of the video (often without the TikTok watermark overlay), while downloadAddr includes the standard watermark. Both are direct URLs to the .mp4 file — but they require specific headers to download (covered in the download section below).

You should now have a list of video metadata objects, each containing the caption, stats, creation time, hashtags (in challenges[] and textExtra), and direct video URLs.

Limitations of the Hidden JSON Method

  • Only captures data from the initial page load — typically the first ~30 videos on a profile
  • Cannot handle infinite scroll or pagination (there's no "next page" to request)
  • If TikTok changes the script tag ID or the JSON structure, the parser breaks (this happens periodically — helps catch it early)
  • Best for: quick profile scrapes, one-off data pulls, or when you only need the most recent videos

Method 2: Scrape TikTok Videos via the Internal API

TikTok's front-end doesn't load all videos at once — it makes XHR calls to internal API endpoints as you scroll. The main one for user videos is /api/post/item_list/. You can call this endpoint directly from Python, which gives you cursor-based pagination and access to all videos on a profile (not just the first page).

How to Find the Internal API Endpoint

Open Chrome DevTools on a TikTok profile page, go to the Network tab, filter by XHR, and scroll down. You'll see requests to URLs like:

1https://www.tiktok.com/api/post/item_list/?WebIdLastTime=...&aid=1988&count=35&cursor=0&secUid=...

The key parameters are:

  • secUid — the profile's unique ID (you can extract this from Method 1's JSON, under userInfo.user.secUid)
  • cursor — pagination offset (starts at 0, each response returns the next cursor value)
  • count — number of items per page (typically 30–35)

Step-by-Step: Query TikTok's Internal API with Python

Step 1: Get the secUid for the target profile.

You can grab this from the hidden JSON (Method 1) or from the profile page's HTML.

Step 2: Build and send the API request.

1import requests
2import json
3sec_uid = "MS4wLjABAAAA..."  # From Method 1
4api_url = "https://www.tiktok.com/api/post/item_list/"
5params = {
6    "aid": "1988",
7    "secUid": sec_uid,
8    "count": 35,
9    "cursor": 0,
10}
11headers = {
12    "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36",
13    "Referer": "https://www.tiktok.com/",
14}
15resp = requests.get(api_url, params=params, headers=headers)
16data = resp.json()

Step 3: Parse the response.

Each item in data["itemList"] contains the same video structure as Method 1 — desc, stats, video.playAddr, video.downloadAddr, etc.

Step 4: Paginate through all videos.

1all_videos = []
2cursor = 0
3has_more = True
4while has_more:
5    params["cursor"] = cursor
6    resp = requests.get(api_url, params=params, headers=headers)
7    data = resp.json()
8    items = data.get("itemList", [])
9    all_videos.extend(items)
10    has_more = data.get("hasMore", False)
11    cursor = data.get("cursor", 0)
12    print(f"Fetched {len(items)} videos, total: {len(all_videos)}, hasMore: {has_more}")
13print(f"Total videos scraped: {len(all_videos)}")

Each iteration returns the next batch and a new cursor. The loop continues until hasMore is False.

Limitations of the Internal API Method

  • TikTok changes these endpoints and required parameters frequently — this is the highest-maintenance method. In recent months, some requests have started requiring msToken, X-Bogus, or other signature parameters that are generated by TikTok's (spoiler: replicating that in pure Python is non-trivial).
  • May require session cookies or additional tokens for certain data types
  • IP-based rate limiting still applies — proxy rotation is recommended
  • If you start getting empty itemList arrays, your msToken is likely stale (it rotates roughly every 10 seconds in the browser)
  • Best for: bulk data extraction when you need all videos from a profile and Method 1's first-page-only limitation won't cut it

Method 3: Scrape TikTok Videos with Playwright (Browser Automation)

When the first two methods hit walls — login requirements, CAPTCHAs, or signature parameters you can't replicate — Playwright is the fallback. It launches a real (headless) browser, navigates TikTok like a human user, and can handle JavaScript rendering, infinite scroll, and even authenticated sessions.

Setting Up Playwright for TikTok Scraping

Install Playwright and its browser binaries:

1pip install playwright
2playwright install firefox

I recommend Firefox over Chromium for TikTok scraping. Community testing consistently shows with Firefox, and TikTok's bot detection is particularly aggressive against Chromium-based headless browsers.

For additional stealth, consider pairing Playwright with (a patched Playwright fork) or (Firefox modified at the C++ level for anti-detection). In , Camoufox achieves near-perfect stealth scores against major bot detection services.

Step-by-Step: Scrape TikTok Profile Videos with Playwright

Step 1: Launch a headless Firefox browser and navigate to the profile.

1import asyncio
2from playwright.async_api import async_playwright
3import json
4async def scrape_tiktok_profile(username):
5    async with async_playwright() as p:
6        browser = await p.firefox.launch(headless=True)
7        context = await browser.new_context(
8            user_agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:124.0) Gecko/20100101 Firefox/124.0",
9            viewport={"width": 1280, "height": 720},
10        )
11        page = await context.new_page()
12        await page.goto(f"https://www.tiktok.com/@{username}", wait_until="networkidle")

Step 2: Wait for the video grid to load.

1        # Wait for video items to appear
2        await page.wait_for_selector('[data-e2e="user-post-item"]', timeout=15000)

If TikTok shows a "Something went wrong" overlay, you may need to click a retry button:

1        retry_btn = page.locator('button:has-text("Retry")')
2        if await retry_btn.count() &gt; 0:
3            await retry_btn.click()
4            await page.wait_for_selector('[data-e2e="user-post-item"]', timeout=15000)

Step 3: Extract data from the hidden JSON (even in Playwright).

The most reliable approach is still to grab the hydration JSON, even when using a browser:

1        script_el = page.locator("#__UNIVERSAL_DATA_FOR_REHYDRATION__")
2        raw_json = await script_el.inner_text()
3        data = json.loads(raw_json)
4        # Same JSON navigation as Method 1
5        user_detail = data["__DEFAULT_SCOPE__"]["webapp.user-detail"]
6        videos = user_detail.get("itemList", [])

Step 4: Handle infinite scroll for more videos.

If you need more than the initial ~30 videos, scroll down and capture additional XHR responses:

1        all_videos = list(videos)
2        # Intercept API responses as we scroll
3        api_responses = []
4        async def capture_response(response):
5            if "/api/post/item_list" in response.url:
6                try:
7                    body = await response.json()
8                    api_responses.append(body)
9                except:
10                    pass
11        page.on("response", capture_response)
12        # Scroll down to trigger more loads
13        for _ in range(5):  # Adjust scroll count as needed
14            await page.evaluate("window.scrollTo(0, document.body.scrollHeight)")
15            await asyncio.sleep(2)
16        # Collect videos from intercepted responses
17        for api_resp in api_responses:
18            items = api_resp.get("itemList", [])
19            all_videos.extend(items)
20        print(f"Total videos: {len(all_videos)}")
21        await browser.close()
22        return all_videos
23# Run it
24videos = asyncio.run(scrape_tiktok_profile("charlidamelio"))

You should now have a list of video objects from both the initial page load and any additional pages loaded via scrolling.

Limitations of the Playwright Method

  • Slowest method by far (full page render, network round-trips, scroll delays)
  • Higher resource consumption — each browser instance uses significant memory and CPU
  • Still subject to IP-based blocking at scale — pair with proxy rotation
  • Best for: complex interactions, login-walled content, handling CAPTCHAs, or when Methods 1 and 2 are blocked

How to Download TikTok Videos (.mp4) with Python

This is the section that fills the biggest gap in every other TikTok scraping tutorial. Extracting metadata is useful, but most people searching "scrape TikTok videos" want the actual video files.

TikTok embeds download URLs in the video data object:

  • playAddr — typically the no-watermark or lower-watermark version
  • downloadAddr — the version TikTok intends for in-app download (includes the TikTok watermark overlay)

Both URLs are time-sensitive and expire after a short window (usually a few hours), so you need to download promptly after extracting them.

Step-by-Step: Download a TikTok Video File

Step 1: Extract the video URL from any of the three methods above.

1video_url = video["video"]["playAddr"]  # No-watermark version
2# or
3video_url = video["video"]["downloadAddr"]  # With watermark

Step 2: Send a GET request with the right headers.

This is the step that trips people up. If you just requests.get(video_url), you'll get a 403. TikTok checks the Referer header and expects a browser-like User-Agent.

1import requests
2headers = {
3    "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36",
4    "Referer": "https://www.tiktok.com/",
5}
6resp = requests.get(video_url, headers=headers, stream=True)

Step 3: Write the response content to an .mp4 file.

Use stream=True and write in chunks — TikTok videos can be large, and you don't want to load the entire file into memory:

1video_id = video["id"]
2filename = f"tiktok_{video_id}.mp4"
3with open(filename, "wb") as f:
4    for chunk in resp.iter_content(chunk_size=1024 * 1024):  # 1MB chunks
5        if chunk:
6            f.write(chunk)
7print(f"Downloaded: {filename}")

You should now have a playable .mp4 file on your local machine.

Watermark vs. No-Watermark Downloads

TikTok stores both watermarked and non-watermarked versions of each video. The playAddr URL often provides a cleaner version (the one the player uses), while downloadAddr includes the TikTok watermark overlay with the creator's username.

A quick note on the ethics here: the watermark exists to credit the creator. If you're downloading videos for research, analysis, or internal review, using the playAddr is generally fine. If you're redistributing or reposting the content, removing creator attribution raises both ethical and copyright concerns. More on this in the legal section below.

For a more robust download pipeline, consider — its TikTok extractor handles signature math and URL resolution automatically, so you don't have to manage headers and token expiration yourself.

Side-by-Side: Which Python Method Should You Use?

Here's the comparison table I wish existed when I started working on TikTok scraping projects:

| Criteria | Method 1: Hidden JSON | Method 2: Internal API | Method 3: Playwright | |---|---|---|---| | Difficulty | Beginner | Intermediate | Intermediate | | Speed | Fast (1 request per page) | Fast (JSON API) | Slow (full page render) | | Anti-bot resilience | Medium | Low (endpoints change) | High (mimics real browser) | | Downloads video .mp4? | Yes (extract playAddr) | Yes (URL in response) | Yes (intercept network) | | Handles infinite scroll | No (first page only) | Yes (cursor pagination) | Yes (scroll simulation) | | Proxy needed at scale | Yes | Yes | Yes | | Maintenance required | Medium (JSON structure changes) | High (endpoints/signatures change frequently) | Low-Medium (browser adapts) | | Best for | Quick one-off profile scrapes | Bulk data extraction, all videos | Login-walled or complex content |

My recommendation:

  • Just need a quick snapshot of one profile? Start with Method 1. It takes about 30 seconds to set up and returns data in under a second per page.
  • Need all videos from a profile with pagination? Method 2 is the way to go, but be prepared for maintenance when TikTok changes its API parameters.
  • Dealing with login walls, CAPTCHAs, or need maximum resilience? Method 3 with Playwright. It's slower and heavier, but it's the hardest for TikTok to block.

In practice, I often start with Method 1 and only escalate to Method 2 or 3 when I hit limitations. That keeps the infrastructure simple and the cost low.

Don't Need Python? Scrape TikTok Videos with No-Code Tools

A lot of people searching "scrape TikTok videos with Python" don't actually need Python. They need the data. If you're a marketing analyst who wants video metadata from a few competitor profiles, or a brand manager tracking mentions, setting up a Python environment with proxy rotation and signature handling is overkill.

python-vs-nocode-ai-comparison.webp

Here's an honest comparison of approaches:

| Approach | Skill Level | Cost | Maintenance | Best For | |---|---|---|---|---| | Python (DIY) | Intermediate+ | Free (+ proxy costs) | High (scripts break) | Full control, custom pipelines | | (Chrome extension) | Beginner | Free tier available | None (AI reads site fresh each time) | Quick video data extraction, export to Sheets/Excel | | Apify TikTok Scraper | Beginner | Paid (per-run) | Low (maintained by Apify) | Bulk automated runs on schedule | | TikAPI | Developer | Paid subscription | Medium | Building apps on top of TikTok data |

How Thunderbit Handles TikTok Scraping

is the AI web scraper we built at Thunderbit, and it works differently from traditional scraping tools. Instead of relying on pre-built CSS selectors or XPath rules (which break every time TikTok changes its layout), Thunderbit's AI reads the page structure fresh each time and suggests relevant columns — caption, likes, hashtags, video URL, author, etc.

The workflow is genuinely two clicks:

  1. Navigate to a TikTok profile in Chrome, click the Thunderbit extension, and hit "AI Suggest Fields." Thunderbit scans the page and proposes a table structure.
  2. Review the suggested columns, adjust if needed, and click "Scrape."

The data exports directly to Google Sheets, Excel, Airtable, or Notion. No CSS selectors to maintain, no code to debug, no proxy configuration. For the marketing analyst who needs video metadata from a handful of profiles, this is measurably faster than setting up a Python environment — and it doesn't break when TikTok updates its front-end (which, based on community reports, happens every few weeks).

Thunderbit also supports — it can visit each individual video page to enrich your data table with additional details like full comment counts, music info, or video duration.

You can try it free via the . For more on how it works, check our .

Zero of the top-ranking tutorials on this topic discuss legality, which is a notable omission given that TikTok has actively pursued legal action against scraping services. Here's what you need to know.

TikTok's Terms of Service (§ 4.1) explicitly prohibit automated access. Violating a TOS is a breach of contract, not a criminal offense — but it can result in account bans, IP blocks, or civil action.

The legal landscape is more permissive than many assume for public data. The leading precedent is Meta Platforms v. Bright Data (N.D. Cal., Jan 2024), where the court held that scraping publicly accessible data while logged out does not violate Meta's Terms of Service. Meta dropped the case and waived appeal. The earlier hiQ v. LinkedIn Ninth Circuit ruling (reaffirmed post-Van Buren) established that scraping publicly accessible data is not a CFAA violation — though hiQ ultimately settled, paid $500K, and agreed to a permanent injunction, which shows that TOS enforcement can still bite.

GDPR and CCPA apply if you're collecting personal data from EU or California users. Scraping public posts is one thing; building databases of individual users' personal information is another.

Practical guidelines:

  • Rate-limit your requests (don't hammer TikTok's servers)
  • Don't scrape private accounts or content from minors
  • Don't redistribute copyrighted video content commercially
  • Respect robots.txt (TikTok's disallows most automated crawling)
  • Downloading videos for personal research or analysis is different from reposting them — understand the distinction

Disclaimer: This is educational content, not legal advice. If you're building a commercial product on scraped TikTok data, consult a lawyer.

Wrapping Up: Key Takeaways

TikTok scraping in 2025 is a moving target. The platform's anti-bot stack is among the most sophisticated on the web, and naive approaches (plain requests, ChatGPT-generated snippets, outdated tutorials) will fail. But with the right method, it's entirely doable.

Here's what to take away:

  • Method 1 (Hidden JSON) is the fastest and simplest — start here for quick profile scrapes.
  • Method 2 (Internal API) gives you pagination and bulk access, but requires the most maintenance as endpoints and signature requirements change.
  • Method 3 (Playwright) is the most resilient against anti-bot measures, at the cost of speed and resource consumption.
  • All three methods can extract video download URLs — and this guide is the only one that walks you through actually downloading the .mp4 files with proper headers.
  • For non-technical users, offers a genuinely faster path to the same data without writing or maintaining code. Its AI-based approach means it doesn't break when TikTok changes its layout — which, based on community reports, happens more often than anyone would like.

If you want to get started without any Python setup, — the free tier is enough to test it on a few profiles and see if it fits your workflow. For those going the Python route, start with Method 1, validate your data, and scale up from there.

Want to go deeper on web scraping techniques? Check out our guides on , , and .

FAQs

Scraping publicly accessible data is a legal gray area, not a clear-cut violation. The Meta v. Bright Data (2024) ruling supports the position that logged-out scraping of public data doesn't violate platform Terms of Service. However, TikTok's TOS explicitly prohibits automated access, and GDPR/CCPA obligations apply to personal data. It's not illegal in the way most people fear, but it's not risk-free either. Consult a legal professional for your specific use case.

What is the best Python library for TikTok scraping?

It depends on your approach. For hidden JSON extraction (Method 1), requests + beautifulsoup4 is all you need. For internal API calls (Method 2), requests or httpx works. For browser automation (Method 3), playwright is the current standard — it's overtaken Selenium in adoption for new scraping projects, with compared to Selenium's ~53 million. The TikTok-Api wrapper (~6.3K GitHub stars) is also worth considering if you want a higher-level interface, though it can be fragile.

Can I download TikTok videos without a watermark using Python?

Yes. TikTok's own data includes a playAddr URL that typically provides a version of the video without the standard watermark overlay. This guide shows how to extract that URL from any of the three methods and download the .mp4 file with proper headers. The downloadAddr field, by contrast, includes the watermark.

Why does my TikTok scraper return empty data?

The most common cause is that TikTok requires JavaScript to render content. A basic requests.get() only fetches the shell HTML — the actual data is either in a hidden JSON script tag (Method 1) or loaded dynamically via JavaScript (Method 3). If you're getting empty HTML, try Method 1 first. If that fails, check your headers (missing Referer is the #1 cause of 403 errors) or escalate to Method 3 with Playwright.

How do I avoid getting blocked when scraping TikTok?

Use realistic browser headers (including User-Agent, Referer, and Accept-Language), rotate residential or mobile proxies (datacenter IPs are flagged within minutes), add random delays between requests (1–3 seconds minimum), and avoid scraping at extremely high volumes. Method 3 (Playwright) offers the highest resilience against blocking because it mimics a real browser session. For any serious volume, budget for proxy costs — entry-tier residential proxies run about from major providers.

Try Thunderbit for TikTok scraping
Shuai Guan
Shuai Guan
Co-founder/CEO @ Thunderbit. Passionate about cross section of AI and Automation. He's a big advocate of automation and loves making it more accessible to everyone. Beyond tech, he channels his creativity through a passion for photography, capturing stories one picture at a time.
Topics
Scrape Tiktok pythonTiktok data extraction pythonPython Tiktok scraper scriptHow to scrape Tiktok videos with python
Table of Contents

Try Thunderbit

Scrape leads & other data in just 2-clicks. Powered by AI.

Get Thunderbit It's free
Extract Data using AI
Easily transfer data to Google Sheets, Airtable, or Notion
PRODUCT HUNT#1 Product of the Week