Skip to content

Build the /tl payload

POST
/tl
curl --request POST \
--url https://ksd.antibotapi.com/tl \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--data '{ "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.0.0 Safari/537.36", "script": "<base64 of the ips.js body>", "ips_link": "https://k.twitchcdn.net/149e9513-01fa-4fb0-aad4-566afd725d1b/2d206a39-8ed7-437e-a3be-862e0f06eea3/ips.js?KP_UIDz=2:AABbHF9l...&x-kpsdk-v=j-1.2.657&x-kpsdk-im=AALVrtI5...", "accept_language": "en-GB,en-US;q=0.9,en;q=0.8", "page_url": "https://www.twitch.tv/", "ip": "203.0.113.7" }'

Send the ips.js your session fetched and its link. Returns the x-kpsdk-* headers and the body for your POST /tl to the sensor. Billed per 200.

x-signature
string

A request signature. Required only when signing is on for your key. See Authentication.

Media typeapplication/json
object
user_agent
required

The User-Agent you will send, byte for byte. Chrome 100 or later on Windows; other browsers, Chromium forks (Edge, Opera, Brave, Vivaldi) and mobile user agents are refused with a 400.

string
script
required

The ips.js body exactly as served, Base64-encoded.

string
ips_link
required

The ips.js URL you fetched, query string included. Its host must be approved for your account.

string format: uri
accept_language
required

The Accept-Language header you send to the sensor, verbatim (the whole list, not one locale).

string
page_url

The page the sensor is embedded in, such as https://www.twitch.tv/. Optional but recommended.

string format: uri
ip

Your proxy’s exit IP. Sets the timezone the payload reports. Optional; without it the payload uses Europe/London.

string

Example

{
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.0.0 Safari/537.36",
"script": "<base64 of the ips.js body>",
"ips_link": "https://k.twitchcdn.net/149e9513-01fa-4fb0-aad4-566afd725d1b/2d206a39-8ed7-437e-a3be-862e0f06eea3/ips.js?KP_UIDz=2:AABbHF9l...&x-kpsdk-v=j-1.2.657&x-kpsdk-im=AALVrtI5...",
"accept_language": "en-GB,en-US;q=0.9,en;q=0.8",
"page_url": "https://www.twitch.tv/",
"ip": "203.0.113.7"
}

The headers and body for your /tl POST.

Media typeapplication/json
object
headers
required

x-kpsdk-* headers for your /tl POST, keyed by header name. Send ct, dt, im and v. Leave out the empty ones (r, dv, fc) and h.

object
x-kpsdk-ct
string
x-kpsdk-dt
string
x-kpsdk-v
string
x-kpsdk-r
string
x-kpsdk-dv
string
x-kpsdk-h
string
x-kpsdk-fc
string
x-kpsdk-im
string
payload
required

The /tl body, Base64. Decode it and post the raw bytes as application/octet-stream.

string

Example

{
"headers": {
"x-kpsdk-ct": "2:AABbHF9lHkY0dHJhbnNwb3J0LXRva2Vu...tXlKQ",
"x-kpsdk-dt": "145ky37w12g5hqz0b8...",
"x-kpsdk-v": "j-1.2.657",
"x-kpsdk-r": "",
"x-kpsdk-dv": "",
"x-kpsdk-h": "01",
"x-kpsdk-fc": "",
"x-kpsdk-im": "AALVrtI5A_dxWNuz...G6I"
},
"payload": "AAJCefs6KGHgAKpic3C7nFuW..."
}

The request is wrong, and the message says what: unreadable JSON, a script that is not Base64, an ips_link missing KP_UIDz, x-kpsdk-v or x-kpsdk-im, a malformed ip, or a user_agent that is not Chrome on Windows.

Media typeapplication/json
object
success
required
boolean
error
required
object
type
required
string
message
required

What went wrong.

string

Example

{
"success": false
}

The API key is missing, unknown, revoked or out of balance, or its signature is wrong.

Media typeapplication/json
object
success
required
boolean
error
required
object
type
required
string
message
required

What went wrong.

string

Example

{
"success": false
}

The host is not approved for your account. The message names it. Request it from the dashboard.

Media typeapplication/json
object
success
required
boolean
error
required
object
type
required
string
message
required

What went wrong.

string

Example

{
"success": false,
"error": {
"type": "validation",
"message": "site \"k.example.net\" is not in the whitelist"
}
}

The body is over 32 MB.

The script could not be solved. Almost always a stale script: fetch a fresh ips.js from your session and retry. Not billed.

Media typeapplication/json
object
success
required
boolean
error
required
object
type
required
string
message
required

What went wrong.

string

Example

{
"success": false
}