Get Market Candlesticks
curl --request GET \
--url https://external-api.kalshi.com/trade-api/v2/margin/markets/{ticker}/candlesticksimport requests
url = "https://external-api.kalshi.com/trade-api/v2/margin/markets/{ticker}/candlesticks"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://external-api.kalshi.com/trade-api/v2/margin/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/margin/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/margin/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/margin/markets/{ticker}/candlesticks")
.asString();require 'uri'
require 'net/http'
url = URI("https://external-api.kalshi.com/trade-api/v2/margin/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,
"bid": {
"open": "0.5600",
"low": "0.5600",
"high": "0.5600",
"close": "0.5600"
},
"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",
"volume_notional_value_dollars": "0.5600",
"open_interest": "10.00",
"open_interest_notional_value_dollars": "0.5600"
}
]
}{
"code": "<string>",
"message": "<string>",
"details": "<string>"
}{
"code": "<string>",
"message": "<string>",
"details": "<string>"
}{
"code": "<string>",
"message": "<string>",
"details": "<string>"
}market
Get Market Candlesticks
Endpoint for fetching candlestick data for a margin market.
GET
/
margin
/
markets
/
{ticker}
/
candlesticks
Get Market Candlesticks
curl --request GET \
--url https://external-api.kalshi.com/trade-api/v2/margin/markets/{ticker}/candlesticksimport requests
url = "https://external-api.kalshi.com/trade-api/v2/margin/markets/{ticker}/candlesticks"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://external-api.kalshi.com/trade-api/v2/margin/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/margin/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/margin/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/margin/markets/{ticker}/candlesticks")
.asString();require 'uri'
require 'net/http'
url = URI("https://external-api.kalshi.com/trade-api/v2/margin/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,
"bid": {
"open": "0.5600",
"low": "0.5600",
"high": "0.5600",
"close": "0.5600"
},
"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",
"volume_notional_value_dollars": "0.5600",
"open_interest": "10.00",
"open_interest_notional_value_dollars": "0.5600"
}
]
}{
"code": "<string>",
"message": "<string>",
"details": "<string>"
}{
"code": "<string>",
"message": "<string>",
"details": "<string>"
}{
"code": "<string>",
"message": "<string>",
"details": "<string>"
}Path Parameters
Ticker of the margin 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 If true, prepends the latest candlestick available before the start_ts. This synthetic candlestick is created by:
- Finding the most recent real candlestick before start_ts
- Projecting it forward to the first period boundary (calculated as the next period interval after start_ts)
- Setting all OHLC prices to null, and
price.previousto the close price from the real candlestick