市场数据 API
AiCoin开放API提供了涵盖从合约数据到市场指数和K线图的广泛数据集合,提供市场深度、活跃度和价格趋势等关键指标,帮助用户在复杂的市场环境中抓住机遇。同时,我们独家提供加密货币相关股票数据,覆盖美股和港股市场,为用户构建完整的加密投资生态数据支撑。
获取加密货币股票行情(加密货币股票数据)
获取加密货币相关股票的实时行情数据,支持多个股票代码同时查询。
请求参数
- Name
tickers
- Type
- string
- Description
股票代码列表,多个用逗号分隔,格式:i:symbol:market(如:i:mstr:nasdaq,i:bull:nasdaq)
- Name
AccessKeyId
- Type
- string
- Description
用户访问密钥ID
- Name
SignatureNonce
- Type
- string
- Description
签名随机数
- Name
Timestamp
- Type
- string
- Description
请求时间戳(秒),有效期30秒
- Name
Signature
- Type
- string
- Description
使用 HmacSHA1 + Base64 生成的签名,请参考如何获取 API 认证参数
返回数据
- Name
code
- Type
- string
- Description
状态码
- Name
msg
- Type
- string
- Description
响应消息
- Name
data
- Type
- array
- Description
股票行情数据列表
- Name
ticker
- Type
- string
- Description
股票代码
- Name
company_name
- Type
- string
- Description
公司名称
- Name
last_price
- Type
- number
- Description
最新价格
- Name
open
- Type
- number
- Description
开盘价
- Name
close
- Type
- number
- Description
收盘价
- Name
high
- Type
- number
- Description
最高价
- Name
low
- Type
- number
- Description
最低价
- Name
volume
- Type
- number
- Description
成交量
- Name
market_cap
- Type
- number
- Description
市值
- Name
timestamp
- Type
- integer
- Description
数据时间戳
请求
# 获取默认股票行情(MSTR + BULL)
curl -G https://open.aicoin.com/api/upgrade/v2/crypto_stock/quotes \
-d "AccessKeyId=YOUR_ACCESS_KEY_ID" \
-d "SignatureNonce=RANDOM_NONCE" \
-d "Timestamp=CURRENT_TIMESTAMP" \
-d "Signature=YOUR_SIGNATURE"
# 获取指定股票行情
curl -G https://open.aicoin.com/api/upgrade/v2/crypto_stock/quotes \
-d "tickers=i:mstr:nasdaq,i:coin:nasdaq" \
-d "AccessKeyId=YOUR_ACCESS_KEY_ID" \
-d "SignatureNonce=RANDOM_NONCE" \
-d "Timestamp=CURRENT_TIMESTAMP" \
-d "Signature=YOUR_SIGNATURE"
响应
{
"code": "0",
"msg": "success",
"data": [
{
"ticker": "MSTR",
"company_name": "MicroStrategy Incorporated",
"last_price": 425.67,
"open": 420.00,
"close": 418.55,
"high": 428.90,
"low": 415.20,
"volume": 2847392.0,
"market_cap": 83475000000,
"open_today": 420.00,
"start_ts": 1700000000,
"end_ts": 1700086400,
"timestamp": 1700043267
}
]
}
获取公司详细信息(加密货币股票数据)
获取指定加密货币相关公司的详细信息,包括基本面数据和公司描述。
路径参数
- Name
symbol
- Type
- string
- Description
公司股票代码,格式:i:symbol:market(如:i:mstr:nasdaq)
请求参数
- Name
AccessKeyId
- Type
- string
- Description
用户访问密钥ID
- Name
SignatureNonce
- Type
- string
- Description
签名随机数
- Name
Timestamp
- Type
- string
- Description
请求时间戳(秒),有效期30秒
- Name
Signature
- Type
- string
- Description
使用 HmacSHA1 + Base64 生成的签名,请参考如何获取 API 认证参数
返回数据
- Name
code
- Type
- string
- Description
状态码
- Name
msg
- Type
- string
- Description
响应消息
- Name
data
- Type
- object
- Description
公司详细信息
- Name
company_name
- Type
- string
- Description
公司全称
- Name
ticker
- Type
- string
- Description
股票代码
- Name
market
- Type
- string
- Description
交易所
- Name
country_region
- Type
- string
- Description
所属国家/地区
- Name
fdv
- Type
- number
- Description
完全稀释估值
- Name
market_cap
- Type
- number
- Description
市值
- Name
annual_high
- Type
- number
- Description
年度最高价
- Name
annual_low
- Type
- number
- Description
年度最低价
- Name
description
- Type
- string
- Description
公司描述
- Name
announcement
- Type
- string
- Description
公司公告
请求
# 获取MicroStrategy公司信息
curl -G https://open.aicoin.com/api/upgrade/v2/crypto_stock/company/i:mstr:nasdaq \
-d "AccessKeyId=YOUR_ACCESS_KEY_ID" \
-d "SignatureNonce=RANDOM_NONCE" \
-d "Timestamp=CURRENT_TIMESTAMP" \
-d "Signature=YOUR_SIGNATURE"
响应
{
"code": "0",
"msg": "success",
"data": {
"company_name": "MicroStrategy Incorporated",
"ticker": "MSTR",
"market": "NASDAQ",
"country_region": "US",
"fdv": 85000000000,
"market_cap": 83475000000,
"annual_high": 540.00,
"annual_low": 118.50,
"description": "MicroStrategy Incorporated是一家商业智能公司,也是全球最大的比特币持有企业之一。",
"announcement": "公司继续增持比特币作为主要储备资产策略。"
}
}
获取加密股票涨幅榜
获取加密货币相关股票的涨幅排行榜,支持美股和港股市场,具备智能过滤功能。
🔥 核心特色
- 智能数据过滤: 自动过滤指数类数据,确保返回真实股票信息
- 多市场支持: 同时支持美股(NASDAQ/NYSE)和港股(HKEX)
- 实时排序: 按涨跌幅实时排序,提供最新市场热点
请求参数
- Name
us_stock
- Type
- boolean
- Description
是否查询美股涨幅榜(默认:false)
- Name
hk_stock
- Type
- boolean
- Description
是否查询港股涨幅榜(默认:false)
- Name
limit
- Type
- integer
- Description
返回条数限制(默认:50)
- Name
AccessKeyId
- Type
- string
- Description
用户访问密钥ID
- Name
SignatureNonce
- Type
- string
- Description
签名随机数
- Name
Timestamp
- Type
- string
- Description
请求时间戳(秒),有效期30秒
- Name
Signature
- Type
- string
- Description
使用 HmacSHA1 + Base64 生成的签名,请参考如何获取 API 认证参数
返回数据
- Name
code
- Type
- string
- Description
状态码
- Name
msg
- Type
- string
- Description
响应消息
- Name
data
- Type
- array
- Description
涨幅榜数据列表
- Name
symbol
- Type
- string
- Description
股票代码(简化显示)
- Name
name
- Type
- string
- Description
公司名称
- Name
price
- Type
- number
- Description
当前价格
- Name
change
- Type
- number
- Description
涨跌额
- Name
change_rate
- Type
- number
- Description
涨跌幅(百分比)
- Name
volume
- Type
- integer
- Description
成交量
- Name
market_cap
- Type
- integer
- Description
市值
- Name
market
- Type
- string
- Description
市场类型(US/HK)
- Name
currency
- Type
- string
- Description
货币单位(USD/HKD)
- Name
update_time
- Type
- integer
- Description
更新时间戳
请求
# 获取美股涨幅榜前10名
curl -G https://open.aicoin.com/api/upgrade/v2/crypto_stock/top-gainer \
-d "us_stock=true" \
-d "limit=10" \
-d "AccessKeyId=YOUR_ACCESS_KEY_ID" \
-d "SignatureNonce=RANDOM_NONCE" \
-d "Timestamp=CURRENT_TIMESTAMP" \
-d "Signature=YOUR_SIGNATURE"
# 获取美股+港股综合涨幅榜
curl -G https://open.aicoin.com/api/upgrade/v2/crypto_stock/top-gainer \
-d "us_stock=true" \
-d "hk_stock=true" \
-d "limit=30" \
-d "AccessKeyId=YOUR_ACCESS_KEY_ID" \
-d "SignatureNonce=RANDOM_NONCE" \
-d "Timestamp=CURRENT_TIMESTAMP" \
-d "Signature=YOUR_SIGNATURE"
响应
{
"code": "0",
"msg": "success",
"data": [
{
"symbol": "MSTR",
"name": "MicroStrategy Incorporated",
"price": 425.67,
"change": 12.45,
"change_rate": 3.01,
"volume": 0,
"market_cap": 0,
"market": "US",
"currency": "USD",
"update_time": 1700043267
},
{
"symbol": "COIN",
"name": "Coinbase Global Inc",
"price": 156.78,
"change": 8.90,
"change_rate": 6.02,
"volume": 0,
"market_cap": 0,
"market": "US",
"currency": "USD",
"update_time": 1700043267
}
]
}
获取合约持仓数据
此接口用于获取合约持仓数据。
请求参数
- Name
lan
- Type
- integer
- Description
语言
- Name
page
- Type
- integer
- Description
页数
- Name
pageSize
- Type
- integer
- Description
页面大小(最大值为20)
- Name
currency
- Type
- string
- Description
定价,cny 或 usd
- Name
AccessKeyId
- Type
- string
- Description
用户访问密钥ID
- Name
SignatureNonce
- Type
- string
- Description
签名随机数
- Name
Timestamp
- Type
- string
- Description
请求时间戳(秒),有效期30秒
- Name
Signature
- Type
- string
- Description
使用 HmacSHA1 + Base64 生成的签名,请参考如何获取 API 认证参数
返回数据
- Name
success
- Type
- boolean
- Description
接口状态
- Name
errorCode
- Type
- integer
- Description
状态码
- Name
error
- Type
- string
- Description
错误提示信息
- Name
data
- Type
- object
- Description
返回数据
- Name
list
- Type
- array
- Description
数据列表
- Name
key
- Type
- string
- Description
交易对主键
- Name
show
- Type
- string
- Description
交易对简称
- Name
currency
- Type
- string
- Description
交易对定价
- Name
market_name
- Type
- string
- Description
交易对平台名称
- Name
trade
- Type
- string
- Description
成交额
- Name
vol_coin
- Type
- string
- Description
持仓量(币种数量)
- Name
trend
- Type
- array
- Description
趋势图
- Name
time
- Type
- string
- Description
时间戳,单位秒
- Name
close
- Type
- string
- Description
收盘持仓量
请求
curl -G https://open.aicoin.com/api/v2/futures/interest \
-d "lan=cn" \
-d "page=1" \
-d "pageSize=20" \
-d "currency=usd" \
-d "AccessKeyId=YOUR_ACCESS_KEY_ID" \
-d "SignatureNonce=RANDOM_NONCE" \
-d "Timestamp=CURRENT_TIMESTAMP" \
-d "Signature=YOUR_SIGNATURE"
响应
{
"success": true,
"errorCode": 200,
"error": "",
"data": {
"list": [
{
"key": "xbt:bitmex",
"show": "BTC",
"currency": "USD",
"market_name": "BitMEX永续",
"trade": "3485934999.08",
"vol_coin": "97257.32371667",
"trend": [
{
"time": "1554832800",
"close": "470170798"
}
]
}
]
}
}
获取指数价格
此接口用于获取指数价格数据。
请求参数
- Name
key
- Type
- string
- Description
指数主键(通过 /api/v2/index/getIndex 获取)
- Name
currency
- Type
- string
- Description
定价,cny、usd等
- Name
AccessKeyId
- Type
- string
- Description
用户访问密钥ID
- Name
SignatureNonce
- Type
- string
- Description
签名随机数
- Name
Timestamp
- Type
- string
- Description
请求时间戳(秒),有效期30秒
- Name
Signature
- Type
- string
- Description
使用 HmacSHA1 + Base64 生成的签名,请参考如何获取 API 认证参数
返回数据
- Name
success
- Type
- boolean
- Description
接口状态
- Name
errorCode
- Type
- integer
- Description
状态码
- Name
error
- Type
- string
- Description
错误提示信息
- Name
data
- Type
- object
- Description
返回数据
- Name
price
- Type
- string
- Description
最新价
- Name
open
- Type
- string
- Description
今天开盘价
- Name
high
- Type
- string
- Description
24小时最高价
- Name
low
- Type
- string
- Description
24小时最低价
- Name
close
- Type
- string
- Description
昨天收盘价
- Name
degree24H
- Type
- string
- Description
24小时涨跌幅
- Name
change24H
- Type
- string
- Description
24小时涨跌
- Name
up
- Type
- string
- Description
上涨
- Name
down
- Type
- string
- Description
下跌
请求
curl -G https://open.aicoin.com/api/v2/index/indexPrice \
-d "key=i:diniw:ice" \
-d "currency=usd" \
-d "AccessKeyId=YOUR_ACCESS_KEY_ID" \
-d "SignatureNonce=RANDOM_NONCE" \
-d "Timestamp=CURRENT_TIMESTAMP" \
-d "Signature=YOUR_SIGNATURE"
响应
{
"success": true,
"errorCode": 200,
"error": "",
"data": {
"price": "933.2206291652",
"open": "966.1194468979",
"high": "968.23409269",
"low": "890.6764162168",
"close": "906.5192845811",
"degree24H": "2.88",
"change24H": "26.13",
"up": "0",
"down": "0"
}
}
获取指数信息
此接口用于获取指数的详细信息。
请求参数
- Name
key
- Type
- string
- Description
指数主键(通过 /api/v2/index/getIndex 获取)
- Name
lan
- Type
- string
- Description
语言,en, cn
- Name
AccessKeyId
- Type
- string
- Description
用户访问密钥ID
- Name
SignatureNonce
- Type
- string
- Description
签名随机数
- Name
Timestamp
- Type
- string
- Description
请求时间戳(秒),有效期30秒
- Name
Signature
- Type
- string
- Description
使用 HmacSHA1 + Base64 生成的签名,请参考如何获取 API 认证参数
返回数据
- Name
success
- Type
- boolean
- Description
接口状态
- Name
errorCode
- Type
- integer
- Description
状态码
- Name
error
- Type
- string
- Description
错误提示信息
- Name
data
- Type
- object
- Description
返回数据
- Name
show
- Type
- string
- Description
指数简称
- Name
name
- Type
- string
- Description
指数名称
- Name
link
- Type
- string
- Description
官方网站
- Name
release_date
- Type
- string
- Description
发布日期
- Name
amount
- Type
- string
- Description
成分币数量
- Name
introduce
- Type
- string
- Description
指数说明
- Name
file_name
- Type
- string
- Description
编制文件名称
- Name
file_link
- Type
- string
- Description
编制文件链接
请求
curl -G https://open.aicoin.com/api/v2/index/indexInfo \
-d "key=i:diniw:ice" \
-d "lan=cn"
响应
{
"success": true,
"errorCode": 200,
"error": "",
"data": {
"show": "DXY",
"name": "美元指数",
"link": "https://finance.sina.com.cn/money/forex/hq/DINIW.shtml",
"release_date": "",
"amount": "0",
"introduce": "",
"file_name": "",
"file_link": ""
}
}
获取指数列表
此接口用于获取指数列表。
请求参数
- Name
AccessKeyId
- Type
- string
- Description
用户访问密钥ID
- Name
SignatureNonce
- Type
- string
- Description
签名随机数
- Name
Timestamp
- Type
- string
- Description
请求时间戳(秒),有效期30秒
- Name
Signature
- Type
- string
- Description
使用 HmacSHA1 + Base64 生成的签名,请参考如何获取 API 认证参数
返回数据
- Name
success
- Type
- boolean
- Description
接口状态
- Name
errorCode
- Type
- integer
- Description
状态码
- Name
error
- Type
- string
- Description
错误提示信息
- Name
data
- Type
- object
- Description
返回数据
- Name
list
- Type
- array
- Description
指数列表
- Name
key
- Type
- string
- Description
指数主键
- Name
cn_name
- Type
- string
- Description
指数中文名称
- Name
en_name
- Type
- string
- Description
指数英文名称
- Name
show
- Type
- string
- Description
指数简称
- Name
describe
- Type
- string
- Description
指数描述
- Name
degree24h
- Type
- string
- Description
24小时涨跌幅
- Name
price
- Type
- string
- Description
最新价格
- Name
en_type
- Type
- string
- Description
英文类型
- Name
cn_type
- Type
- string
- Description
中文类型
- Name
count
- Type
- string
- Description
指数数量
请求
curl -G https://open.aicoin.com/api/v2/index/getIndex \
-H "AccessKeyId: YOUR_ACCESS_KEY" \
-H "SignatureNonce: RANDOM_NONCE" \
-H "Timestamp: TIMESTAMP" \
-H "Signature: YOUR_SIGNATURE"
响应
{
"success": true,
"errorCode": 200,
"error": "",
"data": {
"list": [
{
"key": "i:fgi:alternative",
"cn_name": "恐惧&贪婪指数",
"en_name": "Crypto Fear & Greed Index",
"show": "FGI",
"describe": "描述",
"degree24h": "-6.00",
"price": "47",
"cn_type": "",
"en_type": ""
}
],
"count": "156"
}
}
k线指标交易对
此接口用于获取k线指标交易对。
请求参数
- Name
coinType
- Type
- string
- Description
币种,如 bitcoin
- Name
indicator_key
- Type
- string
- Description
指标主键:
- fundflow: 资金流向,字段:timestmap(时间戳)、value(资金流向数值)
- ttsi: 交易精英趋向指标,字段:time(时间戳)、buyAccount(做多账户比例)、sellAccount(做空账户比例)
- ttmu: 交易精英多空平均持仓比例,字段:time(时间戳)、buyInterest(做多平均持仓比例)、sellInterest(做空平均持仓比例)
- position: 持仓量,字段:time(时间戳)、open(开)、high(高)、low(低)、close(收)
- lsur: 多空持仓人数比,字段:time(时间戳)、sellAccount(卖数量)、buyAccount(买数量)、ratios(多空比例)
- tvolume: 交易量,字段:time(时间戳)、openInterest(合约总量)、volume(成交量)
- ftbs: 合约主动买入卖出,字段:time(时间戳)、buyVolume(买入成交量)、sellVolume(卖出成交量)
- basis: 合约基差,字段:time(时间戳)、basis(基差数值)、basisRate
- mlr: 杠杆多空比,字段:time(时间戳)、ratios(杠杆比数值)
- bsv: 币币主动买入/卖出情况,字段:time(时间戳)、buyVolume(主动买单成交量)、sellVolume(主动卖单成交量)
- fr: 资金费率,字段:fundingTime(当期资金费率时间)、time(数据获取时间戳)、fundingRate(资金费率)
- aibst: 买卖笔数,字段:timestamp(时间戳)、buyAccount(买单数量)、sellAccount(卖单数量)
- aili: 爆仓单统计,字段:timestamp(时间戳)、buySize(平空张数)、sellSize(平多张数)
- aiaggtrade: 聚合主力大单成交,字段:timestamp(时间戳)、key(交易对主键)、coin_type(币种主键)、trade_type(方向)等
- Name
AccessKeyId
- Type
- string
- Description
用户访问密钥ID
- Name
SignatureNonce
- Type
- string
- Description
签名随机数
- Name
Timestamp
- Type
- string
- Description
请求时间戳(秒),有效期30秒
- Name
Signature
- Type
- string
- Description
使用 HmacSHA1 + Base64 生成的签名,请参考如何获取 API 认证参数
返回数据
- Name
success
- Type
- boolean
- Description
接口状态
- Name
errorCode
- Type
- integer
- Description
状态码
- Name
error
- Type
- string
- Description
错误提示信息
- Name
data
- Type
- object
- Description
返回数据
- Name
list
- Type
- array
- Description
交易对列表
请求
curl -G https://open.aicoin.com/api/v2/indicatorKline/getTradingPair \
-d "coinType=bitcoin" \
-d "indicator_key=aiaggtrade" \
-d "AccessKeyId=YOUR_ACCESS_KEY_ID" \
-d "SignatureNonce=RANDOM_NONCE" \
-d "Timestamp=CURRENT_TIMESTAMP" \
-d "Signature=YOUR_SIGNATURE"
响应
{
"success": true,
"errorCode": 200,
"error": "",
"data": {
"list": [
[
"btcusdt:okex",
"btcusdt:okex"
]
]
}
}
指标K线数据
此接口用于获取指标K线数据,单次最多获取500条K线数据。
请求参数
- Name
symbol
- Type
- string
- Description
交易对,如 btcusdt:okex
- Name
indicator_key
- Type
- string
- Description
指标主键,如 fundflow
- Name
size
- Type
- integer
- Description
数据条数,范围:1-500
- Name
open_time
- Type
- integer
- Description
开盘时间,0:北京时间0点,8:北京时间8点(默认:0)
- Name
period
- Type
- integer
- Description
时间间隔,单位秒(如:900表示15min周期,14400秒表示4h周期)
- Name
since
- Type
- integer
- Description
开始时间(默认当前时间)
- Name
AccessKeyId
- Type
- string
- Description
用户访问密钥ID
- Name
SignatureNonce
- Type
- string
- Description
签名随机数
- Name
Timestamp
- Type
- string
- Description
请求时间戳(秒),有效期30秒
- Name
Signature
- Type
- string
- Description
使用 HmacSHA1 + Base64 生成的签名,请参考如何获取 API 认证参数
返回数据
- Name
success
- Type
- boolean
- Description
接口状态
- Name
errorCode
- Type
- integer
- Description
状态码
- Name
error
- Type
- string
- Description
错误提示信息
- Name
data
- Type
- object
- Description
返回数据
- Name
kline_data
- Type
- object
- Description
K线数据
- Name
mapping
- Type
- array
- Description
K线数据相关字段
- Name
list
- Type
- array
- Description
K线数据列表
- Name
request_state
- Type
- integer
- Description
请求状态
请求
curl -G https://open.aicoin.com/api/v2/indicatorKline/dataRecords \
-d "symbol=btcusdt:okex" \
-d "indicator_key=aiaggtrade" \
-d "period=900" \
-d "AccessKeyId=YOUR_ACCESS_KEY_ID" \
-d "SignatureNonce=RANDOM_NONCE" \
-d "Timestamp=CURRENT_TIMESTAMP" \
-d "Signature=YOUR_SIGNATURE"
响应
{
"success": true,
"errorCode": 200,
"error": "",
"data": {
"kline_data": {
"mapping": [
"timestamp",
"buyTurnover",
"sellTurnover"
],
"list": [
[
"1692688800",
"102115751.81482554",
"56985363.47174822"
]
],
"request_state": 0
}
}
}
获取K线数据
此接口用于获取K线数据,单次最多获取500条K线数据。
请求参数
- Name
symbol
- Type
- string
- Description
交易对,如 交易对:btcusdt:okex,指数:i:ixic:nasdaq
- Name
size
- Type
- integer
- Description
数据条数,范围:1-500
- Name
open_time
- Type
- integer
- Description
开盘时间,0:北京时间0点,8:北京时间8点(默认:0)
- Name
period
- Type
- integer
- Description
时间间隔,单位秒(如:900 表示 15min周期,14400秒表示4h周期,可以查看一下Aicoin上面的周期,避免拿不到数据)
- Name
since
- Type
- integer
- Description
开始时间(默认当前时间)
- Name
AccessKeyId
- Type
- string
- Description
用户访问密钥ID
- Name
SignatureNonce
- Type
- string
- Description
签名随机数
- Name
Timestamp
- Type
- string
- Description
请求时间戳(秒),有效期30秒
- Name
Signature
- Type
- string
- Description
使用 HmacSHA1 + Base64 生成的签名,请参考如何获取 API 认证参数
返回数据
- Name
success
- Type
- boolean
- Description
接口状态
- Name
errorCode
- Type
- integer
- Description
状态码
- Name
error
- Type
- string
- Description
错误提示信息
- Name
data
- Type
- object
- Description
返回数据
- Name
kline_data
- Type
- array
- Description
K线数据,每个数组元素包含:[时间(秒)、开盘价、最高价、最低价、收盘价、成交量]
请求
curl -G https://open.aicoin.com/api/v2/commonKline/dataRecords \
-d "symbol=btcusdt:okex" \
-d "period=900" \
-d "AccessKeyId=YOUR_ACCESS_KEY_ID" \
-d "SignatureNonce=RANDOM_NONCE" \
-d "Timestamp=CURRENT_TIMESTAMP" \
-d "Signature=YOUR_SIGNATURE"
响应
{
"success": true,
"errorCode": 200,
"error": "",
"data": {
"kline_data": [
[
1539172800,
6501.95,
6515.58,
6489.88,
6490.2,
721688
],
[
1539187200,
6490.21,
6549.8,
6485,
6532.19,
704650
]
]
}
}
获取热门标签币种列表
此接口用于获取热门标签下的币种列表数据。
请求参数
- Name
key
- Type
- string
- Description
标签类型,可选值:
- gamefi (GameFi)
- anonymous (匿名币)
- market (平台币)
- web (Web3.0)
- newcoin (新币)
- stable (稳定币)
- defi (Defi)
- Name
currency
- Type
- string
- Description
定价单位,可选值: cny 或 usd
- Name
AccessKeyId
- Type
- string
- Description
用户访问密钥ID
- Name
SignatureNonce
- Type
- string
- Description
签名随机数
- Name
Timestamp
- Type
- string
- Description
请求时间戳(秒),有效期30秒
- Name
Signature
- Type
- string
- Description
使用 HmacSHA1 + Base64 生成的签名,请参考如何获取 API 认证参数
返回数据
- Name
success
- Type
- boolean
- Description
接口状态
- Name
errorCode
- Type
- integer
- Description
状态码
- Name
error
- Type
- string
- Description
错误提示信息
- Name
data
- Type
- object
- Description
返回数据
- Name
list
- Type
- array
- Description
币种列表
- Name
key
- Type
- string
- Description
币种主键
- Name
logo
- Type
- string
- Description
币种logo
- Name
show
- Type
- string
- Description
币种简称
- Name
cn_name
- Type
- string
- Description
币种中文名
- Name
en_name
- Type
- string
- Description
币种英文名
- Name
price
- Type
- string
- Description
币种价格
- Name
vol24H
- Type
- string
- Description
24小时成交量
- Name
trade24H
- Type
- string
- Description
24小时成交额
- Name
degree24H
- Type
- string
- Description
24小时涨跌幅
请求
curl -G https://open.aicoin.com/api/v2/market/hotTabCoins \
-d "key=newcoin" \
-d "currency=cny" \
-d "AccessKeyId=YOUR_ACCESS_KEY_ID" \
-d "SignatureNonce=RANDOM_NONCE" \
-d "Timestamp=CURRENT_TIMESTAMP" \
-d "Signature=YOUR_SIGNATURE"
响应
{
"success": true,
"errorCode": 200,
"error": "",
"data": {
"list": [
{
"key": "CAITOKEN",
"logo": "https://static.aicoinstorge.com/coin/20180530/152767311568822.png?x-oss-process=image/resize,m_lfit,h_45,w_45,image/circle,r_21/format,png",
"show": "CAI",
"cn_name": "",
"en_name": "CAI TOKEN",
"price": "0.0278",
"vol24H": "10500000000",
"trade24H": "21457158.638175",
"degree24H": "0.72"
}
]
}
}
获取平台行情数据
此接口用于获取交易平台的行情数据,包括资金净流入等信息。
请求参数
- Name
market_list
- Type
- string
- Description
平台列表,用英文逗号连接,最多100个平台
- Name
AccessKeyId
- Type
- string
- Description
用户访问密钥ID
- Name
SignatureNonce
- Type
- string
- Description
签名随机数
- Name
Timestamp
- Type
- string
- Description
请求时间戳(秒),有效期30秒
- Name
Signature
- Type
- string
- Description
使用 HmacSHA1 + Base64 生成的签名,请参考如何获取 API 认证参数
返回数据
- Name
success
- Type
- boolean
- Description
接口状态
- Name
errorCode
- Type
- integer
- Description
状态码
- Name
error
- Type
- string
- Description
错误提示信息
- Name
data
- Type
- array
- Description
返回数据
- Name
market_key
- Type
- string
- Description
平台主键
- Name
fundNetInCny
- Type
- string
- Description
净流入(人民币),空字符串表示没有数据
- Name
fundNetInUsd
- Type
- string
- Description
净流入(美元),空字符串表示没有数据
请求
curl -G https://open.aicoin.com/api/v2/market/ticker \
-d "market_list=okex,binance" \
-d "AccessKeyId=YOUR_ACCESS_KEY_ID" \
-d "SignatureNonce=RANDOM_NONCE" \
-d "Timestamp=CURRENT_TIMESTAMP" \
-d "Signature=YOUR_SIGNATURE"
响应
{
"success": true,
"errorCode": 200,
"error": "",
"data": [
{
"market_key": "okex",
"fundNetInCny": "1000",
"fundNetInUsd": "1000"
}
]
}
获取所有平台
此接口用于获取所有交易平台的基本信息。
请求参数
- Name
AccessKeyId
- Type
- string
- Description
用户访问密钥ID
- Name
SignatureNonce
- Type
- string
- Description
签名随机数
- Name
Timestamp
- Type
- string
- Description
请求时间戳(秒),有效期30秒
- Name
Signature
- Type
- string
- Description
使用 HmacSHA1 + Base64 生成的签名,请参考如何获取 API 认证参数
返回数据
- Name
success
- Type
- boolean
- Description
接口状态
- Name
errorCode
- Type
- integer
- Description
状态码
- Name
error
- Type
- string
- Description
错误提示信息
- Name
data
- Type
- array
- Description
返回数据
- Name
key
- Type
- string
- Description
平台主键
- Name
en_name
- Type
- string
- Description
平台英文名称
- Name
cn_name
- Type
- string
- Description
平台中文名称
请求
curl -G https://open.aicoin.com/api/v2/market \
-d "AccessKeyId=YOUR_ACCESS_KEY_ID" \
-d "SignatureNonce=RANDOM_NONCE" \
-d "Timestamp=CURRENT_TIMESTAMP" \
-d "Signature=YOUR_SIGNATURE"
响应
{
"success": true,
"errorCode": 200,
"error": "",
"data": [
{
"key": "okex",
"en_name": "OKEx",
"cn_name": "欧易OKX"
}
]
}
获取币种国库实体数据
获取特定币种的国库实体数据,支持分页和多种筛选条件。
权限要求
coin_treasury_COIN_TREASURY_ENTITIES
请求参数
- Name
coin
- Type
- string
- Description
币种筛选(如:BTC、ETH)
- Name
entity_type
- Type
- string
- Description
实体类型筛选
- Name
name
- Type
- string
- Description
实体名称模糊搜索
- Name
ticker
- Type
- string
- Description
股票代码筛选
- Name
start_date
- Type
- string
- Description
开始时间,ISO 8601格式
- Name
end_date
- Type
- string
- Description
结束时间,ISO 8601格式
- Name
page
- Type
- integer
- Description
页码,从1开始,默认1
- Name
page_size
- Type
- integer
- Description
每页大小,默认20,最大100
- Name
sort_order
- Type
- string
- Description
排序方向:asc/desc,默认desc
- Name
AccessKeyId
- Type
- string
- Description
用户访问密钥ID
- Name
SignatureNonce
- Type
- string
- Description
签名随机数
- Name
Timestamp
- Type
- string
- Description
请求时间戳(秒),有效期30秒
- Name
Signature
- Type
- string
- Description
使用 HmacSHA1 + Base64 生成的签名,请参考如何获取 API 认证参数
返回数据
- Name
code
- Type
- string
- Description
状态码
- Name
msg
- Type
- string
- Description
响应消息
- Name
data
- Type
- object
- Description
返回数据
- Name
list
- Type
- array
- Description
币种国库实体数据列表
- Name
id
- Type
- string
- Description
实体记录唯一标识符
- Name
coin
- Type
- string
- Description
币种代码(如:BTC、ETH)
- Name
name
- Type
- string
- Description
实体名称
- Name
ticker
- Type
- string
- Description
股票代码(如适用)
- Name
entity_type
- Type
- string
- Description
实体类型(如:public-companies、eth-treasuries)
- Name
hold_amount
- Type
- number
- Description
持仓数量
- Name
days30
- Type
- number
- Description
30天变化量
- Name
last
- Type
- number
- Description
最近变化
- Name
share
- Type
- number
- Description
市场份额占比
- Name
in_usd
- Type
- number
- Description
美元价值
- Name
market_cap
- Type
- number
- Description
市值(美元)
- Name
enterprise_value
- Type
- number
- Description
企业价值(美元,可为null)
- Name
btc_share
- Type
- number
- Description
BTC市场份额(可为null)
- Name
cost_basis
- Type
- number
- Description
成本基础(可为null)
- Name
ngu
- Type
- number
- Description
NGU指标(可为null)
- Name
mnav
- Type
- number
- Description
MNAV指标
- Name
mcap
- Type
- number
- Description
市值倍数
请求
curl -X POST https://open.aicoin.com/api/upgrade/v2/coin-treasuries/entities \
-H "Content-Type: application/json" \
-d '{
"coin": "BTC",
"entity_type": "Company",
"name": "Tesla",
"ticker": "TSLA",
"start_date": "2025-01-01T00:00:00Z",
"end_date": "2025-01-31T23:59:59Z",
"page": 1,
"page_size": 20,
"sort_order": "desc",
"AccessKeyId": "YOUR_ACCESS_KEY_ID",
"SignatureNonce": "RANDOM_NONCE",
"Timestamp": "CURRENT_TIMESTAMP",
"Signature": "YOUR_SIGNATURE"
}'
响应
{
"code": "0",
"msg": "success",
"data": {
"list": [
{
"id": "6899db84277d4951ab27938b",
"coin": "BTC",
"name": "Bitcoin Group SE",
"ticker": "ADE.DE",
"entity_type": "public-companies",
"hold_amount": 3605,
"days30": 0,
"last": 0,
"share": 0.00017,
"in_usd": 435000000,
"market_cap": 254000000,
"enterprise_value": 231000000,
"btc_share": 0.00070882,
"cost_basis": null,
"ngu": null,
"mnav": 0.585,
"mcap": 1.709
}
]
}
}
获取币种国库历史数据
获取币种国库的历史变动数据,追踪买卖活动。
权限要求
coin_treasury_COIN_TREASURY_HISTORY
请求参数
- Name
coin
- Type
- string
- Description
币种筛选
- Name
name
- Type
- string
- Description
实体名称
- Name
type
- Type
- string
- Description
类型筛选:Buy/Sell
- Name
start_date
- Type
- string
- Description
开始时间
- Name
end_date
- Type
- string
- Description
结束时间
- Name
page
- Type
- integer
- Description
页码,默认1
- Name
page_size
- Type
- integer
- Description
每页大小,默认20
- Name
sort_by
- Type
- string
- Description
排序字段,默认date
- Name
sort_order
- Type
- string
- Description
排序方向,默认desc
- Name
AccessKeyId
- Type
- string
- Description
用户访问密钥ID
- Name
SignatureNonce
- Type
- string
- Description
签名随机数
- Name
Timestamp
- Type
- string
- Description
请求时间戳(秒),有效期30秒
- Name
Signature
- Type
- string
- Description
使用 HmacSHA1 + Base64 生成的签名,请参考如何获取 API 认证参数
返回数据
- Name
code
- Type
- string
- Description
状态码
- Name
msg
- Type
- string
- Description
响应消息
- Name
data
- Type
- object
- Description
返回数据
- Name
list
- Type
- array
- Description
币种国库历史数据列表
- Name
id
- Type
- string
- Description
历史记录唯一标识符
- Name
coin
- Type
- string
- Description
币种代码
- Name
name
- Type
- string
- Description
实体名称
- Name
date
- Type
- number
- Description
交易日期时间戳
- Name
type
- Type
- string
- Description
交易类型(Buy/Sell)
- Name
balance
- Type
- number
- Description
交易后余额
- Name
change
- Type
- number
- Description
变化数量
- Name
total_cost_usd
- Type
- number
- Description
总成本(美元,可为null)
- Name
price
- Type
- number
- Description
交易价格
- Name
stock_price
- Type
- number
- Description
股票价格(可为null)
请求
curl -X POST https://open.aicoin.com/api/upgrade/v2/coin-treasuries/history \
-H "Content-Type: application/json" \
-d '{
"coin": "BTC",
"name": "MicroStrategy",
"type": "Buy",
"start_date": "2025-01-01T00:00:00Z",
"end_date": "2025-01-31T23:59:59Z",
"page": 1,
"page_size": 20,
"sort_by": "date",
"sort_order": "desc",
"AccessKeyId": "YOUR_ACCESS_KEY_ID",
"SignatureNonce": "RANDOM_NONCE",
"Timestamp": "CURRENT_TIMESTAMP",
"Signature": "YOUR_SIGNATURE"
}'
响应
{
"code": "0",
"msg": "success",
"data": {
"list": [
{
"id": "6899de38277d4951ab279611",
"coin": "BTC",
"name": "Sequans Communications S.A.",
"date": 1754870400,
"type": "Buy",
"balance": 3170,
"change": 13,
"total_cost_usd": null,
"price": 116484,
"stock_price": 1.28
}
]
}
}
获取累计币种国库历史数据
获取币种国库的累计持仓历史,显示时间序列的累计变化。
权限要求
coin_treasury_COIN_TREASURY_HISTORY_ACCUMULATED
请求参数
- Name
coin
- Type
- string
- Description
币种(必填)
- Name
entity_type
- Type
- string
- Description
实体类型筛选
- Name
start_date
- Type
- string
- Description
开始时间
- Name
end_date
- Type
- string
- Description
结束时间
- Name
interval
- Type
- string
- Description
时间间隔:daily/weekly/monthly
- Name
AccessKeyId
- Type
- string
- Description
用户访问密钥ID
- Name
SignatureNonce
- Type
- string
- Description
签名随机数
- Name
Timestamp
- Type
- string
- Description
请求时间戳(秒),有效期30秒
- Name
Signature
- Type
- string
- Description
使用 HmacSHA1 + Base64 生成的签名,请参考如何获取 API 认证参数
返回数据
- Name
code
- Type
- string
- Description
状态码
- Name
msg
- Type
- string
- Description
响应消息
- Name
data
- Type
- object
- Description
返回数据
- Name
coin
- Type
- string
- Description
币种代码
- Name
total_entities
- Type
- number
- Description
总实体数量
- Name
latest_value_usd
- Type
- number
- Description
最新美元价值
- Name
latest_hold_amount
- Type
- number
- Description
最新持仓数量
- Name
accumulated_data
- Type
- array
- Description
累计数据列表
- Name
date
- Type
- string
- Description
日期
- Name
timestamp
- Type
- number
- Description
时间戳
- Name
accumulated_amount
- Type
- number
- Description
累计数量
- Name
activities
- Type
- array
- Description
活动记录
- Name
name
- Type
- string
- Description
实体名称
- Name
change
- Type
- number
- Description
变化数量
- Name
type
- Type
- string
- Description
操作类型(Buy/Sell)
请求
curl -X POST https://open.aicoin.com/api/upgrade/v2/coin-treasuries/history/accumulated \
-H "Content-Type: application/json" \
-d '{
"coin": "BTC",
"entity_type": "Company",
"start_date": "2024-01-01T00:00:00Z",
"end_date": "2025-01-31T23:59:59Z",
"interval": "daily",
"AccessKeyId": "YOUR_ACCESS_KEY_ID",
"SignatureNonce": "RANDOM_NONCE",
"Timestamp": "CURRENT_TIMESTAMP",
"Signature": "YOUR_SIGNATURE"
}'
响应
{
"code": "0",
"msg": "success",
"data": {
"coin": "BTC",
"total_entities": 291,
"latest_value_usd": 440049000000,
"latest_hold_amount": 3649917,
"accumulated_data": [
{
"date": "2025-07-12",
"timestamp": 1752278400,
"accumulated_amount": 3508890,
"activities": [
{
"name": "bitmax",
"change": 0,
"type": "Buy"
},
{
"name": "Bhutan",
"change": 100,
"type": "Sell"
},
{
"name": "El Salvador",
"change": 1,
"type": "Buy"
},
{
"name": "GIGA Inc.",
"change": 1129,
"type": "Buy"
}
]
}
]
}
}
获取最新币种国库实体数据
获取指定币种的最新国库实体数据列表。
权限要求
coin_treasury_LATEST_COIN_TREASURY_ENTITIES
请求参数
- Name
coin
- Type
- string
- Description
币种(必填),如 BTC、ETH
- Name
AccessKeyId
- Type
- string
- Description
用户访问密钥ID
- Name
SignatureNonce
- Type
- string
- Description
签名随机数
- Name
Timestamp
- Type
- string
- Description
请求时间戳(秒),有效期30秒
- Name
Signature
- Type
- string
- Description
使用 HmacSHA1 + Base64 生成的签名,请参考如何获取 API 认证参数
返回数据
- Name
code
- Type
- string
- Description
状态码
- Name
msg
- Type
- string
- Description
响应消息
- Name
data
- Type
- array
- Description
最新币种国库实体数据列表
- Name
id
- Type
- string
- Description
实体记录唯一标识符
- Name
coin
- Type
- string
- Description
币种代码(如:BTC、ETH)
- Name
name
- Type
- string
- Description
实体名称
- Name
ticker
- Type
- string
- Description
股票代码(如适用)
- Name
entity_type
- Type
- string
- Description
实体类型(如:public-companies、eth-treasuries)
- Name
hold_amount
- Type
- number
- Description
持仓数量
- Name
days30
- Type
- number
- Description
30天变化量
- Name
last
- Type
- number
- Description
最近变化
- Name
share
- Type
- number
- Description
市场份额占比
- Name
in_usd
- Type
- number
- Description
美元价值
- Name
market_cap
- Type
- number
- Description
市值(美元)
- Name
enterprise_value
- Type
- number
- Description
企业价值(美元,可为null)
- Name
btc_share
- Type
- number
- Description
BTC市场份额(可为null)
- Name
cost_basis
- Type
- number
- Description
成本基础(可为null)
- Name
ngu
- Type
- number
- Description
NGU指标(可为null)
- Name
mnav
- Type
- number
- Description
MNAV指标
- Name
mcap
- Type
- number
- Description
市值倍数
请求
curl -G https://open.aicoin.com/api/upgrade/v2/coin-treasuries/latest/entities \
-d "coin=BTC" \
-d "AccessKeyId=YOUR_ACCESS_KEY_ID" \
-d "SignatureNonce=RANDOM_NONCE" \
-d "Timestamp=CURRENT_TIMESTAMP" \
-d "Signature=YOUR_SIGNATURE"
响应
{
"code": "0",
"msg": "success",
"data": [
{
"id": "6899db84277d4951ab27937a",
"coin": "BTC",
"name": "XXI",
"ticker": "CEP",
"entity_type": "public-companies",
"hold_amount": 43514,
"days30": 0,
"last": 0,
"share": 0.00207,
"in_usd": 5247000000,
"market_cap": 276000000,
"enterprise_value": null,
"btc_share": null,
"cost_basis": null,
"ngu": null,
"mnav": 0.053,
"mcap": 18.987
}
]
}
获取最新币种国库历史数据
获取指定币种的最新国库历史变动数据。
权限要求
coin_treasury_LATEST_COIN_TREASURY_HISTORY
请求参数
- Name
coin
- Type
- string
- Description
币种(必填),如 BTC、ETH
- Name
AccessKeyId
- Type
- string
- Description
用户访问密钥ID
- Name
SignatureNonce
- Type
- string
- Description
签名随机数
- Name
Timestamp
- Type
- string
- Description
请求时间戳(秒),有效期30秒
- Name
Signature
- Type
- string
- Description
使用 HmacSHA1 + Base64 生成的签名,请参考如何获取 API 认证参数
返回数据
- Name
code
- Type
- string
- Description
状态码
- Name
msg
- Type
- string
- Description
响应消息
- Name
data
- Type
- array
- Description
最新币种国库历史数据列表
- Name
id
- Type
- string
- Description
历史记录唯一标识符
- Name
coin
- Type
- string
- Description
币种代码
- Name
name
- Type
- string
- Description
实体名称
- Name
date
- Type
- number
- Description
交易日期时间戳
- Name
type
- Type
- string
- Description
交易类型(Buy/Sell)
- Name
balance
- Type
- number
- Description
交易后余额
- Name
change
- Type
- number
- Description
变化数量
- Name
total_cost_usd
- Type
- number
- Description
总成本(美元,可为null)
- Name
price
- Type
- number
- Description
交易价格
- Name
stock_price
- Type
- number
- Description
股票价格(可为null)
请求
curl -G https://open.aicoin.com/api/upgrade/v2/coin-treasuries/latest/history \
-d "coin=BTC" \
-d "AccessKeyId=YOUR_ACCESS_KEY_ID" \
-d "SignatureNonce=RANDOM_NONCE" \
-d "Timestamp=CURRENT_TIMESTAMP" \
-d "Signature=YOUR_SIGNATURE"
响应
{
"code": "0",
"msg": "success",
"data": [
{
"id": "6899de38277d4951ab27992d",
"coin": "BTC",
"name": "El Salvador",
"date": 1754870400,
"type": "Buy",
"balance": 6265,
"change": 1,
"total_cost_usd": null,
"price": 116484,
"stock_price": null
}
]
}
获取币种国库数据汇总
获取指定币种的国库数据统计汇总信息。
权限要求
coin_treasury_COIN_TREASURY_SUMMARY
请求参数
- Name
coin
- Type
- string
- Description
币种(必填),如 BTC、ETH
- Name
AccessKeyId
- Type
- string
- Description
用户访问密钥ID
- Name
SignatureNonce
- Type
- string
- Description
签名随机数
- Name
Timestamp
- Type
- string
- Description
请求时间戳(秒),有效期30秒
- Name
Signature
- Type
- string
- Description
使用 HmacSHA1 + Base64 生成的签名,请参考如何获取 API 认证参数
返回数据
- Name
code
- Type
- string
- Description
状态码
- Name
msg
- Type
- string
- Description
响应消息
- Name
data
- Type
- object
- Description
币种国库汇总数据
- Name
total_entities
- Type
- number
- Description
总实体数量
- Name
total_hold_amount
- Type
- number
- Description
总持仓数量
- Name
total_value_usd
- Type
- number
- Description
总价值(美元)
- Name
total_market_cap
- Type
- number
- Description
总市值(美元)
- Name
average_share
- Type
- number
- Description
平均市场份额
- Name
last_update_time
- Type
- string
- Description
最后更新时间
请求
curl -G https://open.aicoin.com/api/upgrade/v2/coin-treasuries/summary \
-d "coin=BTC" \
-d "AccessKeyId=YOUR_ACCESS_KEY_ID" \
-d "SignatureNonce=RANDOM_NONCE" \
-d "Timestamp=CURRENT_TIMESTAMP" \
-d "Signature=YOUR_SIGNATURE"
响应
{
"code": "0",
"msg": "success",
"data": {
"total_entities": 291,
"total_hold_amount": 3649917,
"total_value_usd": 440049000000,
"total_market_cap": 1876344000000,
"average_share": 0.0005970790378006872,
"last_update_time": "2025-08-11T12:01:08Z"
}
}
获取全量深度数据
获取指定交易对的完整买卖盘深度数据,返回原始的买卖盘信息。
权限要求
FULL_DEPTH
功能描述
该接口直接读取指定交易对的全量深度数据,返回原始的买卖盘信息。数据格式为二维数组,每一项包含价格和数量信息。
请求参数
- Name
dbKey
- Type
- string
- Description
数据库键,格式为
交易对:交易所
(如:btcswapusd:hbdm)
- Name
AccessKeyId
- Type
- string
- Description
用户访问密钥ID
- Name
SignatureNonce
- Type
- string
- Description
签名随机数
- Name
Timestamp
- Type
- string
- Description
请求时间戳(秒),有效期30秒
- Name
Signature
- Type
- string
- Description
使用 HmacSHA1 + Base64 生成的签名,请参考如何获取 API 认证参数
支持的dbKey示例
btcswapusd:hbdm
- 火币BTC永续合约ethswapusd:hbdm
- 火币ETH永续合约btcswapusdt:binance
- 币安BTC永续合约ethswapusdt:binance
- 币安ETH永续合约
返回数据
- Name
code
- Type
- string
- Description
响应状态码,"0"表示成功
- Name
msg
- Type
- string
- Description
响应消息
- Name
data
- Type
- object
- Description
深度数据对象
- Name
timestamp
- Type
- integer
- Description
数据时间戳(毫秒)
- Name
action
- Type
- string
- Description
操作类型,通常为"partial"
- Name
bids
- Type
- array
- Description
买盘数据,二维数组格式 [[价格, 数量], ...],按价格从高到低排序
- Name
asks
- Type
- array
- Description
卖盘数据,二维数组格式 [[价格, 数量], ...],按价格从低到高排序
请求
curl -G https://open.aicoin.com/api/upgrade/v2/futures/full-depth \
-d "dbKey=btcswapusd:hbdm" \
-d "AccessKeyId=YOUR_ACCESS_KEY_ID" \
-d "SignatureNonce=RANDOM_NONCE" \
-d "Timestamp=CURRENT_TIMESTAMP" \
-d "Signature=YOUR_SIGNATURE"
响应
{
"code": "0",
"msg": "success",
"data": {
"timestamp": 1755179093165,
"action": "partial",
"bids": [
[118332.4, 169],
[118326.5, 5],
[118326.4, 169],
[118320.4, 169],
[118314.4, 169]
],
"asks": [
[118365.1, 169],
[118371, 100],
[118371.1, 169],
[118377, 1],
[118377.7, 100]
]
}
}
获取全量深度价格分组数据
获取按指定价格间隔分组聚合后的深度数据,支持不同粒度的价格分析。
权限要求
FULL_DEPTH_GROUPED
功能描述
该接口基于全量深度数据,按照指定的价格间隔进行分组聚合。例如,设置groupSize=100
时,会将价格按100的间隔分组:[0,100)、[100,200)、[200,300)等,并累加每个分组内的数量。
应用场景
- 价格分布分析
- 大额订单聚合查看
- 支撑阻力位分析
- 市场深度可视化
请求参数
- Name
dbKey
- Type
- string
- Description
数据库键,格式为
交易对:交易所
(如:btcswapusd:hbdm)
- Name
groupSize
- Type
- number
- Description
价格分组间隔,必须大于0(如:100.0)
- Name
AccessKeyId
- Type
- string
- Description
用户访问密钥ID
- Name
SignatureNonce
- Type
- string
- Description
签名随机数
- Name
Timestamp
- Type
- string
- Description
请求时间戳(秒),有效期30秒
- Name
Signature
- Type
- string
- Description
使用 HmacSHA1 + Base64 生成的签名,请参考如何获取 API 认证参数
groupSize参数说明
- 小间隔 (如50, 100): 适合精细分析,分组数较多
- 中间隔 (如500, 1000): 适合一般分析,平衡精度和可读性
- 大间隔 (如5000, 10000): 适合宏观分析,分组数较少
返回数据
- Name
code
- Type
- string
- Description
响应状态码,"0"表示成功
- Name
msg
- Type
- string
- Description
响应消息
- Name
data
- Type
- object
- Description
分组深度数据对象
- Name
timestamp
- Type
- integer
- Description
数据时间戳(毫秒)
- Name
action
- Type
- string
- Description
操作类型,通常为"partial"
- Name
groupSize
- Type
- number
- Description
价格分组间隔大小
- Name
bids
- Type
- array
- Description
买盘分组数据,格式 [[开始价格, 结束价格, 累计数量], ...],按价格从高到低排序
- Name
asks
- Type
- array
- Description
卖盘分组数据,格式 [[开始价格, 结束价格, 累计数量], ...],按价格从低到高排序
分组数据说明
- 价格区间: 采用半闭半开区间
[开始价格, 结束价格)
- 排序规则: 买盘按价格从高到低排序,卖盘按价格从低到高排序
- 数量累加: 同一价格区间内的所有订单数量会被累加
请求
curl -G https://open.aicoin.com/api/upgrade/v2/futures/full-depth/grouped \
-d "dbKey=btcswapusd:hbdm" \
-d "groupSize=100" \
-d "AccessKeyId=YOUR_ACCESS_KEY_ID" \
-d "SignatureNonce=RANDOM_NONCE" \
-d "Timestamp=CURRENT_TIMESTAMP" \
-d "Signature=YOUR_SIGNATURE"
响应 - 100间隔分组
{
"code": "0",
"msg": "success",
"data": {
"timestamp": 1755179093165,
"action": "partial",
"groupSize": 100.0,
"bids": [
[118300, 118400, 1250.5],
[118200, 118300, 980.2],
[118100, 118200, 756.8],
[118000, 118100, 1120.3],
[117900, 118000, 834.7]
],
"asks": [
[118400, 118500, 1180.8],
[118500, 118600, 756.3],
[118600, 118700, 934.1],
[118700, 118800, 678.9],
[118800, 118900, 1045.2]
]
}
}
响应 - 1000间隔分组
{
"code": "0",
"msg": "success",
"data": {
"timestamp": 1755179093165,
"action": "partial",
"groupSize": 1000.0,
"bids": [
[118000, 119000, 8750.2],
[117000, 118000, 6543.1],
[116000, 117000, 4321.8]
],
"asks": [
[119000, 120000, 7654.3],
[120000, 121000, 5432.1],
[121000, 122000, 3210.9]
]
}
}