DEX Perpetuals API Documentation

The Coinperps API provides unified access to perpetual futures data from multiple decentralized exchanges (DEXes). To get access sign up and get your API key.

Base URL:

https://api.coinperps.com/api/v1

Authentication

All API requests require an API key. Include your API key in the request header:

X-API-Key: your_api_key_here

Example:

curl -X GET "https://api.coinperps.com/api/v1/exchanges" \
 -H "X-API-Key: cpk_live_your_api_key_here"

Rate Limits

Tier Requests/Minute Requests/Day
Free 10 1,000
Paid 600 100,000

Rate limit headers are included in all responses:

  • X-RateLimit-Limit: Maximum requests allowed
  • X-RateLimit-Remaining: Requests remaining
  • X-RateLimit-Reset: Unix timestamp when the limit resets

Response Format

Success Response:

{
 "success": true,
 "data": { ... },
 "meta": {
   "timestamp": 1704067200000,
   "cached": false,
   "cacheAge": null
 }
}

Error Response:

{
 "success": false,
 "error": {
   "code": "ERROR_CODE",
   "message": "Human-readable error message"
 }
}

Supported Exchanges

Exchange ID Chain
Hyperliquid hyperliquid Hyperliquid L1
dYdX dydx dYdX Chain (Cosmos)
GMX gmx Arbitrum
Jupiter Perps jupiter Solana
Drift drift Solana
ApeX apex Multi-chain
Gains Network gains Arbitrum
Paradex paradex Starknet
SynFutures synfutures Blast
Lighter lighter Arbitrum
Aster aster Multi-chain
EdgeX edgex Multi-chain
Reya reya Reya Network

Endpoints

Exchanges

List All Exchanges

Returns a list of all supported DEX perpetual exchanges.

GET/exchanges

Get Exchange Details

Returns detailed information about a specific exchange.

GET/exchanges/{exchangeId}

Parameter Type Required Description
exchangeId path Yes Exchange identifier (e.g., hyperliquid, dydx)

Tickers

Get All Tickers

Returns ticker data for all trading pairs across all exchanges.

GET/tickers

Parameter Type Required Description
exchange query No Filter by exchange (comma-separated for multiple)

Get Tickers by Exchange

Returns all ticker data for a specific exchange.

GET/tickers/{exchangeId}

Parameter Type Required Description
exchangeId path Yes Exchange identifier

Get Single Ticker

Returns ticker data for a specific trading pair.

GET/ticker/{exchangeId}/{symbol}

Parameter Type Required Description
exchangeId path Yes Exchange identifier
symbol path Yes Trading pair symbol (e.g., BTC-PERP, ETH-PERP)

Example Response:

{
 "success": true,
 "data": {
   "exchange": "hyperliquid",
   "symbol": "BTC-PERP",
   "price": "43250.50",
   "indexPrice": "43248.00",
   "markPrice": "43250.50",
   "bid": "43249.00",
   "ask": "43251.00",
   "volume24h": "15234.567",
   "volumeUsd24h": "658234567.89",
   "priceChange24h": "250.50",
   "priceChangePercent24h": "0.58",
   "openInterest": "5000.25",
   "openInterestUsd": "216256343.13",
   "fundingRate": "0.0001",
   "nextFundingTime": 1704070800000,
   "timestamp": 1704067200000,
   "iconUrl": "https://static.edgex.exchange/icons/coin/BTC.png"
 }
}

Metrics

Get Aggregated Metrics

Returns comprehensive metrics for all DEX perpetual exchanges.

GET/metrics

Get DEX Rankings

Returns DEX rankings sorted by various metrics.

GET/metrics/rankings

Parameter Type Required Default Description
sortBy query No volume24h Sort field: volume24h, volume30d, openInterest, fees24h
order query No desc Sort order: asc or desc

Get Total Metrics

Returns aggregated totals across all DEX exchanges.

GET/metrics/totals

Get Volume History

Returns historical daily trading volume.

GET/metrics/volume/history

Parameter Type Required Default Description
startDate query No 30 days ago Start date (YYYY-MM-DD)
endDate query No Today End date (YYYY-MM-DD)
exchangeId query No All Filter by specific exchange
limit query No 365 Maximum days to return

Get Cumulative Volume

Returns cumulative (running total) trading volume over time.

GET/metrics/volume/cumulative

Get DEX to CEX Ratio

Returns the current ratio of DEX perpetual trading volume compared to CEX volume.

GET/metrics/dex-cex-ratio

Get DEX to CEX Ratio History

Returns historical DEX vs CEX perpetual trading volume ratios.

GET/metrics/dex-cex-ratio/history

Get Single Exchange Metrics

Returns detailed metrics for a specific exchange.

GET/metrics/{exchangeId}

Logos

Get All Exchange Logos

Returns logo URLs for all supported exchanges.

GET/logos/exchanges

Get Exchange Logo

Returns logo URL for a specific exchange.

GET/logos/exchanges/{exchangeId}

Get All Coin Logos

Returns logo URLs for all supported coins.

GET/logos/coins

Get Coin Logo

Returns logo URL for a specific coin.

GET/logos/coins/{symbol}

Icons (Alternative)

Get All Crypto Icons

Returns a map of crypto symbols to their icon URLs.

GET/tickers/icons

Get Icon for Symbol

Returns the icon URL for a specific crypto symbol.

GET/tickers/icons/{symbol}

Error Codes

Code HTTP Status Description
UNAUTHORIZED 401 Missing or invalid API key
INVALID_API_KEY 401 API key format is invalid
API_KEY_EXPIRED 401 API key has expired
API_KEY_DISABLED 401 API key has been disabled
RATE_LIMIT_EXCEEDED 429 Rate limit exceeded
DAILY_LIMIT_EXCEEDED 429 Daily request limit exceeded
EXCHANGE_NOT_FOUND 404 Exchange ID not recognized
SYMBOL_NOT_FOUND 404 Trading pair not found
VALIDATION_ERROR 400 Invalid request parameters
INTERNAL_ERROR 500 Server error

Code Examples

JavaScript / Node.js

const API_KEY = 'cpk_live_your_api_key_here';
const BASE_URL = 'https://api.coinperps.com/api/v1';

async function getMetrics() {
 const response = await fetch(`${BASE_URL}/metrics`, {
   headers: {
     'X-API-Key': API_KEY,
   },
 });

 const data = await response.json();

 if (!data.success) {
   throw new Error(data.error.message);
 }

 return data.data;
}

async function getTicker(exchangeId, symbol) {
 const response = await fetch(`${BASE_URL}/ticker/${exchangeId}/${symbol}`, {
   headers: {
     'X-API-Key': API_KEY,
   },
 });

 return response.json();
}

// Usage
getMetrics().then(metrics => {
 console.log('Total 24h Volume:', metrics.totalVolume24h);
 console.log('Top Exchange:', metrics.exchanges[0].displayName);
});

Python

import requests

API_KEY = 'cpk_live_your_api_key_here'
BASE_URL = 'https://api.coinperps.com/api/v1'

headers = {
   'X-API-Key': API_KEY
}

def get_metrics():
   response = requests.get(f'{BASE_URL}/metrics', headers=headers)
   data = response.json()

   if not data['success']:
       raise Exception(data['error']['message'])

   return data['data']

def get_ticker(exchange_id, symbol):
   response = requests.get(
       f'{BASE_URL}/ticker/{exchange_id}/{symbol}',
       headers=headers
   )
   return response.json()

# Usage
metrics = get_metrics()
print(f"Total 24h Volume: ${metrics['totalVolume24h']:,.2f}")
print(f"Top Exchange: {metrics['exchanges'][0]['displayName']}")

cURL

# Get all metrics
curl -X GET "https://api.coinperps.com/api/v1/metrics" \
 -H "X-API-Key: cpk_live_your_api_key_here"

# Get specific ticker
curl -X GET "https://api.coinperps.com/api/v1/ticker/hyperliquid/BTC-PERP" \
 -H "X-API-Key: cpk_live_your_api_key_here"

# Get volume history
curl -X GET "https://api.coinperps.com/api/v1/metrics/volume/history?startDate=2024-01-01" \
 -H "X-API-Key: cpk_live_your_api_key_here"

Support

For questions or issues: