← All posts

How to Scrape TikTok Data: Videos, Comments, and Trends at Scale

If you want TikTok data at volume, there are exactly two paths worth taking, and they solve different problems. The official Research API gives you clean, sanctioned access to a slice of public content with strict eligibility rules. Public-page fetching gives you broad reach but drops you straight into signed URLs, aggressive anti-bot detection, and content that only exists after JavaScript runs. Most teams need a bit of both. Here is how each one actually behaves so you can pick the right tool before you write a line of code.

The Quick Answer

For research on public videos, comments, and hashtags where you qualify, use the TikTok Research API. It is compliant by design and returns structured JSON. For everything the Research API will not cover (competitor pages you do not own, trend monitoring across arbitrary URLs, ad-hoc collection) fetch the public web pages and parse them, using a service that handles rendering and anti-bot so you are not maintaining a browser fleet. Whatever you choose, only collect public data and read TikTok's Terms of Service first.

Path One: The Official Research API

TikTok runs a Research API aimed at academics and vetted organizations. When you qualify, it is the cleanest option available. You get query access to public videos, comments, user profiles, and hashtag data as structured fields, without touching HTML or fighting detection systems.

The catch is eligibility. Access has historically been gated to nonprofit academic institutions and approved researchers in specific regions, with an application process and usage terms attached. Commercial use is limited, rate caps apply, and you are bound by what the terms permit you to store and republish. A university lab studying engagement patterns will likely qualify; a startup that needs trend data for a product feature next week will probably find the door closed.

There is also a Commercial Content API and the ad-library style transparency tools for anyone specifically studying paid content. Those cover ads and promoted material, not the organic firehose most people mean when they say "scrape TikTok."

When the official API fits your use case, use it. It removes the hardest parts of this entire problem. The rest of this post is about what to do when it does not fit, which is most commercial situations.

Path Two: Fetching Public Pages

Public TikTok pages (a video URL, a profile, a hashtag page) are reachable without an account, so they are fair game for careful collection of public data. The problem is that "reachable" and "easy to parse" are very different things on TikTok specifically.

The page is rendered by JavaScript

Load a TikTok video URL with plain curl and you get a near-empty shell. The real content (video metadata, the comment list, the author stats) is injected by JavaScript after the initial HTML arrives, and some of it is fetched from internal APIs only after the app boots. If you never run that JavaScript, you never see the data. This is the same wall SPAs put up everywhere, and we covered the mechanics in how to scrape JavaScript-rendered websites. TikTok is a strong example of it.

The media lives behind signed URLs

Even once the page renders, the actual video and image files are served from a CDN behind signed, expiring URLs. Those links carry tokens tied to a timestamp and often to the requesting session. Copy one and paste it an hour later and it returns a 403. This is why naive scrapers grab a video URL, store it, and find every link dead the next morning. If you need the media itself and not just metadata, you have to resolve and download it inside the same session that produced the URL, before the token expires. For most analytics work you do not need the raw video file at all: the metadata, captions, comment text, and engagement counts are what carry the signal.

The anti-bot layer is real

TikTok invests heavily in detecting automation. Datacenter IP ranges get throttled or challenged, vanilla headless browsers get fingerprinted and blocked, and request patterns that look nonhuman trigger interstitials. Beating this reliably means real browser TLS fingerprints, residential IPs, believable request pacing, and stealth-configured browsers, then constant maintenance as the detection evolves. This is the same escalation ladder we break down in curl vs headless vs stealth browser. On TikTok you land near the top of that ladder more often than not.

Doing It Without Owning a Browser Fleet

You can build the stealth browser, proxy pool, and fingerprint rotation yourself. It works, and for a weekend project it is fine. At scale it becomes infrastructure you own forever: browser binaries to patch, memory to feed, selectors that break when the markup shifts, and a detection arms race that never ends. None of that is the thing you are actually building.

link.sc exists so you do not have to. It is one API to fetch and search anything online, built for LLMs and agents. You pass a URL and it returns clean markdown, structured JSON, raw HTML, or a screenshot. Rendering, proxies, retries, and anti-bot handling are done for you.

Under the hood it escalates cheapest-first: it starts with curl_cffi (fast HTTP with real browser TLS fingerprints), and if a page needs JavaScript it moves up to a stealth browser that renders with smart waits before extracting content. It also remembers which method each domain needs, so repeat requests on a site like TikTok skip straight to the approach that works.

curl -X POST https://api.link.sc/v1/fetch \
  -H "x-api-key: lsc_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://www.tiktok.com/@username/video/1234567890123456789",
    "format": "markdown"
  }'
import requests

resp = requests.post(
    "https://api.link.sc/v1/fetch",
    headers={"x-api-key": "lsc_YOUR_KEY"},
    json={
        "url": "https://www.tiktok.com/@username/video/1234567890123456789",
        "format": "json",
    },
)
data = resp.json()
print(data["content"])
const res = await fetch("https://api.link.sc/v1/fetch", {
  method: "POST",
  headers: {
    "x-api-key": "lsc_YOUR_KEY",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    url: "https://www.tiktok.com/tag/marketing",
    format: "markdown",
  }),
});
const { content } = await res.json();
console.log(content);

Ask for json when you want structured fields to pull captions, author, and counts out of; ask for markdown when you want readable text for an LLM to summarize; ask for screenshot when you want the visual. Because the media links are signed and short-lived, resolve any file you need in the same run rather than storing the URL for later.

Collecting Trends at Scale

Trend work is usually less about any single video and more about volume over time: which hashtags are climbing, which sounds recur, how engagement moves across a set of creators. The pattern that holds up is to fetch a defined list of hashtag and profile URLs on a schedule, parse the structured output, and store the fields you care about (caption, tags, view and like counts, timestamps) in your own database. Then you run trend analysis on your data, not on live pages. This keeps your request volume predictable, lets you pace politely, and means an expired signed URL never breaks your dataset because you already extracted the signal.

Staying Compliant

Scraping public data is generally lawful in many jurisdictions, but "generally lawful" is not the same as "anything goes." Read TikTok's Terms of Service, collect only public data, never scrape private accounts or anything behind a login, respect rate limits, and be careful with personal data under regimes like GDPR and CCPA. For the full picture, see is web scraping legal and our ethical web scraping guide. The short version: prefer the official API when you qualify, keep your footprint light and public, and do not build a product on data you are not allowed to store.

TikTok is one of the harder targets on the open web, but it is not a special case. It is JavaScript rendering, signed URLs, and anti-bot stacked together. Handle those three and the data is reachable. The only question is whether you want to own that machinery or the thing you are building on top of it.


Ready to pull TikTok pages without building a browser fleet? Get a free link.sc API key with 500 credits a month and start fetching in minutes.