Get Historical Market Candlesticks
curl --request GET \
--url https://external-api.kalshi.com/trade-api/v2/historical/markets/{ticker}/candlesticksimport requests
url = "https://external-api.kalshi.com/trade-api/v2/historical/markets/{ticker}/candlesticks"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://external-api.kalshi.com/trade-api/v2/historical/markets/{ticker}/candlesticks', 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://external-api.kalshi.com/trade-api/v2/historical/markets/{ticker}/candlesticks",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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://external-api.kalshi.com/trade-api/v2/historical/markets/{ticker}/candlesticks"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://external-api.kalshi.com/trade-api/v2/historical/markets/{ticker}/candlesticks")
.asString();require 'uri'
require 'net/http'
url = URI("https://external-api.kalshi.com/trade-api/v2/historical/markets/{ticker}/candlesticks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"ticker": "<string>",
"candlesticks": [
{
"end_period_ts": 123,
"yes_bid": {
"open": "0.5600",
"low": "0.5600",
"high": "0.5600",
"close": "0.5600"
},
"yes_ask": {
"open": "0.5600",
"low": "0.5600",
"high": "0.5600",
"close": "0.5600"
},
"price": {
"open": "0.5600",
"low": "0.5600",
"high": "0.5600",
"close": "0.5600",
"mean": "0.5600",
"previous": "0.5600"
},
"volume": "10.00",
"open_interest": "10.00"
}
]
}historical
Get Historical Market Candlesticks
Endpoint for fetching historical candlestick data for markets that have been archived from the live data set. Time period length of each candlestick in minutes. Valid values: 1 (1 minute), 60 (1 hour), 1440 (1 day).
GET
/
historical
/
markets
/
{ticker}
/
candlesticks
Get Historical Market Candlesticks
curl --request GET \
--url https://external-api.kalshi.com/trade-api/v2/historical/markets/{ticker}/candlesticksimport requests
url = "https://external-api.kalshi.com/trade-api/v2/historical/markets/{ticker}/candlesticks"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://external-api.kalshi.com/trade-api/v2/historical/markets/{ticker}/candlesticks', 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://external-api.kalshi.com/trade-api/v2/historical/markets/{ticker}/candlesticks",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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://external-api.kalshi.com/trade-api/v2/historical/markets/{ticker}/candlesticks"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://external-api.kalshi.com/trade-api/v2/historical/markets/{ticker}/candlesticks")
.asString();require 'uri'
require 'net/http'
url = URI("https://external-api.kalshi.com/trade-api/v2/historical/markets/{ticker}/candlesticks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"ticker": "<string>",
"candlesticks": [
{
"end_period_ts": 123,
"yes_bid": {
"open": "0.5600",
"low": "0.5600",
"high": "0.5600",
"close": "0.5600"
},
"yes_ask": {
"open": "0.5600",
"low": "0.5600",
"high": "0.5600",
"close": "0.5600"
},
"price": {
"open": "0.5600",
"low": "0.5600",
"high": "0.5600",
"close": "0.5600",
"mean": "0.5600",
"previous": "0.5600"
},
"volume": "10.00",
"open_interest": "10.00"
}
]
}Path Parameters
Market ticker - unique identifier for the specific market
Query Parameters
Start timestamp (Unix timestamp). Candlesticks will include those ending on or after this time.
End timestamp (Unix timestamp). Candlesticks will include those ending on or before this time.
Time period length of each candlestick in minutes. Valid values are 1 (1 minute), 60 (1 hour), or 1440 (1 day).
Available options:
1, 60, 1440