Get Candles Batch
GET/v1/cryptodata/hyperliquid/candles/batch
Trailing OHLCV candles for up to 25 coins in ONE call — the same bars ``/hyperliquid/candles`` serves per coin, keyed by coin under ``series``. Trailing ``limit`` only; for an explicit ``start``/``end`` range use the single-coin route. Every coin must be in HL's universe (400 ``unknown_coin`` otherwise — nothing is silently dropped). On a cold cache a series that has not arrived within ~8s is listed in ``pending`` instead of holding the whole response, and ``retry_after_s`` says how long to wait (scaled to how many are still fetching): their fetches keep running and are cached, so retry just the ``pending`` coins after that. A cold coin costs Hyperliquid rate limit (~20 weight, whatever ``limit`` is), so a first pull of many coins takes a while and repeat pulls are instant; for a whole-universe scan that needs no candles at all, use ``/indicators/heatmap``. ``atr`` and ``forming_bar_timestamp`` behave as on ``/hyperliquid/candles``. The contract: ``complete`` is true iff every requested coin is in ``series``; a coin is never in both ``series`` and ``pending``. ``wait`` (0-25s, default 8) holds longer for a caller that prefers one call over a poll. ``closed_only=true`` returns the last ``limit`` COMPLETED bars — the read for a strategy that acts on a closed bar — and is served from any series fetched since the latest close, so the liquid coins pre-warmed just after each 4h close stay instant for the whole bar. Fees for sizing are on ``/hyperliquid/meta`` (``fees``); funding + OI on the same bar grid are ``/backtesting/hl-funding-bars`` (join on ``timestamp``).
Price
$0.01/ callEdge cache
Off
Uptime 24h
100.00%
p95
1.74s
Parameters
| Name | In | Type | Description |
|---|---|---|---|
| coins | query | string | Comma list of HL coin names, e.g. ETH,SOL,BNB (up to 25) |
| symbols | query | string | Alias for `coins`. Send one or the other. |
| interval | query | string = 1h | |
| limit | query | integer = 200 | |
| 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. |
| closed_only | query | boolean = false | true = COMPLETED bars only: the last `limit` closed bars, no forming bar. Served from any series fetched since the latest bar close, so it stays warm for the whole bar (the default trailing window is re-fetched every few minutes). |
| wait | query | number | Seconds to hold for cold series before answering with `pending` (0-25, default 8). |
Code
# 1. No key, no payment: the gateway answers 402 with the price
curl -i "https://api.realtimeapi.ai/v1/cryptodata/hyperliquid/candles/batch?coins=BTC,ETH&interval=1h"
# 2. Pay: retry with a signed x402 payment (any x402 client builds this header)
curl "https://api.realtimeapi.ai/v1/cryptodata/hyperliquid/candles/batch?coins=BTC,ETH&interval=1h" -H "PAYMENT-SIGNATURE: $X402_PAYMENT"// 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/batch?coins=BTC,ETH&interval=1h")).json();
console.log(data);# 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/batch?coins=BTC,ETH&interval=1h").json())curl "https://api.realtimeapi.ai/v1/cryptodata/hyperliquid/candles/batch?coins=BTC,ETH&interval=1h" -H "X-API-Key: $RTAPI_KEY"Frequently asked questions
How do I get get candles batch from CryptoDataAPI?
Send GET https://api.realtimeapi.ai/v1/cryptodata/hyperliquid/candles/batch. Pay $0.01 per request with x402, or send an X-API-Key header.
What does GET /hyperliquid/candles/batch 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.