Skip to main content

接口

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

参数

必填

symbol
string
required
交易对(如 BTCUSDTETHUSDT)。
period
string
required
K 线周期,可选值:1m5m15m1h4h1d

选填

limit
integer
default:100
返回 K 线的最大数量。
start_time
datetime
起始时间(ISO 8601 或 Unix 毫秒时间戳)。
end_time
datetime
截止时间(ISO 8601 或 Unix 毫秒时间戳)。
market_type
string
default:"spot"
市场类型,可选值:spot(现货)、futures(合约)。

返回值

prices
array
CryptoPriceBar 对象数组,按时间倒序排列。

代码示例

import requests

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

url = "https://api.llmquant.com/prices/crypto/historical?symbol=BTCUSDT&period=1d&limit=30"
response = requests.get(url, headers=headers)
prices = response.json().get("prices")