OHLCV Candles
Historical and real-time candlestick data for cryptocurrency trading pairs.
Endpoint
GET /api/v1/market-data/candles
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | Trading pair (e.g., BTC-USD) |
| interval | string | Yes | Candle interval (1m, 5m, 15m, 1h, 4h, 1d) |
| limit | integer | No | Number of candles (default: 100, max: 1000) |
| startTime | integer | No | Unix timestamp (milliseconds) |
| endTime | integer | No | Unix timestamp (milliseconds) |
Response Format
{
"data": [
{
"timestamp": "2026-01-20T12:00:00Z",
"open": 45000.50,
"high": 45500.00,
"low": 44800.00,
"close": 45200.00,
"volume": 1234.56,
"trades": 5678
}
],
"meta": {
"symbol": "BTC-USD",
"interval": "1h",
"total": 24
}
}
Examples
Get Latest 24 Hours
curl "http://localhost:8090/api/v1/market-data/candles?symbol=BTC-USD&interval=1h&limit=24" \
-H "Authorization: Bearer YOUR_API_KEY"
Get Specific Time Range
curl "http://localhost:8090/api/v1/market-data/candles?symbol=ETH-USD&interval=1d&startTime=1640995200000&endTime=1643673600000" \
-H "Authorization: Bearer YOUR_API_KEY"
JavaScript Example
async function getCandles(symbol, interval, limit = 100) {
const response = await fetch(
`http://localhost:8090/api/v1/market-data/candles?symbol=${symbol}&interval=${interval}&limit=${limit}`,
{
headers: {
'Authorization': `Bearer ${process.env.LEDGERLINK_API_KEY}`
}
}
);
return await response.json();
}
// Usage
const candles = await getCandles('BTC-USD', '1h', 24);
console.log(candles);
Python Example
import requests
import os
def get_candles(symbol, interval, limit=100):
url = f"http://localhost:8090/api/v1/market-data/candles"
params = {
'symbol': symbol,
'interval': interval,
'limit': limit
}
headers = {
'Authorization': f"Bearer {os.environ['LEDGERLINK_API_KEY']}"
}
response = requests.get(url, params=params, headers=headers)
return response.json()
# Usage
candles = get_candles('BTC-USD', '1h', 24)
print(candles)
Supported Intervals
1m- 1 minute5m- 5 minutes15m- 15 minutes30m- 30 minutes1h- 1 hour4h- 4 hours1d- 1 day1w- 1 week
Rate Limits
- Free tier: 60 requests/minute
- Pro tier: 300 requests/minute
- Enterprise: Custom limits
See Rate Limits for more details.
Next Steps
- Trades - Individual trade data
- Orderbooks - Market depth
- API Reference - Interactive API documentation