HL Data

Hyperliquid OHLCV data — web app, Python SDK, CLI

Three paths to Hyperliquid OHLCV data. Primary: backtest strategies in the Keel web app where data and caching are managed for you. Direct: the official hyperliquid-python-sdk for raw API pulls. Agent: the keel-trade CLI for terminal and AI-agent workflows. 15-minute price bars, 1-hour funding, ~220 perp markets.

By Keel Research Team · Updated May 18, 2026

The three paths

Primary: the Keel web app. Sign up, compose a pipeline in the visual builder, click Run Backtest — HL data and caching are handled server-side and you never touch a raw bar. This is the right path if you want to run a strategy and read a tearsheet, not maintain a data store.

Direct: the official Python SDK. The hyperliquid-python-sdk wraps the HL info endpoint directly — good if you want raw control over what you fetch, no caching opinion, no backtest-engine assumptions.

Agent: the keel-trade CLI. For terminal or AI-agent driven workflows, keel-trade (v0.1.6 on PyPI) runs the same backtests against the same managed data — no local cache, no raw bar plumbing.

Direct option: the official Python SDK

The SDK is installable from PyPI and ships against the live HL mainnet endpoint. The minimal pull for a single asset:

# pip install hyperliquid-python-sdk
from hyperliquid.info import Info
from hyperliquid.utils import constants
import time

info = Info(constants.MAINNET_API_URL, skip_ws=True)

# 15-minute candles for BTC, last ~30 days
end = int(time.time() * 1000)
start = end - 30 * 24 * 60 * 60 * 1000
candles = info.candles_snapshot(
    name="BTC",
    interval="15m",
    startTime=start,
    endTime=end,
)
# candles -> list of {t, T, s, i, o, h, l, c, v, n}

Each candle is a dict with t (open time ms), T (close time ms), o/h/l/c (prices), v (volume) and n (trade count). For the full HL perp universe, query info.meta() first to get the list of asset names, then loop over them with your own rate-limiting. The info endpoint is rate-limited per IP — back off on 429s and cache to disk after the first pull.

Agent option: the Keel CLI for terminal-driven backtests

If you drive Keel from a terminal or an AI agent — Claude Code, an MCP server, a research notebook — the keel-trade CLI runs the same backtests the web app does, server-side. Published as keel-trade v0.1.6 on PyPI on 2026-04-04. Install with pipx; authenticate once; submit a backtest. The HL data pull and caching are handled server-side, so you do not maintain a local data store.

# pipx install keel-trade   (keel-trade v0.1.6 on PyPI)

# Authenticate (one-time)
keel auth login

# Create a strategy on the platform
keel strategy create my_strategy.py

# Backtest — Keel handles the HL data pull and caching server-side
keel backtest run str_abc123 \
  --start-date 2024-08-15 \
  --end-date   2026-02-27

# Pull the results
keel backtest results bt_xyz789

Under the hood Keel stores OHLCV at 15-minute resolution, funding at 1-hour resolution, and open interest at 1-hour resolution, partitioned by asset for fast selective reads. You access the data indirectly: the components in your pipeline (price data loader, funding data loader, OI loader) consume the relevant series; the backtest result you pull with keel backtest results contains the equity curve, attribution, and per-asset stats.

Caveats worth knowing

  • History varies per asset. BTC and ETH go back to the HL public launch; a newer listing might have weeks. Check info.meta() for the listing universe and run your own history audit before assuming uniform coverage.
  • Newer listings have short funding history. If a regime detector needs 20 bars of funding context and the asset has 10, it will produce nothing useful for that asset until the history fills in. Keel does not impute.
  • Rate limits on the HL public API. The info endpoint is per-IP rate-limited. Acceptable for ad-hoc research, painful for a full-universe historical pull in a tight loop. Cache and back off on 429s.
  • Funding and OHLCV are separate endpoints. The SDK exposes them separately; the CLI fetches both. Keep them as separate series rather than merging — the cadences differ (15-minute price, hourly funding).
  • Bar-level only. The info endpoint does not serve historical tick or L2 data. Live websockets expose trades and order-book deltas in real time, but reconstructing tick history requires recording the stream yourself going forward.

Try it

Sign up and run your first HL backtest in the web app — managed data, no local cache. Prefer the SDK or the CLI? Both are linked from the reference.

FAQ

Common questions

What is the maximum history available?

It depends on the asset. HL listings have different launch dates — BTC and ETH go back to the venue’s public launch in mid-2023, while a newer listing may only have weeks of history. The HL public API does not expose a fixed lookback ceiling; the limit is when the asset was listed. For research, always check per-asset history before assuming a uniform sample.

What are the rate limits on the HL public API?

The official Hyperliquid info endpoint is rate-limited per IP. The published guidance is generous for normal use but will throttle if you hammer it for full-universe historical pulls in a loop. The pragmatic answer: cache to disk after the first pull, and back off on 429s. When you backtest through Keel, the platform handles the universe pull and caching for you, so subsequent runs against the same window do not re-hit the HL API.

Is funding data fetched separately?

Yes. OHLCV and funding are separate endpoints on the HL info API. The SDK exposes them as separate calls; Keel handles both when you backtest a strategy and aligns them in the pipeline. Funding is hourly, OHLCV is multi-resolution — keep them as separate series rather than merging into one frame, since the cadences differ.

Can I get tick-level data?

No. The Hyperliquid info endpoint exposes bar-level OHLCV and funding, not raw trades or full L2 snapshots over historical windows. Live websocket subscriptions expose trade and order-book deltas in real time, but reconstructing tick history from those streams requires recording the websocket yourself going forward. For most research purposes 15-minute bars are sufficient and what Keel ships against.

How do I cache OHLCV locally?

For ad-hoc scripts pulling raw bars yourself, the simplest pattern is: pull once, write to disk, partition by asset. If you are running strategies rather than inspecting raw bars, Keel handles caching for you — backtests reuse the universe pull across runs and only hit the HL API for newer bars at the tail.