Skip to main content

Endpoint

GET https://api.llmquantdata.com/api/crypto/historical

Authentication

Authorization: Bearer YOUR_API_KEY

Parameters

Required

ticker
string
required
The trading pair (e.g. BTC-USD, ETH-USD).
interval
string
required
K-line interval. One of: 1h, 4h, 1d, 1w.

Optional

start_time
string
Start of time range (ISO 8601 UTC, e.g. 2026-03-01T00:00:00Z). Must be used together with end_time.
end_time
string
End of time range (ISO 8601 UTC). Must be used together with start_time.
limit
integer
Maximum number of bars to return. Defaults vary by interval: 1h = 24, 4h = 42, 1d = 30, 1w = 12. Max 200. When start_time/end_time are provided, limit acts as a safety cap only.

Query Modes

This endpoint supports two mutually exclusive query modes:
ModeParametersBehavior
Recentlimit only (or omit for default)Returns the most recent N closed candles
Rangestart_time + end_timeReturns all closed candles within the time range
Passing only start_time or only end_time returns a 400 error.

Response

data
object
meta
object

Credits

Each call consumes 1 credit, regardless of the number of bars returned.

Code Examples

import requests

headers = {"Authorization": "Bearer YOUR_API_KEY"}

# Get the last 30 daily candles for BTC
response = requests.get(
    "https://api.llmquantdata.com/api/crypto/historical",
    headers=headers,
    params={
        "ticker": "BTC-USD",
        "interval": "1d",
        "limit": 30,
    },
)

data = response.json()
for bar in data["data"]["prices"]:
    print(f"{bar['time']}  O={bar['open']}  H={bar['high']}  L={bar['low']}  C={bar['close']}  V={bar['volume']}")

Example Response

{
  "data": {
    "ticker": "BTC-USD",
    "interval": "1d",
    "prices": [
      {
        "open": 87000.50,
        "high": 87500.00,
        "low": 86800.00,
        "close": 87200.00,
        "volume": 1234.56,
        "time": "2026-03-01T00:00:00Z"
      },
      {
        "open": 87200.00,
        "high": 88100.00,
        "low": 87000.00,
        "close": 87950.00,
        "volume": 1456.78,
        "time": "2026-03-02T00:00:00Z"
      }
    ]
  },
  "meta": {
    "count": 2,
    "creditsUsed": 1,
    "remainingCredits": 99
  }
}

Notes

  • Binance Spot only — futures data is not available.
  • Closed candles only — the current in-progress candle is never included.
  • No minute-level intervals1m, 5m, 15m are not supported.
  • First request latency — the first query for a given ticker + interval + range may be slower as data is fetched from Binance and cached. Subsequent queries for the same range return instantly.