Skip to main content
GET
币种历史图表
返回单个币种在由 days 指定的回溯窗口内的历史序列,以三个平行数组给出:pricesmarket_capstotal_volumes。每个条目是「时间戳,数值」的二元组,时间戳单位为毫秒。粒度会依据 days 自动调整,也可以用 intervaldailyhourly)强制指定。适合绘制截至当前的走势图。如需指定明确的起止时间,请使用 get_coingecko_coins_id_market_chart_range;如需 K 线,请使用 get_coingecko_coins_id_ohlc;如需某一个具体历史日期,请使用 get_coingecko_coins_id_history

授权

Authorization
string
header
必填

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

路径参数

id
string
必填

CoinGecko 代币 ID(例如 bitcoinethereum)。通过 /coins/list 获取列表。

查询参数

vs_currency
string
默认值:usd
必填

价格的目标货币(例如 usdeurbtc)。请参阅 /simple/supported_vs_currencies

days
string
必填

截至 N 天前的数据。接受 17143090180365max

interval
enum<string>

数据间隔。CoinGecko 支持 daily;在支持的范围内也可使用 hourly

可用选项:
daily,
hourly
precision
string

使用 full018 之间的值指定货币价格值的小数位数。

响应

200 - application/json

三个时间序列数组。

prices
number[][]
market_caps
number[][]
total_volumes
number[][]