资金快照
接口描述
取得指定代幣在最近100天内任意时间点的资金积累資料,以及100天内指定时间的主力资金积累資料。
使用场景:
- 适用于短期内代幣在不同时间点下的资金积累情况資料取得
- 适用于判断资金积累在一段时间内的变化趋势
- 适用于歷史资金行为回溯分析
使用提示:
- 仅查询某天的資料但未指定具體时间点,預設查询UTC+8时间点的資料
- 自然语言查询主力资金趋势等综合语言需要调此接口
資料更新频率:每5分鐘更新一次
請求URL
- 方法:
POST - 路径:
/open/v1/trade/getCoinTradeSnapshot
积分消耗
- 消耗积分:
3
前置条件
取得 vsTokenId
| 条件 | 说明 | 取得方式 |
|---|---|---|
| 已有 vsTokenId | 直接使用缓存的 vsTokenId,无需重复查询 | 上下文自动提取 |
| 未有 vsTokenId | 调用 POST /vs-token/list 接口取得 | 前置接口调用 |
請求参数
参数通过請求體(Body)以 JSON 格式传递。
| 参数名 | 類型 | 必需 | 描述 |
|---|---|---|---|
| vsTokenId | integer | 是 | 代幣 ID |
| date | long | 是 | 指定日期(毫秒时间戳) |
回應欄位
仅展示 data 对象内的欄位结构:
| 欄位 | 類型 | 实际返回類型 | 描述 |
|---|---|---|---|
| updateTime | integer | long | 更新时间(毫秒时间戳) |
| vsTokenId | integer | string | 代幣 ID |
| symbol | string | string | 代幣符号 |
| name | string | string | 代幣名称 |
| hasSpotGoods | boolean | boolean | 是否存在现货資料 |
| spotMaxInflow | number | string | 现货主力资金积累 |
| spotGoodsList | array | array | 现货資料 |
| timeRange | string | string | 时间范围 |
| timeParticleEnum | integer | integer | 統計时间粒度 |
| tradeInflow | number | string | 交易净流入金额(USD) |
| tradeAmount | number | string | 交易量(USD) |
| hasContract | boolean | boolean | 是否存在合约資料 |
| contractMaxInflow | number | string | 合约主力资金积累 |
| contractList | array | array | 合约資料 |
| timeRange | string | string | 时间范围 |
| timeParticleEnum | integer | integer | 統計时间粒度 |
| tradeInflow | number | string | 交易净流入金额(USD) |
| tradeAmount | number | string | 交易量(USD) |
欄位业务含义
| 欄位 | 业务含义 | 使用建议 |
|---|---|---|
| spotMaxInflow | 现货主力积累 | 主力资金为现货交易的所有时间窗口中的最大资金净流入,主力积累为各时间窗口的资金資料 |
| contractMaxInflow | 合约主力积累 | 主力资金为现货交易的所有时间窗口中的最大资金净流入,主力积累为各时间窗口的资金資料 |
| date | 快照日期 | 查询的歷史資料时间点,最小时间颗粒5分鐘 |
請求示例
json
{
"vsTokenId": 1, // 代幣 id
"date": 1773654600000 // 指定日期(时间戳)
}cURL 示例(Linux/macOS)
bash
curl --location --request POST 'http://${host}/api/open/v1/trade/getCoinTradeSnapshot' \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: xxxxx' \
--header 'X-TIMESTAMP: xxxxx' \
--header 'X-SIGN: xxxxx' \
--header 'Accept: */*' \
--data-raw '{
"vsTokenId": 1,
"date": 1773654600000
}'cURL 示例(Windows CMD)
cmd
curl --location --request POST "http://${host}/api/open/v1/trade/getCoinTradeSnapshot" ^
--header "Content-Type: application/json" ^
--header "X-API-KEY: xxxxx" ^
--header "X-TIMESTAMP: xxxxx" ^
--header "X-SIGN: xxxxx" ^
--header "Accept: */*" ^
--data-raw "{ \"vsTokenId\": 1, \"date\": 1773654600000}"成功回應示例
json
{
"code": 200,
"message": "success",
"data": {
"updateTime": 1773654600000, // 更新时间
"vsTokenId": "1", // 代幣 ID
"symbol": "BTC", // 代幣符号
"name": "Bitcoin", // 代幣名称
"hasSpotGoods": true, // 是否存在现货資料
"spotMaxInflow": "173206257.989364", // 现货主力资金积累
"spotGoodsList": [
{
"timeRange": "m5", // 时间范围
"timeParticleEnum": 5, // 統計时间粒度
"tradeInflow": "973669.0454980996", // 交易净流入金额(USD)
"tradeAmount": "4176136.897351299" // 交易量(USD)
},
{
"timeRange": "m15",
"timeParticleEnum": 15,
"tradeInflow": "1531287.2033347988",
"tradeAmount": "11822696.069185598"
},
{
"timeRange": "m30",
"timeParticleEnum": 30,
"tradeInflow": "2668474.962980899",
"tradeAmount": "25890934.620040294"
}
// ... 更多資料省略
],
"hasContract": true, // 是否存在合约資料
"contractMaxInflow": "5115857220.793299", // 合约主力资金积累
"contractList": [
{
"timeRange": "m5", // 时间范围
"timeParticleEnum": 5, // 統計时间粒度
"tradeInflow": "7412113.461600001", // 交易净流入金额(USD)
"tradeAmount": "33097685.519799992" // 交易量(USD)
},
{
"timeRange": "m15",
"timeParticleEnum": 15,
"tradeInflow": "5682104.7779",
"tradeAmount": "69809754.7091"
},
{
"timeRange": "m30",
"timeParticleEnum": 30,
"tradeInflow": "-6355722.267499994",
"tradeAmount": "183233913.60549998"
}
// ... 更多資料省略
]
},
"requestId": "xxx-xxx-xxx"
}