LedgerCore
Market Intelligence

OHLCV Candles

Historical and real-time candlestick data for cryptocurrency trading pairs.

Endpoint

GET /api/v1/market-data/candles

Parameters

ParameterTypeRequiredDescription
symbolstringYesTrading pair (e.g., BTC-USD)
intervalstringYesCandle interval (1m, 5m, 15m, 1h, 4h, 1d)
limitintegerNoNumber of candles (default: 100, max: 1000)
startTimeintegerNoUnix timestamp (milliseconds)
endTimeintegerNoUnix 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 minute
  • 5m - 5 minutes
  • 15m - 15 minutes
  • 30m - 30 minutes
  • 1h - 1 hour
  • 4h - 4 hours
  • 1d - 1 day
  • 1w - 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

Was this page helpful?