Proxy Polymarket's public trade-history API for one market
Thin proxy over Polymarket’s GET https://data-api.polymarket.com/trades, with a short-lived cache and Kairos-computed metrics appended.
Auth: identical model to /trades/kalshi — requires the trade:read scope (admin/JWT bypass the scope check; API keys need trade:read), plus API access to the polymarket platform being enabled for API-key callers (403 if disabled).
Market resolution: market may be a 0x-prefixed condition ID (used as-is) or a market/token identifier that is resolved to a condition ID via a cached metadata lookup, then a direct database lookup, and finally a live Polymarket API lookup as a last resort. If resolution never yields a value starting with 0x, the endpoint short-circuits and returns {"trades": [], "metrics": {}} without calling the upstream trades API.
Cache / data source: responses are cached briefly to de-duplicate bursts of identical requests. On a miss, calls the Polymarket Data API with the resolved condition_id as market. A non-2xx/network error returns 502.
Response shape: trades is the raw upstream trade array (client-side re-filtered by after against each trade’s timestamp as a safety net). metrics is computed over the filtered trades with a metrics window fixed at 24 hours; it groups trade value by outcome identifier (asset_id/outcome/token_id) and keeps only the top 2 outcomes by volume as an approximate outcome_0/outcome_1 split — this is an approximation, not a guaranteed yes/no mapping.
curl --request GET \
--url https://data.kairos.trade/trades/polymarket \
--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/polymarket"
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/polymarket', 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/polymarket",
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/polymarket"
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/polymarket")
.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/polymarket")
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": [
{
"proxyWallet": "<string>",
"side": "BUY",
"asset": "<string>",
"conditionId": "<string>",
"size": 123,
"price": 123,
"timestamp": 123,
"transactionHash": "<string>",
"outcome": "<string>"
}
],
"metrics": {}
}{
"detail": "<string>"
}{
"detail": "Not authenticated"
}{
"detail": "<string>"
}{
"detail": [
{}
]
}{
"error": "Rate limit exceeded: 100 per 1 minute"
}{
"detail": "Polymarket 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
Polymarket condition ID (0x...), market ID, or token ID. Non-0x values are resolved to a condition ID before querying upstream. Empty or >128 chars returns 400.
1 - 128Inclusive lower bound, Unix seconds. Passed to upstream and re-applied client-side against each trade's timestamp.
Inclusive upper bound, Unix seconds, passed to the upstream API.
Max trades returned, passed through to the upstream Polymarket API.
1 <= x <= 500Response
Raw Polymarket trades plus computed metrics. metrics is {} when the market value could not be resolved to a condition ID (no upstream call was made).
Was this page helpful?
curl --request GET \
--url https://data.kairos.trade/trades/polymarket \
--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/polymarket"
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/polymarket', 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/polymarket",
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/polymarket"
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/polymarket")
.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/polymarket")
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": [
{
"proxyWallet": "<string>",
"side": "BUY",
"asset": "<string>",
"conditionId": "<string>",
"size": 123,
"price": 123,
"timestamp": 123,
"transactionHash": "<string>",
"outcome": "<string>"
}
],
"metrics": {}
}{
"detail": "<string>"
}{
"detail": "Not authenticated"
}{
"detail": "<string>"
}{
"detail": [
{}
]
}{
"error": "Rate limit exceeded: 100 per 1 minute"
}{
"detail": "Polymarket API error"
}{
"detail": "Invalid provider"
}
