Skip to content

Get Candles

GET/v1/cryptodata/hyperliquid/candles

OHLCV candles for a coin — trailing ``limit`` bars, or an explicit range. **These are Hyperliquid's own bars** (``candleSnapshot``) — the execution truth for an HL book: signal, size and mark a Hyperliquid position from this series. ``/api/v1/backtesting/klines`` is our archive of the same venue's 1m bars for deep history, not a second price source. For several coins at once use ``/hyperliquid/candles/batch``. ``coin`` is HL's own name, matched case-insensitively (``symbol`` is accepted as an alias, and a ``USDT`` / ``-PERP`` suffix is tolerated). A name HL does not list is a 400 ``unknown_coin`` and an unrecognised query parameter a 400 ``unknown_parameter`` — never a silent default-coin reply. ``atr=14`` adds a Wilder ATR to every bar (``atr``; null for the first ``atr`` bars) computed on this exact series, so every agent uses the same number. The LAST bar is usually still forming: ``forming_bar_timestamp`` names it (null when the last bar has closed) — drop it, and its ``atr``, for completed-bar signals. Pass ``start`` (and optionally ``end``) as epoch milliseconds or ISO-8601 to fetch a fixed window instead of the trailing ``limit``; ranges longer than one candleSnapshot page are paginated, up to **15,000 bars** per call (400 above that — narrow the window or step the interval up). Explicit ranges bypass the 60s response cache and spend live HL weight (20 per 1,500-bar page), so poll them sparingly. **Retention is Hyperliquid's, not ours:** HL keeps only its most recent ~5,000 bars of each interval (about 3.5 days of 1m, 17 days of 5m, 7 months of 1h); the part of a range older than that returns no bars. For multi-month 1m history use ``/api/v1/backtesting/klines?exchange=hyperliquid&start=&end=`` (our own archive, local from 2026-05-09). ``start`` / ``end`` in the response echo the resolved window (ms) for a range request and are null for a trailing pull.

Price

$0.01/ call

Edge cache

Off

Uptime 24h

100.00%

p95

1.67s

MCP tool

cryptodata_hyperliquid-candles

Parameters

NameInTypeDescription
coin query string HL coin name, e.g. BTC, SOL, kPEPE (default BTC)
symbol query string Alias for `coin` (the rest of the API says `symbol`). Send one or the other.
interval query string = 1h
limit query integer = 200
start query string Range start — epoch ms or ISO-8601. With `start`/`end` the trailing `limit` is ignored; the range is capped at 15,000 bars.
end query string Range end — epoch ms or ISO-8601 (default: now)
atr query integer Add a Wilder ATR of this period to every bar as `atr` (e.g. 14). Null for the first `atr` bars of the window; pull at least ~10x the period for a converged value.

Code

curl
# 1. No key, no payment: the gateway answers 402 with the price
curl -i "https://api.realtimeapi.ai/v1/cryptodata/hyperliquid/candles"

# 2. Pay: retry with a signed x402 payment (any x402 client builds this header)
curl "https://api.realtimeapi.ai/v1/cryptodata/hyperliquid/candles" -H "PAYMENT-SIGNATURE: $X402_PAYMENT"
TypeScript · @x402/fetch
// npm i @x402/fetch @x402/core @x402/evm viem
import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { ExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";

const client = x402Client.fromConfig({ schemes: [{ network: "eip155:8453", client: new ExactEvmScheme(privateKeyToAccount(PRIVATE_KEY)) }] });
const pay = wrapFetchWithPayment(fetch, client);
const data = await (await pay("https://api.realtimeapi.ai/v1/cryptodata/hyperliquid/candles")).json();
console.log(data);
Python · x402
# pip install x402 eth-account requests
from eth_account import Account
from x402.clients.requests import x402_requests

session = x402_requests(Account.from_key(PRIVATE_KEY))
print(session.get("https://api.realtimeapi.ai/v1/cryptodata/hyperliquid/candles").json())
With an API key
curl "https://api.realtimeapi.ai/v1/cryptodata/hyperliquid/candles" -H "X-API-Key: $RTAPI_KEY"

Frequently asked questions

How do I get get candles from CryptoDataAPI?

Send GET https://api.realtimeapi.ai/v1/cryptodata/hyperliquid/candles. Pay $0.01 per request with x402, or send an X-API-Key header.

What does GET /hyperliquid/candles cost?

$0.01 per successful request in USDC on Base. Failed requests are never charged.

Can I call this endpoint from an MCP client?

Yes. Connect any MCP client to the RealtimeAPI server and use call_feed with this endpoint's URL, or get_quote to check the price first.

Get a free key

1,000 calls a month across every feed. Who is setting it up?

No key needed at all: agents can pay per call in USDC with x402.