Build the /tl payload
using System.Net.Http.Headers;var client = new HttpClient();var request = new HttpRequestMessage{ Method = HttpMethod.Post, RequestUri = new Uri("https://ksd.antibotapi.com/tl"), Headers = { { "x-api-key", "<x-api-key>" }, }, Content = new StringContent("{ \"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\" }") { Headers = { ContentType = new MediaTypeHeaderValue("application/json") } }};using (var response = await client.SendAsync(request)){ response.EnsureSuccessStatusCode(); var body = await response.Content.ReadAsStringAsync(); Console.WriteLine(body);}package main
import ( "fmt" "strings" "net/http" "io")
func main() {
url := "https://ksd.antibotapi.com/tl"
payload := strings.NewReader("{ \"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\" }")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<x-api-key>") req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close() body, _ := io.ReadAll(res.Body)
fmt.Println(res) fmt.Println(string(body))
}const url = 'https://ksd.antibotapi.com/tl';const options = { method: 'POST', headers: {'x-api-key': '<x-api-key>', 'Content-Type': 'application/json'}, body: '{"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"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”A request signature. Required only when signing is on for your key. See Authentication.
Request Bodyrequired
Section titled “Request Bodyrequired”object
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.
The ips.js body exactly as served, Base64-encoded.
The ips.js URL you fetched, query string included. Its host must be approved for your account.
The Accept-Language header you send to the sensor, verbatim (the whole list, not one locale).
The page the sensor is embedded in, such as https://www.twitch.tv/. Optional but recommended.
Your proxy’s exit IP. Sets the timezone the payload reports. Optional; without it the payload uses
Europe/London.
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"}Responses
Section titled “Responses”The headers and body for your /tl POST.
object
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
The /tl body, Base64. Decode it and post the raw bytes as application/octet-stream.
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.
object
object
What went wrong.
Example
{ "success": false}The API key is missing, unknown, revoked or out of balance, or its signature is wrong.
object
object
What went wrong.
Example
{ "success": false}The host is not approved for your account. The message names it. Request it from the dashboard.
object
object
What went wrong.
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.
object
object
What went wrong.
Example
{ "success": false}