跳转到主要内容
GET
/
v2
/
token
/
{chain}
/
pair
/
{pair}
/
candles
交易对 - K 线
curl --request GET \
  --url https://api.dex.chainstream.io/v2/token/{chain}/pair/{pair}/candles \
  --header 'Authorization: Bearer <token>'
[
  {
    "close": "51.2",
    "high": "51.8",
    "low": "50.1",
    "open": "50.5",
    "timestamp": 1709251200000,
    "volume": "1000000"
  }
]

授权

Authorization
string
header
必填

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

路径参数

chain
enum<string>
必填

支持网络列表中的链名称 Supported blockchain chains

可用选项:
sol,
eth,
bsc
pair
string
必填

交易对标识符(格式:TOKEN_A_ADDRESS-TOKEN_B_ADDRESS)。交易对会自动排序

查询参数

resolution
enum<string>
必填

K 线数据的时间粒度 Candle resolution

可用选项:
1s,
15s,
30s,
1m,
3m,
5m,
15m,
30m,
1h,
2h,
4h,
6h,
8h,
12h,
1d,
3d,
1w,
1M
priceType
enum<string>
默认值:usd

价格类型:usd(默认)或原生代币价格 Price type for candle data

可用选项:
usd,
native
from
integer<int64>

开始时间戳(Unix 秒级时间戳)

to
integer<int64>

结束时间戳(Unix 秒级时间戳)

limit
integer<int64>

返回的 K 线数量

响应

200 - application/json

获取交易对 K 线

close
string
必填

Close price

示例:

"51.2"

high
string
必填

High price

示例:

"51.8"

low
string
必填

Low price

示例:

"50.1"

open
string
必填

Open price

示例:

"50.5"

timestamp
integer<int64>
必填

Timestamp

示例:

1709251200000

volume
string
必填

Volume

示例:

"1000000"