Skip to main content
GET
代币市场图表范围
返回单个币种在两个明确时间点之间的历史序列。fromto 为 Unix 秒级时间戳,而响应内部的时间戳单位为毫秒——两者单位不同,这是结果为空或错位的常见原因。返回 pricesmarket_capstotal_volumes,均为「时间戳,数值」二元组;CoinGecko 会根据窗口长度自动选择粒度。适合用于把序列对齐到某个已知事件窗口。如需截至当前的回溯窗口,get_coingecko_coins_id_market_chart 改用 days 天数参数。

授权

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

from
integer
必填

起始 UNIX 时间戳(秒)。

to
integer
必填

结束 UNIX 时间戳(秒)。

precision
string

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

响应

数据结构与 /coins/{id}/market_chart 相同。

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