dYdX API

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

Overview

dYdX is a decentralised perpetual futures exchange, and its API gives developers programmatic access to market data, order books, and — with authentication — order management and account information. Public endpoints expose live prices, historical candles, and funding rates without any key, making it easy to pull market data for analysis. Trading and account operations require API credentials linked to an Ethereum wallet rather than a traditional username and password.

💡

Beginner Tip

dYdX operates on-chain, so understanding Ethereum wallets and signing is important before attempting authenticated calls. Start by exploring the public market data endpoints — they require no credentials and return well-structured JSON you can experiment with immediately.

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

markets[ticker].ticker Trading pair identifier, e.g. BTC-USD, used as the market parameter in all other endpoints.
markets[ticker].oraclePrice Current oracle price used by the protocol for margin calculations and liquidations.
markets[ticker].priceChange24H Absolute price change in USD over the past 24 hours; divide by previous price for percentage.
markets[ticker].volume24H Total notional trading volume in USD over the last 24 hours.
markets[ticker].nextFundingRate Projected funding rate for the next funding period; positive means longs pay shorts, negative means shorts pay longs.

Implementation Example

const url = "https://docs.dydx.exchange/";
// 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

401 Unauthorized on account endpoints Attempting to call account or order endpoints without signing the request with your Ethereum private key
Use the dYdX client library (e.g. the official Python or TypeScript SDK) to handle wallet-based signing; raw HMAC auth is not sufficient for order endpoints.
Market not found Passing a market name that does not exist on the v4 chain (markets changed between v3 and v4)
Fetch the current list of available markets from /v4/markets and use the exact ticker value returned, e.g. BTC-USD.
Invalid order size Order quantity does not meet the minimum step size for the market
Check the stepSize and minOrderSize fields in the market info response and round your quantity to the correct precision.

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-07

Similar APIs

View All →