Proxy Kalshi's public trade-history API for one market
Thin proxy over Kalshi’s GET /trade-api/v2/markets/trades, with a short-lived cache and Kairos-computed metrics appended.
Auth: requires the trade:read scope. Admin-secret and first-party JWT callers are always allowed through with no scope check. API-key callers must have trade:read in their credential’s scopes array, or this returns 403 (API key missing required scope: trade:read). API-key callers are additionally gated by the kalshi platform’s API access being enabled — if it’s disabled, this returns 403 regardless of scope.
Cache / data source: responses are cached briefly to de-duplicate bursts of identical requests, then fall through to the live Kalshi API at https://api.elections.kalshi.com/trade-api/v2/markets/trades. A Kalshi HTTP error (non-2xx or network failure) returns 502.
Response shape: the raw Kalshi API response object is returned unmodified except for an injected metrics field, computed over the locally time-filtered trades (filtering by min_ts/max_ts is done client-side against each trade’s created_time, since Kalshi’s API does not filter server-side beyond min_ts/max_ts passthrough). The metrics window is fixed at 24 hours regardless of the requested min_ts/max_ts span.
curl --request GET \
--url https://data.kairos.trade/trades/kalshi \
--header 'X-Api-Key: <api-key>' \
--header 'X-Api-Secret: <api-key>' \
--header 'X-Client-Id: <api-key>'import requests
url = "https://data.kairos.trade/trades/kalshi"
headers = {
"X-Client-Id": "<api-key>",
"X-Api-Key": "<api-key>",
"X-Api-Secret": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {
'X-Client-Id': '<api-key>',
'X-Api-Key': '<api-key>',
'X-Api-Secret': '<api-key>'
}
};
fetch('https://data.kairos.trade/trades/kalshi', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://data.kairos.trade/trades/kalshi",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-Api-Key: <api-key>",
"X-Api-Secret: <api-key>",
"X-Client-Id: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://data.kairos.trade/trades/kalshi"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Client-Id", "<api-key>")
req.Header.Add("X-Api-Key", "<api-key>")
req.Header.Add("X-Api-Secret", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://data.kairos.trade/trades/kalshi")
.header("X-Client-Id", "<api-key>")
.header("X-Api-Key", "<api-key>")
.header("X-Api-Secret", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://data.kairos.trade/trades/kalshi")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Client-Id"] = '<api-key>'
request["X-Api-Key"] = '<api-key>'
request["X-Api-Secret"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"trades": [
{
"trade_id": "<string>",
"ticker": "<string>",
"count": 123,
"created_time": "2023-11-07T05:31:56Z",
"yes_price": 123,
"no_price": 123,
"taker_side": true
}
],
"metrics": {
"volume_usd": 154320.55,
"outcome_0_volume_usd": 98210.1,
"outcome_1_volume_usd": 56110.45,
"outcome_0_pressure_pct": 63.65,
"trade_count": 842,
"window_seconds": 86400,
"coverage_pct": 100,
"source": "<string>",
"indexing": false
},
"cursor": "<string>"
}{
"detail": "<string>"
}{
"detail": "Not authenticated"
}{
"detail": "API key missing required scope: trade:read"
}{
"detail": [
{}
]
}{
"error": "Rate limit exceeded: 100 per 1 minute"
}{
"detail": "Kalshi API error"
}{
"detail": "Invalid provider"
}Authorizations
Credential client id (kairos_ck_...). Must be sent together with X-Api-Key and X-Api-Secret.
64-char hex API key.
64-char hex API secret.
Query Parameters
Kalshi market ticker. Empty or >128 chars returns 400.
1 - 128Inclusive lower bound, Unix seconds, applied both to the upstream request and to client-side filtering by created_time.
Inclusive upper bound, Unix seconds, applied both to the upstream request and to client-side filtering by created_time.
Max trades returned, passed through to the upstream Kalshi API.
1 <= x <= 500Upstream pagination cursor from a previous response. Blank strings are treated as absent; >512 chars returns 400.
512Response
Raw Kalshi trade-history payload plus a computed metrics object.
The raw Kalshi API response object, spread as-is, with a metrics field injected by Kairos. Any other fields Kalshi returns (e.g. a pagination cursor) pass through unchanged.
Show child attributes
Show child attributes
Aggregate volume/pressure metrics. Split by outcome (outcome_0 vs outcome_1), not by buy/sell direction — trade direction is not reliably derivable from every provider's exchange data.
Show child attributes
Show child attributes
Upstream pagination cursor, passed through when present.
Was this page helpful?
curl --request GET \
--url https://data.kairos.trade/trades/kalshi \
--header 'X-Api-Key: <api-key>' \
--header 'X-Api-Secret: <api-key>' \
--header 'X-Client-Id: <api-key>'import requests
url = "https://data.kairos.trade/trades/kalshi"
headers = {
"X-Client-Id": "<api-key>",
"X-Api-Key": "<api-key>",
"X-Api-Secret": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {
'X-Client-Id': '<api-key>',
'X-Api-Key': '<api-key>',
'X-Api-Secret': '<api-key>'
}
};
fetch('https://data.kairos.trade/trades/kalshi', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://data.kairos.trade/trades/kalshi",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-Api-Key: <api-key>",
"X-Api-Secret: <api-key>",
"X-Client-Id: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://data.kairos.trade/trades/kalshi"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Client-Id", "<api-key>")
req.Header.Add("X-Api-Key", "<api-key>")
req.Header.Add("X-Api-Secret", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://data.kairos.trade/trades/kalshi")
.header("X-Client-Id", "<api-key>")
.header("X-Api-Key", "<api-key>")
.header("X-Api-Secret", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://data.kairos.trade/trades/kalshi")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Client-Id"] = '<api-key>'
request["X-Api-Key"] = '<api-key>'
request["X-Api-Secret"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"trades": [
{
"trade_id": "<string>",
"ticker": "<string>",
"count": 123,
"created_time": "2023-11-07T05:31:56Z",
"yes_price": 123,
"no_price": 123,
"taker_side": true
}
],
"metrics": {
"volume_usd": 154320.55,
"outcome_0_volume_usd": 98210.1,
"outcome_1_volume_usd": 56110.45,
"outcome_0_pressure_pct": 63.65,
"trade_count": 842,
"window_seconds": 86400,
"coverage_pct": 100,
"source": "<string>",
"indexing": false
},
"cursor": "<string>"
}{
"detail": "<string>"
}{
"detail": "Not authenticated"
}{
"detail": "API key missing required scope: trade:read"
}{
"detail": [
{}
]
}{
"error": "Rate limit exceeded: 100 per 1 minute"
}{
"detail": "Kalshi API error"
}{
"detail": "Invalid provider"
}
