Get OHLCV candles
curl --request GET \
--url https://api.allium.so/api/v1/markets/{market_id}/ohlcv \
--header 'X-API-KEY: <api-key>'import requests
url = "https://api.allium.so/api/v1/markets/{market_id}/ohlcv"
headers = {"X-API-KEY": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-KEY': '<api-key>'}};
fetch('https://api.allium.so/api/v1/markets/{market_id}/ohlcv', 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://api.allium.so/api/v1/markets/{market_id}/ohlcv",
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>"
],
]);
$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://api.allium.so/api/v1/markets/{market_id}/ohlcv"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-KEY", "<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://api.allium.so/api/v1/markets/{market_id}/ohlcv")
.header("X-API-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.allium.so/api/v1/markets/{market_id}/ohlcv")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-KEY"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"items": [
{
"market_id": "hl:perp:BTC-USDC",
"interval": "1m",
"open_time": 1746057600000,
"close_time": 1746061199999,
"open": "104120.00",
"high": "104880.50",
"low": "103990.10",
"close": "104830.10",
"volume": "1842.35",
"trade_count": 1234
}
]
}Market Data
Get OHLCV candles
Historical open/high/low/close/volume candles for a market.
GET
/
api
/
v1
/
markets
/
{market_id}
/
ohlcv
Get OHLCV candles
curl --request GET \
--url https://api.allium.so/api/v1/markets/{market_id}/ohlcv \
--header 'X-API-KEY: <api-key>'import requests
url = "https://api.allium.so/api/v1/markets/{market_id}/ohlcv"
headers = {"X-API-KEY": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-KEY': '<api-key>'}};
fetch('https://api.allium.so/api/v1/markets/{market_id}/ohlcv', 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://api.allium.so/api/v1/markets/{market_id}/ohlcv",
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>"
],
]);
$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://api.allium.so/api/v1/markets/{market_id}/ohlcv"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-KEY", "<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://api.allium.so/api/v1/markets/{market_id}/ohlcv")
.header("X-API-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.allium.so/api/v1/markets/{market_id}/ohlcv")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-KEY"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"items": [
{
"market_id": "hl:perp:BTC-USDC",
"interval": "1m",
"open_time": 1746057600000,
"close_time": 1746061199999,
"open": "104120.00",
"high": "104880.50",
"low": "103990.10",
"close": "104830.10",
"volume": "1842.35",
"trade_count": 1234
}
]
}Alpha — The Market Data API is in alpha. Schema and response format may change. To request access, contact us or reach out to your account manager.
Notes
- Query window is capped at 5000 buckets per request, not by elapsed time — so the ceiling scales with
interval. A 30-day1dwindow is 30 buckets and fine; a 30-day1mwindow is 43,200 buckets and returns400. Walkstart_timestampforward to page through longer windows. limitdefaults to 500, below the bucket cap, and this endpoint returns no pagination cursor. A window spanning more buckets thanlimitis truncated with no next-page signal, so raiselimit(max 5000) when requesting a wide window.- Last bucket is mutable. If
end_timestampis “now”, the most recent candle keeps updating until its interval closes. Clients polling live data should refresh or discard the last bucket. - Empty buckets are omitted. Zero-volume intervals are not padded; interpolate client-side if you need a dense series.
volumeis base-asset volume, not USD notional.
Coming soon
volume_quote — quote-denominated (USD) volume — is not yet returned. For now, approximate it as volume × mid. To request prioritization, reach out to your account manager.Authorizations
Path Parameters
Canonical market slug, {venue}:{instrument_type}:{pair}.
Query Parameters
Candle interval.
Available options:
1m, 5m, 15m, 1h, 4h, 1d Start of the window (ISO 8601; naive datetimes treated as UTC).
End of the window (ISO 8601).
Maximum candles to return (1–5000).
Required range:
1 <= x <= 5000Response
200 - application/json
Candles, ascending by time.
Show child attributes
Show child attributes
Was this page helpful?