Skip to main content
GET
/
v2
/
global_markets_perps
/
candles
Python (SDK)
from compass_api_sdk import CompassAPI, models


with CompassAPI(
    api_key_auth="<YOUR_API_KEY_HERE>",
) as compass_api:

    res = compass_api.global_markets_perps.global_markets_perps_candles(symbol="AAPL", interval=models.CandleInterval.ONEH, limit=200)

    # Handle response
    print(res)
{
  "candles": [
    {
      "close": "213.88",
      "high": "214.20",
      "low": "213.10",
      "open": "213.45",
      "time": 1747008000,
      "trades": 312,
      "volume": "1842.5"
    },
    {
      "close": "214.92",
      "high": "215.05",
      "low": "213.70",
      "open": "213.88",
      "time": 1747011600,
      "trades": 388,
      "volume": "2104.2"
    }
  ],
  "interval": "1h",
  "symbol": "AAPL"
}

Documentation Index

Fetch the complete documentation index at: https://docs.compasslabs.ai/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

x-api-key
string
header
required

Your Compass API Key. Get your key here.

Query Parameters

symbol
string
default:AAPL
required

Asset ticker (e.g. AAPL, GOLD, EUR). The xyz: HIP-3 DEX prefix is added server-side if not already present.

Required string length: 1 - 64
interval
enum<string>
default:1h
required

Candle interval: 1m, 5m, 15m, 1h, 4h, 1d, 1w

Available options:
1m,
5m,
15m,
1h,
4h,
1d,
1w
limit
integer
default:200

Number of candles to return (max 5000, capped by Hyperliquid).

Required range: 1 <= x <= 5000
start_time
integer | null

Optional start of the candle window in unix milliseconds. If omitted, computed as end_time - limit * interval.

end_time
integer | null

Optional end of the candle window in unix milliseconds. Defaults to now.

Response

Successful Response

OHLCV candle series for a single asset/interval.

symbol
string
required

Asset ticker the candles are for (without DEX prefix)

interval
string
required

Candle interval that was requested

candles
Candle · object[]
required

Candles ordered oldest → newest