TikTok LIVE rankings API in 10 minutes: your first board with toktokdata.live
By
- toktokdata.live team · Data teamThe people who read the boards, run the crawlers and write the methodology.
Published
Reading time
5 min read
Ten minutes is enough to go from no account to a TikTok LIVE board in your terminal. This walkthrough makes one request to the toktokdata.live rankings API, reads the answer field by field and shows what the call costs. toktokdata.live is an independent product: this is its own REST API over the boards it observes, not an API of TikTok.
You need a toktokdata.live workspace (the Free plan is enough for this request), a terminal with curl and somewhere safe to keep a secret. Everything below comes from the public API docs; when a detail matters, the paragraph says which page it is on.
What does the TikTok LIVE rankings API return?
The API serves the same boards as the public rankings pages and the dashboard, as JSON. The base URL is https://api.toktokdata.live, and the endpoint for this guide is GET /v1/rankings/official: one board for one region, as TikTok publishes it.
A board is chosen with the board parameter. The region is a two-letter ISO country code and defaults to VN. GET /v1/rankings/regions lists the regions that currently have observed boards; the docs suggest caching that list for a day.
- daily and hourly
- popular_live
- gaming_daily and gaming_weekly
- shopping_daily and shopping_weekly, which also need the shop:read scope
- the league boards, league_a1 to league_d5
Step 1: create an API key (about three minutes)
Creating keys needs a role with keys:manage; workspace owners have it by default. Keep the key on a server: the get started page is explicit that a key must never ship in a browser bundle or a mobile app. If a frontend needs the board, put a small backend proxy in between and give its key only the scope it uses.
- Sign in to the dashboard and open Settings → API keys → Create key.
- Name the key and give it one scope: rank:read, which covers official leaderboards, regions and board history.
- Copy the secret straight into your secret manager. It is shown once; afterwards the dashboard lists only the prefix, which looks like ttk_live_ followed by an id.
- Export it in your shell as TOKTOKDATA_API_KEY.
Step 2: request your first board
Ask for the top ten of today's daily board for Vietnam:
curl "https://api.toktokdata.live/v1/rankings/official?board=daily®ion=VN&period=current&limit=10" -H "Authorization: Bearer $TOKTOKDATA_API_KEY"
The key travels in the Authorization header as a Bearer token. board is the only required parameter; period is current for the running period or history for the last completed one; limit accepts 1 to 200 and defaults to 200. Two optional filters, liveOnly and leagueTier, narrow the list to creators who are live right now or to one league tier.
If you would rather not write HTTP by hand, there are official SDKs for TypeScript and JavaScript (@toktokdata.live/sdk), Python (toktokdata) and Go. They send the header, retry what can be retried, follow pagination and raise one typed error. The response is the API's JSON, unchanged.
Step 3: read the response before you show it
Every successful answer has two objects: data and provenance. The docs ask you to treat provenance as part of the result, not as metadata, and the list below is the order to read the fields in.
Two cases surprise new integrations. An unknown or uncovered region is not an error: the answer is still 200, with publishable false and an empty list. And rows beyond what your plan unmasks keep their rank and score but come back with masked true, no identity and an unmaskTier field naming the plan that reveals them. On Free the leaderboards are masked; the pricing page shows what each plan unmasks.
- publishable: boards are reproduced only after coverage passes a gate. When it is false, entries is empty and provenance.coverageStatus says why.
- coverage: completeBoards against expectedBoards, that is, how many complete reads of the board stand behind the period.
- periodKey and resetAt: which period you are looking at and when it resets.
- entries: rank, score, uniqueId, nickname, isLive, leagueClass and movement for each row.
- provenance.observedAt: when the board was observed. Show it next to the numbers.
What does a rankings API call cost?
Reading a board is a cached read, and a cached read costs 1 credit. The credits come from the same workspace wallet the dashboard spends from, so API usage and dashboard usage appear together under Settings → Usage. The Free plan's wallet holds 150,000 credits a month.
The request rate is limited per key. On Free that is 1 request per second and 5,000 a day, with one active key. Going over the rate returns 429 with a Retry-After header; an empty wallet returns 402 with the code credit_cap_exceeded. A failed call is not charged.
Errors share one JSON envelope with four fields: code, message, requestId and retryable. Branch on code, log requestId and retry only when retryable is true. To stay well under the limits, the docs recommend caching a response for at least the board's refresh interval and using resetAt, not a fixed timer, to decide when to ask again.
Where to go after the first request
With one board working, the other rankings endpoints follow the same pattern.
Every parameter and a sample response for each are in the rankings reference. Start with the free workspace, one rank:read key and the request above; once the board prints in your terminal, decide what your product should do with it. The whole reference is public, so you can read it end to end before you create an account.
- GET /v1/rankings/history: completed periods of a board, newest first, within your plan's history window.
- GET /v1/rankings/day-bars: for each board day, how many creators the board listed, the lowest score on it and the top score.
- GET /v1/rankings/regions: the covered regions and the boards each one offers.
Questions
Frequently asked questions
Is this an official TikTok API?
No. toktokdata.live is an independent product and is not affiliated with TikTok or ByteDance. The API returns the boards toktokdata.live observes, with the observation time and the coverage attached to every answer.
Can I use the rankings API on the Free plan?
Yes. The Free plan can read cached boards through the API with one active key. Leaderboard rows are masked on Free: rank and score are returned, the creator's identity is not.
Why is the entries list empty?
Check publishable first. A board whose coverage has not passed the gate yet, or a region that is not covered, answers 200 with publishable false and no entries; provenance.coverageStatus gives the reason.