简介:WhaleEx 鲸交所是知名去中心化交易所,主要基于 EOS。WhaleEx 提供了 API 服务以便分析师投资人查询信息。本篇文章整理如何使用 WhaleEx 公共数据 API 获取交易订单簿。
WhaleEx 鲸交所是知名去中心化交易所,主要基于 EOS。WhaleEx 提供了 API 服务以便分析师投资人查询数字货币行情和交易信息。
本篇文章整理如何使用 WhaleEx 公共数据 API 获取交易订单簿。
WhaleEx 鲸交所 API 官方文档:https://github.com/WhaleEx/API
本查询不需要使用密钥签名。
WhaleEx API 可能需要使用科学的上网方式才可访问。
WhaleEx 鲸交所 API 获取交易订单簿:
请求参数:
symbol
: string,交易对名称,例如 iqeos.
语句示例:
https://api.whaleex.com/BUSINESS/api/public/v1/orderBook/iqeos
Node.js 示例:
const fetch = require('node-fetch');
fetch('https://api.whaleex.com/BUSINESS/api/public/v1/orderBook/iqeos', {
method: 'get',
}).then(response => response.json()
.then(data => console.log(data)));
返回的 JSON 示例:
{
"lastUpdateId": "62097979359233",
"timestamp": 1558581314846,
"lastPrice": "",
"asks": [{
"price": "0.00059900",
"quantity": "240512.609"
}, {
"price": "0.00060000",
"quantity": "6885.906"
}, {
"price": "0.00060700",
"quantity": "41950.500"
}, {
"price": "0.00061100",
"quantity": "4500.000"
}, {
"price": "0.00061199",
"quantity": "2507.877"
}, {
"price": "0.00061200",
"quantity": "5501.882"
}, {
"price": "0.00065000",
"quantity": "10000.000"
}, {
"price": "0.00066000",
"quantity": "13000.000"
}, {
"price": "0.00067000",
"quantity": "10000.000"
}, {
"price": "0.00069000",
"quantity": "37000.000"
}],
"bids": [{
"price": "0.00059000",
"quantity": "30000.000"
}, {
"price": "0.00058000",
"quantity": "60000.000"
}, {
"price": "0.00057000",
"quantity": "100000.000"
}, {
"price": "0.00056800",
"quantity": "9742.361"
}, {
"price": "0.00056700",
"quantity": "18455.380"
}, {
"price": "0.00056600",
"quantity": "17839.930"
}, {
"price": "0.00056500",
"quantity": "42046.000"
}, {
"price": "0.00056100",
"quantity": "100000.000"
}, {
"price": "0.00056000",
"quantity": "31687.930"
}, {
"price": "0.00054300",
"quantity": "25360.000"
}]
}
我们有一个区块链知识星球,做区块链前沿资料的归纳整理以方便大家检索查询使用,也是国内顶尖区块链技术社区,欢迎感兴趣的朋友加入。如果你对上面内容有疑问,也可以加入知识星球提问我:
区块链社群 知识星球
网友评论