Developer Docs

Quickstart

Mint a key and make your first authenticated request in a few minutes.

Make your first authenticated request in under ten minutes. You need a workspace and an API key.

1 · Create an API key

In the app, open Settings › Developer keys and create a key with the scopes you need (see Authentication). The secret ttk_live_… is shown once — store it now. Keep it in an environment variable:

shell
export TOKTIK_API_KEY=ttk_live_your_key_here

2 · Call the API

Every data route takes a bearer key. Here is an official rankings board:

cURL
curl 'https://api.toktik.io/v1/rankings/official?board=hourly&region=VN' \
  -H "Authorization: Bearer $TOKTIK_API_KEY"

The same call with the official SDKs:

JavaScript
import { TokTikClient } from "@toktik/sdk-js";

const client = new TokTikClient({ apiKey: process.env.TOKTIK_API_KEY! });
const board = await client.rankings.official({ board: "hourly", region: "VN" });

console.log(board.data.board);       // the ranked rows
console.log(board.provenance);       // freshness, source, coverageStatus — never stripped
Python
from toktik import TokTikClient

client = TokTikClient(api_key="ttk_live_...")
board = client.rankings.official(board="hourly", region="VN")

print(board["data"]["board"])        # the ranked rows
print(board["provenance"])           # freshness, source, coverageStatus

3 · Read the provenance

Every observed answer is wrapped as { data, provenance }. The provenance block tells you how fresh the answer is and how it was obtained — the SDKs never strip it. Track what you spend at GET /v1/usage, and your plan limits at GET /v1/entitlements.