Skip to content

GET /v1/ohlcv

GET https://api.hypquant.com/v1/ohlcv

Returns OHLCV candles for a single symbol. Requires an API key.


Parameters

Name Type Required Description
symbol string yes Trading pair, e.g. BTC-USDC
exchange string yes hyperliquid or binance
timeframe string yes 1m, 5m, 15m, 1h, 4h, 1d
start string yes Start time — ISO8601 or Unix milliseconds
end string no End time. Defaults to now
limit integer no Max rows (1–10,000). Default: 1,000

Tier restrictions

  • Free: 1h, 4h, 1d only; max 365 days per request.
  • Pro / Scale: all timeframes; no history cap.

Response

{
  "symbol": "BTC-USDC",
  "exchange": "hyperliquid",
  "timeframe": "1h",
  "count": 2,
  "data": [
    {
      "time": "2024-01-01T00:00:00+00:00",
      "open": "42285.000000",
      "high": "42320.500000",
      "low": "42180.000000",
      "close": "42289.000000",
      "volume": "1250.450000"
    },
    {
      "time": "2024-01-01T01:00:00+00:00",
      "open": "42289.000000",
      "high": "42500.000000",
      "low": "42200.000000",
      "close": "42450.000000",
      "volume": "980.100000"
    }
  ]
}

All numeric fields are returned as strings to preserve decimal precision. Cast to Float64 in your client.


Examples

from hypquant import MarketData

with MarketData(api_key="qp_...") as md:
    df = md.ohlcv(
        "BTC-USDC",
        exchange="hyperliquid",
        timeframe="1h",
        start="2024-01-01",
        end="2024-01-31",
        limit=5000,
    )
curl -H "X-API-Key: qp_..." \
  "https://api.hypquant.com/v1/ohlcv?symbol=BTC-USDC&exchange=hyperliquid&timeframe=1h&start=2024-01-01T00:00:00Z&limit=1000"
import requests, polars as pl

resp = requests.get(
    "https://api.hypquant.com/v1/ohlcv",
    headers={"X-API-Key": "qp_..."},
    params={
        "symbol": "BTC-USDC",
        "exchange": "hyperliquid",
        "timeframe": "1h",
        "start": "2024-01-01T00:00:00Z",
        "limit": 1000,
    },
)
resp.raise_for_status()
data = resp.json()["data"]
df = pl.DataFrame(data).with_columns([
    pl.col("time").str.to_datetime(time_unit="us", time_zone="UTC"),
    pl.col("open").cast(pl.Float64),
    pl.col("high").cast(pl.Float64),
    pl.col("low").cast(pl.Float64),
    pl.col("close").cast(pl.Float64),
    pl.col("volume").cast(pl.Float64),
])

Error responses

HTTP error code Cause
400 INVALID_TIMEFRAME Timeframe not in [1m, 5m, 15m, 1h, 4h, 1d]
400 INVALID_TIMESTAMP start or end could not be parsed
400 INVALID_TIME_RANGE start is after end
401 UNAUTHORIZED Missing or invalid API key
403 TIER_LIMIT_EXCEEDED Timeframe or history window requires a higher tier
429 RATE_LIMIT_EXCEEDED Daily or per-minute request quota reached