> ## Documentation Index
> Fetch the complete documentation index at: https://docs.spidra.io/llms.txt
> Use this file to discover all available pages before exploring further.

# TikTok

> Scrape TikTok profiles and videos as structured data, with exact counts, for 1 credit per page.

TikTok profile and video pages are read with a purpose-built **site rule** instead of a browser. You don't turn anything on: send a TikTok URL as usual and the rule is used automatically. A page costs 1 credit, and pages that can't be delivered are free.

Spidra reads TikTok the way a visitor who isn't signed in sees it. It never signs in, and it doesn't use cookies you pass for TikTok pages.

The rule steps aside when a request needs something only a browser can do: a screenshot, browser `actions`, `forEach` or an AI `instruction`. Those URLs use the normal browser flow.

## Page types

| Page type | Example | What you get |
| - | - | - |
| Profile | `tiktok.com/@nba` | The profile with exact counts, and its latest videos (up to 15) |
| Video or photo post | `tiktok.com/@tiktok/video/7694797676306615583` | The video with its stats, music, media links and subtitles |
| Embed and player links | `tiktok.com/embed/v2/7694797676306615583` | The same as a video |
| Short links | `vm.tiktok.com/...`, `vt.tiktok.com/...`, `tiktok.com/t/...` | Followed, then read as a profile or a video |
| Hashtag pages | `tiktok.com/tag/basketball` | Read with a real browser (slower), as the full page in markdown |

## Exact counts

TikTok shows rounded numbers on its pages to visitors who aren't signed in, such as 27.3M followers. Spidra returns the exact counts TikTok keeps alongside them, such as `"followers": 27302996`. Play counts are the one exception: TikTok rounds those everywhere, so `plays` can come back as `1100000`.

## Fields you get

Every field is optional on TikTok's side, so a missing value comes back as `null` or an empty list, never a guess.

| Page | Fields |
| - | - |
| Profile | `username`, `nickname`, `id`, `secUid`, `bio`, `bioLink`, `verified`, `privateAccount`, `isOrganization`, `seller`, `language`, `avatar`, `createdAt`, `followers`, `following`, `likes`, `videoCount`, `friends`, `recentVideos` |
| Video or photo post | `id`, `description`, `createdAt`, `author`, `plays`, `likes`, `comments`, `shares`, `saves`, `reposts`, `hashtags`, `mentions`, `isAd`, `isPhotoPost`, `images`, `duration`, `width`, `height`, `cover`, `playUrl`, `downloadUrl`, `subtitles`, `music`, `locationCreated`, `language`, `url` |

Each video in a profile's `recentVideos` has the same fields as a video page.

`playUrl`, `downloadUrl` and the subtitle links are TikTok's own media links. They expire after a while and may only play from the same network that read the page, so download what you need straight away.

## What comes back

* **`output: "json"` with no `prompt` or `schema`:** the structured data as is. No AI is used, so the cost is the base credit only.
* **`output: "markdown"`:** the whole page as markdown, followed by the structured data.
* **With a `prompt` or `schema`:** the AI reads a compact copy of the structured data instead of the whole page.

## Limits you should know about

* **Search and TikTok Shop pages** load their content only for signed-in members right now, so they come back blank. A blank page fails with a message and is not charged.
* **Comments** aren't included. TikTok doesn't show them to visitors who aren't signed in.
* **Hashtag pages** use the browser, so they take longer (about a minute) and return the page as markdown without structured fields.
* **Signed-in pages** such as messages and uploads are refused straight away and are not charged.
* **An account or video that doesn't exist**, or was made private, fails with a message and is not charged.

<Note>
  Check TikTok's terms and the data protection laws that apply to you before you scrape it. Profiles and videos contain personal data, which laws such as GDPR protect even when it is public, and some accounts belong to minors. You are responsible for how you use the data you collect. Spidra is not affiliated with TikTok.
</Note>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.