已暴露为 MCP 工具:
crypto_historical_klines —— 在 Claude / Cursor / 任意 MCP 客户端中直接调用。详见 MCP Server 60 秒配置。它为 Agent 做什么
crypto_historical_klines 返回单个加密货币交易对的 OHLCV K 线。它是 agent 拿历史价格做收益率、回撤、技术指标、回测的 历史价格 primitive —— 不是用来取最新报价的工具(取最新价用 crypto_snapshot)。
用 start_time 和/或 end_time 先过滤候选窗口,再用 limit 和 take_from 决定保留哪一端。返回顺序始终是旧到新。只返回已收盘的 candle,当前未收盘的 bar 永远不在结果里。
返回值
CryptoHistoricalResult
required
number
本次调用消耗的 credit(固定
1)。number
账户剩余 credit。
string
仅在候选窗口内的数据多于实际返回条数时出现 —— 也就是结果被
limit 截断了。这句话提示 agent 缩小窗口或把查询拆成多次:More data exists in the requested window than the items returned; narrow the window or split the query to see more.200 OK · crypto_historical_klines
说明
直接调用
HTTP / SDK 示例
HTTP / SDK 示例
完整参数参考
crypto_historical_klines — 请求参数
crypto_historical_klines — 请求参数
string
required
交易对,
BASE-QUOTE 格式。例:BTC-USD、ETH-USD、SOL-USD。string
required
K 线周期。可选值:
1h、4h、1d、1w。不支持分钟级。string
可选 inclusive 下边界,ISO 8601 UTC(如
2026-03-01T00:00:00Z)。string
可选 inclusive 上边界,ISO 8601 UTC。
integer
边界过滤后最多返回多少根 candle。按 interval 自适应默认:
1h = 24,4h = 42,1d = 30,1w = 12。最大 200。string
default:"latest"
当过滤后候选超过
limit 时保留哪一端:latest 或 earliest。输出仍按时间正序。相关接口
加密货币实时快照
交易对的当前价格 + 24h 涨跌 —— 只关心”现在”时用这个。
美股历史日线
同样的有界 historical-series 形状,作用在美股标的(日线)。