Get latest price
curl --request GET \
--url https://api.allium.so/api/v1/markets/{market_id}/{instrument}/price \
--header 'X-API-KEY: <api-key>'import requests
url = "https://api.allium.so/api/v1/markets/{market_id}/{instrument}/price"
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}/{instrument}/price', 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}/{instrument}/price",
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}/{instrument}/price"
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}/{instrument}/price")
.header("X-API-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.allium.so/api/v1/markets/{market_id}/{instrument}/price")
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{
"data": {
"market_id": "hl:perp:BTC-USDC",
"as_of": "2026-05-06T14:32:01.000000+00:00",
"mark": "104830.10",
"index": "104825.40",
"mid": "104831.20"
}
}Market Data
Get latest price
Latest price snapshot for a market.
GET
/
api
/
v1
/
markets
/
{market_id}
/
{instrument}
/
price
Get latest price
curl --request GET \
--url https://api.allium.so/api/v1/markets/{market_id}/{instrument}/price \
--header 'X-API-KEY: <api-key>'import requests
url = "https://api.allium.so/api/v1/markets/{market_id}/{instrument}/price"
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}/{instrument}/price', 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}/{instrument}/price",
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}/{instrument}/price"
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}/{instrument}/price")
.header("X-API-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.allium.so/api/v1/markets/{market_id}/{instrument}/price")
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{
"data": {
"market_id": "hl:perp:BTC-USDC",
"as_of": "2026-05-06T14:32:01.000000+00:00",
"mark": "104830.10",
"index": "104825.40",
"mid": "104831.20"
}
}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.
{instrument} path segment is perps or spot (and must be consistent with the market_id). The fields returned depend on the instrument class:
perps—mark,index(oracle/index price the perp tracks), andmid.spot—mid.
Freshness
A snapshot is served only if the market has ticked inside a per-venue window; otherwise the endpoint returns404. The window differs because venues publish
at very different cadences:
| Venue | Window |
|---|---|
Hyperliquid (hl, hl-*) | 5 minutes — every live market is repriced every few seconds |
| All other venues | 24 hours |
A returned
mark may therefore be up to 24 hours old on non-Hyperliquid
venues. as_of is the only staleness signal — check it if freshness
matters to your use case, rather than assuming the snapshot is current.The stamp is minute-grained.
as_of marks the start of the snapshot’s
minute bucket, so on a healthy, actively-repricing Hyperliquid market the
newest snapshot still reads 60-120 seconds old by its own stamp. That is the
endpoint’s grain, not pipeline lag - do not alarm on an as_of under two
minutes. For a sub-second live mark on Hyperliquid markets, poll
activeAssetData on the Hyperliquid info endpoint
instead; it serves the venue’s current mark on every request.404 here means “no tick inside the window”, which is not the same as an
unknown market — use the market-detail endpoint to distinguish the two. A
malformed market_id returns 400.
Coming soon
The following price fields are not yet returned and will be added for both perp and spot markets. To request prioritization, reach out to your account manager.last— last traded pricebest_bid— top-of-book best bidbest_ask— top-of-book best ask
Authorizations
Path Parameters
Canonical market slug, {venue}:{instrument_type}:{pair}.
Instrument class: perps or spot. Must be consistent with the market_id.
Available options:
perps, spot Response
200 - application/json
Latest price snapshot.
- Option 1
- Option 2
Show child attributes
Show child attributes
Was this page helpful?