Skip to main content

Endpoint

GET
string
https://api.llmquant.com/prices/crypto/historical

Parameters

Required

symbol
string
required
The trading pair symbol (e.g. BTCUSDT, ETHUSDT).
period
string
required
Bar interval. One of: 1m, 5m, 15m, 1h, 4h, 1d.

Optional

limit
integer
default:100
Maximum number of bars to return.
start_time
datetime
Start of time range (ISO 8601 or Unix ms timestamp).
end_time
datetime
End of time range (ISO 8601 or Unix ms timestamp).
market_type
string
default:"spot"
Market type. One of: spot, futures.

Response

prices
array
Array of CryptoPriceBar objects, sorted by timestamp descending.

Code Examples

import requests

headers = {"X-API-KEY": "your_api_key_here"}

symbol = "BTCUSDT"
period = "1d"
limit = 30

url = (
    f"https://api.llmquant.com/prices/crypto/historical"
    f"?symbol={symbol}"
    f"&period={period}"
    f"&limit={limit}"
)

response = requests.get(url, headers=headers)
prices = response.json().get("prices")