Huobi API

Cryptocurrency / API Key Intermediate HTTPS
Varies by plan (check documentation)

Overview

Huobi (now HTX) is a major global cryptocurrency exchange API headquartered in Seychelles, offering access to hundreds of spot and futures trading pairs. It provides real-time market depth, candlestick data, and trade history for currencies including BTC, ETH, and many altcoins. An API key is required for trading operations, but some public market endpoints can be accessed without authentication.

💡

Beginner Tip

Start with the public market-data endpoints — such as GET /market/detail/merged — which do not require an API key, to familiarize yourself with the response structure before setting up authentication.

Available Data

coin price in USD/EUR
market capitalization
24h price change
trading volume
circulating supply

Example Response

JSON Response
{
  "id": "bitcoin",
  "symbol": "btc",
  "current_price": 65432.1,
  "market_cap": 1280000000000,
  "price_change_24h": 1250.5,
  "price_change_percentage_24h": 1.95,
  "total_volume": 28500000000
}

Field Reference

status Indicates request success; "ok" means data is valid.
tick.close The closing price of the current 24-hour period.
tick.open The opening price at the start of the 24-hour window.
tick.high Highest trade price recorded in the last 24 hours.
tick.vol Total trading volume in the base currency over 24 hours.
ts Server-side timestamp in milliseconds when the data was captured.

Implementation Example

const url = "https://huobiapi.github.io/docs/spot/v1/en/";
// Replace headers or query params with the values required by this API.
const response = await fetch(url, {
  headers: {
  "X-API-Key": "YOUR_API_KEY"
  }
});
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();
console.log(data);

What Can You Build?

Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.

Common Errors & Troubleshooting

invalid-parameter (bad symbol) Huobi symbols are lowercase and concatenated, so using the wrong format causes rejection.
Use lowercase pairs like "btcusdt" (not "BTC/USDT" or "BTC_USDT") in the symbol query parameter.
Signature verification failed The HMAC-SHA256 request signature is incorrectly computed when calling private endpoints.
Ensure you sort parameters alphabetically before signing, and include the timestamp in UTC ISO-8601 format.
429 Too Many Requests Exceeding the rate limit, which differs for public (10 req/sec) and private (5 req/sec) endpoints.
Implement exponential backoff and track your request count per second; use websocket streams for real-time data instead of polling.

Matrix Score Breakdown

🌐 Reachability 30/30
⚡ Speed 10/20
🔒 Security 15/15
🛠 Developer XP 12/20
✓ Reliability 10/15

Partially tested on Apr 5, 2026

Technical Specifications

Auth API Key
HTTPS REQUIRED
CORS UNKNOWN
Category Cryptocurrency
Difficulty Intermediate
Verified: 2026-04-04

Similar APIs

View All →