The Hyperliquid Spot Prices API provides real-time cryptocurrency spot prices and market data from the Hyperliquid exchange. This API is free to use and requires no authentication.
Base URL:
https://your-domain.com/apiThis API uses intelligent memory caching to provide fast responses even under high load:
Cache Status Headers: Check X-Cache-Age and X-Cache-Status headers to monitor cache performance.
No authentication is required to use this API. All endpoints are publicly accessible.
/api/spotsGet all spot prices or filter by specific criteria
| Parameter | Type | Description | Example |
|---|---|---|---|
symbol | string | Filter by specific token symbol | BTC |
limit | number | Limit number of results | 10 |
sortBy | string | Sort by: price, name, change, changePercent | price |
order | string | Sort order: asc, desc | desc |
{
"success": true,
"data": [
{
"name": "BTC",
"price": 45000.5,
"prevPrice": 44500.0,
"change": 500.5,
"changePercent": 1.12,
"szDecimals": 5,
"logoUrl": "https://app.hyperliquid.xyz/coins/BTC_USDC.svg",
"maxLeverage": 50,
"onlyIsolated": false,
"lastUpdated": "2024-01-01T12:00:00.000Z"
}
],
"meta": {
"total": 1,
"timestamp": "2024-01-01T12:00:00.000Z",
"source": "Hyperliquid API",
"cached": true,
"cacheAge": 15,
"lastCacheUpdate": "2024-01-01T11:59:45.000Z"
}
}// 获取所有现货价格
fetch('https://your-domain.com/api/spots')
.then(response => response.json())
.then(data => {
console.log('Spot prices:', data.data);
console.log('Cache age:', data.meta.cacheAge, 'seconds');
})
.catch(error => {
console.error('Error:', error);
});
// 获取特定代币价格
fetch('https://your-domain.com/api/spots?symbol=BTC')
.then(response => response.json())
.then(data => {
console.log('BTC price:', data.data[0]);
});
// 获取前10个代币,按涨跌幅排序
fetch('https://your-domain.com/api/spots?limit=10&sortBy=changePercent&order=desc')
.then(response => response.json())
.then(data => {
console.log('Top gainers:', data.data);
});To ensure fair usage and optimal performance, the following rate limits apply:
Note: Thanks to memory caching, most requests will be served instantly from cache, reducing the load on upstream APIs and improving response times.
Download the complete OpenAPI 3.0 specification for this API. You can use this with tools like Postman, Insomnia, or generate client SDKs.
{
"openapi": "3.0.3",
"info": {
"title": "Hyperliquid Spot Prices API",
"description": "RESTful API for real-time cryptocurrency spot prices from Hyperliquid exchange",
"version": "1.0.0",
"contact": {
"name": "API Support",
"url": "https://your-domain.com/api-docs"
},
"license": {
"name": "MIT",
"url": "https://opensource.org/licenses/MIT"
}
},
"servers": [
{
"url": "https://your-domain.com/api",
"description": "Production server"
}
],
"paths": {
"/spots": {
"get": {
"summary": "Get spot prices",
"description": "Retrieve real-time cryptocurrency spot prices and market data",
"parameters": [
{
"name": "symbol",
"in": "query",
"description": "Filter by specific token symbol",
"required": false,
"schema": {
"type": "string",
"example": "BTC"
}
},
...Test the API directly in your browser: