
toktokdata
io.github.MKK-Platform/toktokdata
TikTok LIVE rankings, creators, LIVE sessions, gifters and agencies from toktokdata.live
Documentation
toktokdata.live SDKs, MCP server and samples
Official client libraries for the toktokdata.live API: TikTok LIVE rankings, creators, gifters, agencies, LIVE sessions, trends, alerts and exports.
Use an API key instead of hand-written HTTP calls: the SDKs add auth, retries, waiting for data that is still being collected, pagination and typed errors.
| Package | Install | Folder |
|---|---|---|
| TypeScript / JavaScript | npm install @toktokdata.live/sdk | js/ |
| Python | pip install toktokdata | python/ |
| Go | go get github.com/MKK-Platform/toktokdata-sdks/go | go/ |
| MCP server (Claude, Cursor, VS Code ...) | npx -y @toktokdata.live/mcp | mcp/ |
| Samples: cURL, TypeScript, Python, Go, Java, C#, PHP, Ruby | — | examples/ |
| OpenAPI 3 document | — | openapi/openapi.json |
Docs: https://toktokdata.live/docs · API reference: https://toktokdata.live/docs/reference
Get an API key
Sign in at https://toktokdata.live, open Settings → API keys and create a key with the
scopes you need. The key (ttk_live_...) is shown once. Keep it on the server side and pass it
through the environment:
export TOKTOKDATA_API_KEY=ttk_live_...
Quickstart
TypeScript
import { TokTokData } from '@toktokdata.live/sdk'
const client = new TokTokData() // reads TOKTOKDATA_API_KEY
const board = await client.rankings.official('hourly', { region: 'VN' })
console.log(board.data)
Python
from toktokdata import TokTokData
client = TokTokData() # reads TOKTOKDATA_API_KEY
board = client.rankings.official("hourly", region="VN")
print(board["data"])
Go
c, err := toktokdata.NewClient() // reads TOKTOKDATA_API_KEY
if err != nil {
log.Fatal(err)
}
board, err := c.Rankings.Official(ctx, "hourly", &toktokdata.RankingsOfficialParams{Region: "VN"})
MCP (Claude Desktop, claude_desktop_config.json)
{
"mcpServers": {
"toktokdata": {
"command": "npx",
"args": ["-y", "@toktokdata.live/mcp"],
"env": { "TOKTOKDATA_API_KEY": "ttk_live_..." }
}
}
}
Claude Code: claude mcp add toktokdata -e TOKTOKDATA_API_KEY=ttk_live_... -- npx -y @toktokdata.live/mcp.
More clients in mcp/README.md.
What every SDK does for you
Authorization: BearerfromTOKTOKDATA_API_KEY(or an explicit option).- Retries on
429and retryable5xx, honouringRetry-After; never on402(out of credits). - Waits on
202("still collecting") for creator lookups, follow lists, video comments and LIVE playback, up to three minutes. - Cursor pagination helpers.
- One error type with
status,code,message,requestId,retryableand, on a missing scope,requiredScope. - The last response's
X-RateLimit-*figures. - Webhook signature verification for alert rules (
x-toktokdata-signature).
The shared contract is in DESIGN.md.
Credits and limits
Every call spends credits from your workspace wallet and counts against your plan's request rate. See credits and rate limits.
Contributing and support
Bug reports and pull requests are welcome, see CONTRIBUTING.md. Security issues: SECURITY.md. Questions about your account or data: support@toktokdata.live.
License
Trust
@toktokdata.live/mcpnpm install @toktokdata.live/mcp