参数名称 | 类型 | 必填 | 说明 |
search | string | 否 | 按资产 ID(bitcoin)或 symbol (BTC)搜索 |
ids | string | 否 | 查询多个 id=bitcoin,ethereum,monero |
limit | int | 否 | 最大限制 2000 |
offset | int | 否 | 起始值 |
参数名称 | 类型 | 说明 | |
id | int | 资产的唯一标识符 | |
rank | int | 排名按升序排列 - 这个数字与市值直接相关,而最高市值获得排名 1 | |
symbol | string | 用于在交易所识别此资产的最常见标识符 | |
name | string | 资产的专有名称 | |
supply | decimal | 可供交易的资产量 | |
maxSupply | decimal | 发行资产总量 | |
marketCapUsd | decimal | 资产总量价格(美元) | |
volumeUsd24Hr | decimal | 过去 24 小时内以美元表示的交易量 | |
priceUsd | decimal | 基于实时市场数据的成交量加权价格,换算成美元 | |
changePercent24Hr | decimal | 过去 24 小时内的方向和价值变化 | |
vwap24Hr | string | 过去 24 小时的成交量加权平均价格 | |
explorer | string | 资产浏览器 |
require_once("curl.func.php"); $method = "POST"; $url = "http://open.6api.net/cybermoney/assets"; $headers = NULL; $params = array( "appkey" => "yourappsecret", "search" => "bitcoin", "ids" => "bitcoin,ethereum,monero", "limit" => "3", "offset" => "1" ); $result = api_curl($method, $url, $headers, $params); if ($result) { $body = json_decode($result["body"], TRUE); $status_code = $body["status"]; if ($status_code == "200") { var_dump($body["result"]); }else var_dump($body); }else echo "发送请求失败";
/** * 主函数 * @param args */ public static void main(String args[]) { //请求地址设置 String url = "http://open.6api.net/cybermoney/assets"; //请求方法设置 String requestMethod = "POST"; //请求头部设置 Map<String, String> headers = new HashMap<String, String>(); //请求参数设置 Map<String, String> params = new HashMap<String, String>(); params.put("appkey", "yourappsecret"); params.put("search", "bitcoin"); params.put("ids", "bitcoin,ethereum,monero"); params.put("limit", "3"); params.put("offset", "1"); String result = proxyToDesURL(requestMethod, url, headers, params); if (result != null) { JSONObject jsonObject = JSONObject.parseObject(result); String status_code = jsonObject.getString("status"); if (status_code.equals("200")) { System.out.println("请求成功:" + jsonObject.getString("result")); } else { System.out.println("请求失败:" + jsonObject.getString("msg")); } } else { System.out.println("发送请求异常"); } }
#!/usr/bin/env python # -*- coding: utf-8 -*- # 测试环境: python2.7 # 安装requests依赖 => pip install requests/ easy_install requests import requests import json import sys reload(sys) sys.setdefaultencoding("utf-8") def api_send_request(method, url, params=None, headers=None): ''' 转发请求到目的主机 @param method str 请求方法 @param url str 请求地址 @param params dict 请求参数 @param headers dict 请求头 ''' method = str.upper(method) if method == "POST": return requests.post(url=url, data=params, headers=headers) elif method == "GET": return requests.get(url=url, params=params, headers=headers) else: return None method = "POST" url = "http://open.6api.net/cybermoney/assets" headers = None params = { "appkey" : "yourappsecret", "search" : "bitcoin", "ids" : "bitcoin,ethereum,monero", "limit" : "3", "offset" : "1" } result = api_send_request(method=method, url=url, params=params, headers=headers) if result: body = result.result response = json.loads(body) status_code = response["status"] if (status_code == "200"): print("请求成功:%s" % (body,)) else: print("请求失败: %s" % (body,)) else: print("发送请求失败")
{ "status": 200, "msg": "OK", "result": [ { "id": "bitcoin", "rank": "1", "symbol": "BTC", "name": "Bitcoin", "supply": "18978268.0000000000000000", "maxSupply": "21000000.0000000000000000", "marketCapUsd": "792554532964.6249811263416108", "volumeUsd24Hr": "16818865750.2392233165428456", "priceUsd": "41761.1624498413122381", "changePercent24Hr": "7.0963962410732726", "vwap24Hr": "39327.9535908918253001", "explorer": "https://blockchain.info/" }, { "id": "ethereum", "rank": "2", "symbol": "ETH", "name": "Ethereum", "supply": "119885007.9365000000000000", "maxSupply": null, "marketCapUsd": "327679211998.6911999305382537", "volumeUsd24Hr": "9701163647.7606412262067369", "priceUsd": "2733.2793118907281237", "changePercent24Hr": "6.0411451247126651", "vwap24Hr": "2611.9399074931061322", "explorer": "https://etherscan.io/" }, { "id": "tether", "rank": "3", "symbol": "USDT", "name": "Tether", "supply": "80028316059.0952900000000000", "maxSupply": null, "marketCapUsd": "80042964549.7871170159367268", "volumeUsd24Hr": "31297833515.5172399217260175", "priceUsd": "1.0001830413460282", "changePercent24Hr": "-0.1007819234970915", "vwap24Hr": "1.0003748178859497", "explorer": "https://www.omniexplorer.info/asset/31" } ] }
参数名称 | 类型 | 必填 | 说明 |
id | int | 是 | 资产编号 |
参数名称 | 类型 | 说明 | |
id | string | 资产的唯一标识符 | |
rank | int | 排名按升序排列 - 这个数字与市值直接相关,而最高市值获得排名 1 | |
symbol | string | 用于在交易所识别此资产的最常见标识符 | |
name | string | 资产的专有名称 | |
supply | decimal | 可供交易的资产量 | |
maxSupply | decimal | 发行资产总量 | |
marketCapUsd | decimal | 资产总量价格(美元) | |
volumeUsd24Hr | decimal | 过去 24 小时内以美元表示的交易量 | |
priceUsd | decimal | 基于实时市场数据的成交量加权价格,换算成美元 | |
changePercent24Hr | decimal | 过去 24 小时内的方向和价值变化 | |
vwap24Hr | decimal | 过去 24 小时的成交量加权平均价格 | |
explorer | string | 资产浏览器 |
require_once("curl.func.php"); $method = "POST"; $url = "http://open.6api.net/cybermoney/assets/{id}"; $headers = NULL; $params = array( "appkey" => "yourappsecret", "id" => "bitcoin" ); $result = api_curl($method, $url, $headers, $params); if ($result) { $body = json_decode($result["body"], TRUE); $status_code = $body["status"]; if ($status_code == "200") { var_dump($body["result"]); }else var_dump($body); }else echo "发送请求失败";
/** * 主函数 * @param args */ public static void main(String args[]) { //请求地址设置 String url = "http://open.6api.net/cybermoney/assets/{id}"; //请求方法设置 String requestMethod = "POST"; //请求头部设置 Map<String, String> headers = new HashMap<String, String>(); //请求参数设置 Map<String, String> params = new HashMap<String, String>(); params.put("appkey", "yourappsecret"); params.put("id", "bitcoin"); String result = proxyToDesURL(requestMethod, url, headers, params); if (result != null) { JSONObject jsonObject = JSONObject.parseObject(result); String status_code = jsonObject.getString("status"); if (status_code.equals("200")) { System.out.println("请求成功:" + jsonObject.getString("result")); } else { System.out.println("请求失败:" + jsonObject.getString("msg")); } } else { System.out.println("发送请求异常"); } }
#!/usr/bin/env python # -*- coding: utf-8 -*- # 测试环境: python2.7 # 安装requests依赖 => pip install requests/ easy_install requests import requests import json import sys reload(sys) sys.setdefaultencoding("utf-8") def api_send_request(method, url, params=None, headers=None): ''' 转发请求到目的主机 @param method str 请求方法 @param url str 请求地址 @param params dict 请求参数 @param headers dict 请求头 ''' method = str.upper(method) if method == "POST": return requests.post(url=url, data=params, headers=headers) elif method == "GET": return requests.get(url=url, params=params, headers=headers) else: return None method = "POST" url = "http://open.6api.net/cybermoney/assets/{id}" headers = None params = { "appkey" : "yourappsecret", "id" : "bitcoin" } result = api_send_request(method=method, url=url, params=params, headers=headers) if result: body = result.result response = json.loads(body) status_code = response["status"] if (status_code == "200"): print("请求成功:%s" % (body,)) else: print("请求失败: %s" % (body,)) else: print("发送请求失败")
{ "status": 200, "msg": "OK", "result": { "id": "bitcoin", "rank": "1", "symbol": "BTC", "name": "Bitcoin", "supply": "18978437.0000000000000000", "maxSupply": "21000000.0000000000000000", "marketCapUsd": "796483968908.1586919368366746", "volumeUsd24Hr": "17502502152.0769764034512781", "priceUsd": "41967.8379683299890258", "changePercent24Hr": "7.7937600508477179", "vwap24Hr": "40520.7981706886925014", "explorer": "https://blockchain.info/" } }
参数名称 | 类型 | 必填 | 说明 |
id | string | 是 | 资产编号 |
interval | string | 是 | m1、m5、m15、m30、h1、h2、h6、h12、d1 |
start | string | 否 | 开始时间 1528470720000 |
end | string | 否 | 结束时间 1528470820000 |
参数名称 | 类型 | 说明 | |
priceUsd | string | 基于实时市场数据的成交量加权价格,换算成美元 | |
time | string | UNIX时间戳(以毫秒为单位) |
require_once("curl.func.php"); $method = "POST"; $url = "http://open.6api.net/cybermoney/assets/{id}/history"; $headers = NULL; $params = array( "appkey" => "yourappsecret", "id" => "bitcoin", "interval" => "d1", "start" => "参数3", "end" => "参数4" ); $result = api_curl($method, $url, $headers, $params); if ($result) { $body = json_decode($result["body"], TRUE); $status_code = $body["status"]; if ($status_code == "200") { var_dump($body["result"]); }else var_dump($body); }else echo "发送请求失败";
/** * 主函数 * @param args */ public static void main(String args[]) { //请求地址设置 String url = "http://open.6api.net/cybermoney/assets/{id}/history"; //请求方法设置 String requestMethod = "POST"; //请求头部设置 Map<String, String> headers = new HashMap<String, String>(); //请求参数设置 Map<String, String> params = new HashMap<String, String>(); params.put("appkey", "yourappsecret"); params.put("id", "bitcoin"); params.put("interval", "d1"); params.put("start", "参数3"); params.put("end", "参数4"); String result = proxyToDesURL(requestMethod, url, headers, params); if (result != null) { JSONObject jsonObject = JSONObject.parseObject(result); String status_code = jsonObject.getString("status"); if (status_code.equals("200")) { System.out.println("请求成功:" + jsonObject.getString("result")); } else { System.out.println("请求失败:" + jsonObject.getString("msg")); } } else { System.out.println("发送请求异常"); } }
#!/usr/bin/env python # -*- coding: utf-8 -*- # 测试环境: python2.7 # 安装requests依赖 => pip install requests/ easy_install requests import requests import json import sys reload(sys) sys.setdefaultencoding("utf-8") def api_send_request(method, url, params=None, headers=None): ''' 转发请求到目的主机 @param method str 请求方法 @param url str 请求地址 @param params dict 请求参数 @param headers dict 请求头 ''' method = str.upper(method) if method == "POST": return requests.post(url=url, data=params, headers=headers) elif method == "GET": return requests.get(url=url, params=params, headers=headers) else: return None method = "POST" url = "http://open.6api.net/cybermoney/assets/{id}/history" headers = None params = { "appkey" : "yourappsecret", "id" : "bitcoin", "interval" : "d1", "start" : "参数3", "end" : "参数4" } result = api_send_request(method=method, url=url, params=params, headers=headers) if result: body = result.result response = json.loads(body) status_code = response["status"] if (status_code == "200"): print("请求成功:%s" % (body,)) else: print("请求失败: %s" % (body,)) else: print("发送请求失败")
{ "status": 200, "msg": "OK", "result": [ { "priceUsd": "57740.5879076736194260", "time": 1617494400000, "date": "2021-04-04T00:00:00.000Z" }, { "priceUsd": "58097.0633999067806230", "time": 1617580800000, "date": "2021-04-05T00:00:00.000Z" }, { "priceUsd": "58471.0289234004571113", "time": 1617667200000, "date": "2021-04-06T00:00:00.000Z" } ] }
参数名称 | 类型 | 必填 | 说明 |
id | string | 是 | 资产编号 |
limit | int | 否 | 最大限制 2000 |
offset | int | 否 | 起始值 |
参数名称 | 类型 | 说明 | |
exchangeId | string | 交换的唯一标识符 | |
baseId | string | 此资产的唯一标识符,基础是购买的资产 | |
quoteId | string | 此资产的唯一标识符,报价是用于购买的资产 | |
baseSymbol | string | 用于识别资产的最常见符号,基础是购买的资产 | |
quoteSymbol | string | 用于识别资产的最常见符号,报价是用于购买基础的资产 | |
volumeUsd24Hr | decimal | 过去24小时内该市场的交易量 | |
priceUsd | decimal | 一单位基础资产交易的报价资产数量 | |
volumePercent | decimal | 报价资产量的百分比 |
require_once("curl.func.php"); $method = "POST"; $url = "http://open.6api.net/cybermoney/assets/{id}/markets"; $headers = NULL; $params = array( "appkey" => "yourappsecret", "id" => "bitcoin", "limit" => "5", "offset" => "1" ); $result = api_curl($method, $url, $headers, $params); if ($result) { $body = json_decode($result["body"], TRUE); $status_code = $body["status"]; if ($status_code == "200") { var_dump($body["result"]); }else var_dump($body); }else echo "发送请求失败";
/** * 主函数 * @param args */ public static void main(String args[]) { //请求地址设置 String url = "http://open.6api.net/cybermoney/assets/{id}/markets"; //请求方法设置 String requestMethod = "POST"; //请求头部设置 Map<String, String> headers = new HashMap<String, String>(); //请求参数设置 Map<String, String> params = new HashMap<String, String>(); params.put("appkey", "yourappsecret"); params.put("id", "bitcoin"); params.put("limit", "5"); params.put("offset", "1"); String result = proxyToDesURL(requestMethod, url, headers, params); if (result != null) { JSONObject jsonObject = JSONObject.parseObject(result); String status_code = jsonObject.getString("status"); if (status_code.equals("200")) { System.out.println("请求成功:" + jsonObject.getString("result")); } else { System.out.println("请求失败:" + jsonObject.getString("msg")); } } else { System.out.println("发送请求异常"); } }
#!/usr/bin/env python # -*- coding: utf-8 -*- # 测试环境: python2.7 # 安装requests依赖 => pip install requests/ easy_install requests import requests import json import sys reload(sys) sys.setdefaultencoding("utf-8") def api_send_request(method, url, params=None, headers=None): ''' 转发请求到目的主机 @param method str 请求方法 @param url str 请求地址 @param params dict 请求参数 @param headers dict 请求头 ''' method = str.upper(method) if method == "POST": return requests.post(url=url, data=params, headers=headers) elif method == "GET": return requests.get(url=url, params=params, headers=headers) else: return None method = "POST" url = "http://open.6api.net/cybermoney/assets/{id}/markets" headers = None params = { "appkey" : "yourappsecret", "id" : "bitcoin", "limit" : "5", "offset" : "1" } result = api_send_request(method=method, url=url, params=params, headers=headers) if result: body = result.result response = json.loads(body) status_code = response["status"] if (status_code == "200"): print("请求成功:%s" % (body,)) else: print("请求失败: %s" % (body,)) else: print("发送请求失败")
{ "status": 200, "msg": "OK", "result": [ { "exchangeId": "Zaif", "baseId": "nem", "quoteId": "bitcoin", "baseSymbol": "XEM", "quoteSymbol": "BTC", "volumeUsd24Hr": null, "priceUsd": "45934.5935030906467649", "volumePercent": null }, { "exchangeId": "Crypto.com Exchange", "baseId": "bitcoin", "quoteId": "tether", "baseSymbol": "BTC", "quoteSymbol": "USDT", "volumeUsd24Hr": "1856761697.3033583400168252", "priceUsd": "46333.9802609478193182", "volumePercent": "14.9951853634203133" }, { "exchangeId": "Binance", "baseId": "bitcoin", "quoteId": "tether", "baseSymbol": "BTC", "quoteSymbol": "USDT", "volumeUsd24Hr": "1513756387.1913645943502198", "priceUsd": "46332.6366808809931912", "volumePercent": "12.2250785622961843" }, { "exchangeId": "Kucoin", "baseId": "bitcoin", "quoteId": "tether", "baseSymbol": "BTC", "quoteSymbol": "USDT", "volumeUsd24Hr": "1331449402.2018042235245527", "priceUsd": "46338.4722301264618920", "volumePercent": "10.7527695218118657" }, { "exchangeId": "HitBTC", "baseId": "bitcoin", "quoteId": "tether", "baseSymbol": "BTC", "quoteSymbol": "USDT", "volumeUsd24Hr": "691210301.9257834856193418", "priceUsd": "46318.9201321390667604", "volumePercent": "5.5822061697718419" } ] }
参数名称 | 类型 | 必填 | 说明 |
暂无参数 |
参数名称 | 类型 | 说明 | |
id | string | 资产或法定货币的唯一标识符 | |
symbol | string | 用于识别资产或法定货币的最常见符号 | |
currencySymbol | string | 用于识别资产或法定货币的货币符号 | |
rateUsd | string | 汇率转换为美元 | |
type | string | 货币类型 - 法定货币或加密货币 |
require_once("curl.func.php"); $method = "POST"; $url = "http://open.6api.net/cybermoney/rates"; $headers = NULL; $params = array( "appkey" => "yourappsecret" ); $result = api_curl($method, $url, $headers, $params); if ($result) { $body = json_decode($result["body"], TRUE); $status_code = $body["status"]; if ($status_code == "200") { var_dump($body["result"]); }else var_dump($body); }else echo "发送请求失败";
/** * 主函数 * @param args */ public static void main(String args[]) { //请求地址设置 String url = "http://open.6api.net/cybermoney/rates"; //请求方法设置 String requestMethod = "POST"; //请求头部设置 Map<String, String> headers = new HashMap<String, String>(); //请求参数设置 Map<String, String> params = new HashMap<String, String>(); params.put("appkey", "yourappsecret"); String result = proxyToDesURL(requestMethod, url, headers, params); if (result != null) { JSONObject jsonObject = JSONObject.parseObject(result); String status_code = jsonObject.getString("status"); if (status_code.equals("200")) { System.out.println("请求成功:" + jsonObject.getString("result")); } else { System.out.println("请求失败:" + jsonObject.getString("msg")); } } else { System.out.println("发送请求异常"); } }
#!/usr/bin/env python # -*- coding: utf-8 -*- # 测试环境: python2.7 # 安装requests依赖 => pip install requests/ easy_install requests import requests import json import sys reload(sys) sys.setdefaultencoding("utf-8") def api_send_request(method, url, params=None, headers=None): ''' 转发请求到目的主机 @param method str 请求方法 @param url str 请求地址 @param params dict 请求参数 @param headers dict 请求头 ''' method = str.upper(method) if method == "POST": return requests.post(url=url, data=params, headers=headers) elif method == "GET": return requests.get(url=url, params=params, headers=headers) else: return None method = "POST" url = "http://open.6api.net/cybermoney/rates" headers = None params = { "appkey" : "yourappsecret" } result = api_send_request(method=method, url=url, params=params, headers=headers) if result: body = result.result response = json.loads(body) status_code = response["status"] if (status_code == "200"): print("请求成功:%s" % (body,)) else: print("请求失败: %s" % (body,)) else: print("发送请求失败")
{ "status": 200, "msg": "OK", "result": [ { "id": "malaysian-ringgit", "symbol": "MYR", "currencySymbol": "RM", "type": "fiat", "rateUsd": "0.2375014843842774" }, { "id": "sierra-leonean-leone", "symbol": "SLL", "currencySymbol": "Le", "type": "fiat", "rateUsd": "0.0000849220827619" }, { "id": "bermudan-dollar", "symbol": "BMD", "currencySymbol": "$", "type": "fiat", "rateUsd": "1.0000000000000000" } ] }
参数名称 | 类型 | 必填 | 说明 |
id | string | 是 | 资产编号 |
参数名称 | 类型 | 说明 | |
id | string | 资产或法定货币的唯一标识符 | |
symbol | string | 用于识别资产或法定货币的最常见符号 | |
currencySymbol | string | 用于识别资产或法定货币的货币符号 | |
rateUsd | string | 汇率转换为美元 | |
type | string | 货币类型 - 法定货币或加密货币 |
require_once("curl.func.php"); $method = "POST"; $url = "http://open.6api.net/cybermoney/rates/{id}"; $headers = NULL; $params = array( "appkey" => "yourappsecret", "id" => "bitcoin" ); $result = api_curl($method, $url, $headers, $params); if ($result) { $body = json_decode($result["body"], TRUE); $status_code = $body["status"]; if ($status_code == "200") { var_dump($body["result"]); }else var_dump($body); }else echo "发送请求失败";
/** * 主函数 * @param args */ public static void main(String args[]) { //请求地址设置 String url = "http://open.6api.net/cybermoney/rates/{id}"; //请求方法设置 String requestMethod = "POST"; //请求头部设置 Map<String, String> headers = new HashMap<String, String>(); //请求参数设置 Map<String, String> params = new HashMap<String, String>(); params.put("appkey", "yourappsecret"); params.put("id", "bitcoin"); String result = proxyToDesURL(requestMethod, url, headers, params); if (result != null) { JSONObject jsonObject = JSONObject.parseObject(result); String status_code = jsonObject.getString("status"); if (status_code.equals("200")) { System.out.println("请求成功:" + jsonObject.getString("result")); } else { System.out.println("请求失败:" + jsonObject.getString("msg")); } } else { System.out.println("发送请求异常"); } }
#!/usr/bin/env python # -*- coding: utf-8 -*- # 测试环境: python2.7 # 安装requests依赖 => pip install requests/ easy_install requests import requests import json import sys reload(sys) sys.setdefaultencoding("utf-8") def api_send_request(method, url, params=None, headers=None): ''' 转发请求到目的主机 @param method str 请求方法 @param url str 请求地址 @param params dict 请求参数 @param headers dict 请求头 ''' method = str.upper(method) if method == "POST": return requests.post(url=url, data=params, headers=headers) elif method == "GET": return requests.get(url=url, params=params, headers=headers) else: return None method = "POST" url = "http://open.6api.net/cybermoney/rates/{id}" headers = None params = { "appkey" : "yourappsecret", "id" : "bitcoin" } result = api_send_request(method=method, url=url, params=params, headers=headers) if result: body = result.result response = json.loads(body) status_code = response["status"] if (status_code == "200"): print("请求成功:%s" % (body,)) else: print("请求失败: %s" % (body,)) else: print("发送请求失败")
{ "status": 200, "msg": "OK", "result": { "id": "bitcoin", "symbol": "BTC", "currencySymbol": "₿", "type": "crypto", "rateUsd": "46305.2899838795218064" } }
参数名称 | 类型 | 必填 | 说明 |
暂无参数 |
参数名称 | 类型 | 说明 | |
id | string | 交换的唯一标识符 | |
name | string | 交易所的专有名称 | |
rank | string | 排名按升序排列 - 此数字与总交易量直接相关,而交易量最高的交易所获得排名 1 | |
percentTotalVolume | string | 单个交易所的每日交易量相对于所有交易所的每日总交易量 | |
volumeUsd | string | 以美元表示的每日交易量 | |
tradingPairs | string | 交易所提供的交易对(或市场)数量 | |
socket | string | true/false, true = 交易接口可用,false = 交易接口不可用 | |
exchangeUrl | string | 交换网站 | |
updated | string | 自本次交换收到信息以来的 UNIX 时间戳(毫秒) |
require_once("curl.func.php"); $method = "POST"; $url = "http://open.6api.net/cybermoney/exchanges"; $headers = NULL; $params = array( "appkey" => "yourappsecret" ); $result = api_curl($method, $url, $headers, $params); if ($result) { $body = json_decode($result["body"], TRUE); $status_code = $body["status"]; if ($status_code == "200") { var_dump($body["result"]); }else var_dump($body); }else echo "发送请求失败";
/** * 主函数 * @param args */ public static void main(String args[]) { //请求地址设置 String url = "http://open.6api.net/cybermoney/exchanges"; //请求方法设置 String requestMethod = "POST"; //请求头部设置 Map<String, String> headers = new HashMap<String, String>(); //请求参数设置 Map<String, String> params = new HashMap<String, String>(); params.put("appkey", "yourappsecret"); String result = proxyToDesURL(requestMethod, url, headers, params); if (result != null) { JSONObject jsonObject = JSONObject.parseObject(result); String status_code = jsonObject.getString("status"); if (status_code.equals("200")) { System.out.println("请求成功:" + jsonObject.getString("result")); } else { System.out.println("请求失败:" + jsonObject.getString("msg")); } } else { System.out.println("发送请求异常"); } }
#!/usr/bin/env python # -*- coding: utf-8 -*- # 测试环境: python2.7 # 安装requests依赖 => pip install requests/ easy_install requests import requests import json import sys reload(sys) sys.setdefaultencoding("utf-8") def api_send_request(method, url, params=None, headers=None): ''' 转发请求到目的主机 @param method str 请求方法 @param url str 请求地址 @param params dict 请求参数 @param headers dict 请求头 ''' method = str.upper(method) if method == "POST": return requests.post(url=url, data=params, headers=headers) elif method == "GET": return requests.get(url=url, params=params, headers=headers) else: return None method = "POST" url = "http://open.6api.net/cybermoney/exchanges" headers = None params = { "appkey" : "yourappsecret" } result = api_send_request(method=method, url=url, params=params, headers=headers) if result: body = result.result response = json.loads(body) status_code = response["status"] if (status_code == "200"): print("请求成功:%s" % (body,)) else: print("请求失败: %s" % (body,)) else: print("发送请求失败")
{ "status": 200, "msg": "OK", "result": [ { "exchangeId": "binance", "name": "Binance", "rank": "1", "percentTotalVolume": "32.330201366172712942000000000000000000", "volumeUsd": "14778220963.8606767868305750", "tradingPairs": "932", "socket": true, "exchangeUrl": "https://www.binance.com/", "updated": 1648985975785 }, { "exchangeId": "hitbtc", "name": "HitBTC", "rank": "2", "percentTotalVolume": "10.102564189064871887000000000000000000", "volumeUsd": "4617908938.9711614619931330", "tradingPairs": "933", "socket": true, "exchangeUrl": "https://hitbtc.com/", "updated": 1648985964171 }, { "exchangeId": "crypto", "name": "Crypto.com Exchange", "rank": "3", "percentTotalVolume": "7.084312834588380970000000000000000000", "volumeUsd": "3238258223.6621253224814192", "tradingPairs": "195", "socket": false, "exchangeUrl": "https://api.crypto.com/", "updated": 1648985926851 } ] }
参数名称 | 类型 | 必填 | 说明 |
id | string | 是 | 交易所编号 |
参数名称 | 类型 | 说明 | |
id | string | 交换的唯一标识符 | |
name | string | 交易所的专有名称 | |
rank | string | 排名按升序排列 - 此数字与总交易量直接相关,而交易量最高的交易所获得排名 1 | |
percentTotalVolume | string | 单个交易所的每日交易量相对于所有交易所的每日总交易量 | |
volumeUsd | string | 以美元表示的每日交易量 | |
tradingPairs | string | 交易所提供的交易对(或市场)数量 | |
socket | string | true/false, true = 交易接口可用,false = 交易接口不可用 | |
exchangeUrl | string | 交换网站 | |
updated | string | 自本次交换收到信息以来的 UNIX 时间戳(毫秒) |
require_once("curl.func.php"); $method = "POST"; $url = "http://open.6api.net/cybermoney/exchanges/{id}"; $headers = NULL; $params = array( "appkey" => "yourappsecret", "id" => "kraken" ); $result = api_curl($method, $url, $headers, $params); if ($result) { $body = json_decode($result["body"], TRUE); $status_code = $body["status"]; if ($status_code == "200") { var_dump($body["result"]); }else var_dump($body); }else echo "发送请求失败";
/** * 主函数 * @param args */ public static void main(String args[]) { //请求地址设置 String url = "http://open.6api.net/cybermoney/exchanges/{id}"; //请求方法设置 String requestMethod = "POST"; //请求头部设置 Map<String, String> headers = new HashMap<String, String>(); //请求参数设置 Map<String, String> params = new HashMap<String, String>(); params.put("appkey", "yourappsecret"); params.put("id", "kraken"); String result = proxyToDesURL(requestMethod, url, headers, params); if (result != null) { JSONObject jsonObject = JSONObject.parseObject(result); String status_code = jsonObject.getString("status"); if (status_code.equals("200")) { System.out.println("请求成功:" + jsonObject.getString("result")); } else { System.out.println("请求失败:" + jsonObject.getString("msg")); } } else { System.out.println("发送请求异常"); } }
#!/usr/bin/env python # -*- coding: utf-8 -*- # 测试环境: python2.7 # 安装requests依赖 => pip install requests/ easy_install requests import requests import json import sys reload(sys) sys.setdefaultencoding("utf-8") def api_send_request(method, url, params=None, headers=None): ''' 转发请求到目的主机 @param method str 请求方法 @param url str 请求地址 @param params dict 请求参数 @param headers dict 请求头 ''' method = str.upper(method) if method == "POST": return requests.post(url=url, data=params, headers=headers) elif method == "GET": return requests.get(url=url, params=params, headers=headers) else: return None method = "POST" url = "http://open.6api.net/cybermoney/exchanges/{id}" headers = None params = { "appkey" : "yourappsecret", "id" : "kraken" } result = api_send_request(method=method, url=url, params=params, headers=headers) if result: body = result.result response = json.loads(body) status_code = response["status"] if (status_code == "200"): print("请求成功:%s" % (body,)) else: print("请求失败: %s" % (body,)) else: print("发送请求失败")
{ "status": 200, "msg": "OK", "result": { "exchangeId": "kraken", "name": "Kraken", "rank": "17", "percentTotalVolume": "1.065297502557493459000000000000000000", "volumeUsd": "486978026.8489009107130360", "tradingPairs": "375", "socket": false, "exchangeUrl": "https://kraken.com", "updated": 1648986221331 } }
参数名称 | 类型 | 必填 | 说明 |
exchangeId | string | 否 | 交换ID |
baseSymbol | string | 否 | 返回所有包含基本符号的 |
quoteSymbol | string | 否 | 计量货币 |
baseId | string | 否 | 此资产的唯一标识符 |
quoteId | string | 否 | 返回所有包含报价 ID |
assetSymbol | string | 否 | 返回包含符号(基础和报价)的所有资产 |
assetId | string | 否 | 返回所有包含 id 的资产(base 和 quote) |
limit | string | 否 | 最大限制 2000 |
offset | string | 否 | 起始值 |
参数名称 | 类型 | 说明 | |
exchangeId | string | 交换的唯一标识符 | |
rank | int | 排名按升序排列 - 此数字代表该市场相对于该交易所其他市场的交易量 | |
baseSymbol | string | 用于识别资产的最常见符号 | |
baseId | string | 此资产的唯一标识符 | |
quoteSymbol | string | 用于识别资产的最常见符号 | |
quoteId | string | 此资产的唯一标识符 | |
priceQuote | string | 一单位基础资产交易的报价资产数量 | |
priceUsd | string | 报价转换为美元 | |
volumeUsd24Hr | string | 过去 24 小时内该市场的交易量 | |
percentExchangeVolume | string | 单个市场的每日交易量相对于交易所所有市场的每日总交易量 | |
tradesCount24Hr | string | 过去 24 小时内该市场的交易数量 | |
updated | string | 自从该特定市场收到信息以来的 UNIX 时间戳(毫秒) |
require_once("curl.func.php"); $method = "POST"; $url = "http://open.6api.net/cybermoney/markets"; $headers = NULL; $params = array( "appkey" => "yourappsecret", "exchangeId" => "poloniex", "baseSymbol" => "BTC", "quoteSymbol" => "ETH", "baseId" => "bitcoin", "quoteId" => "ethereum", "assetSymbol" => "BTC", "assetId" => "bitcoin", "limit" => "5", "offset" => "1" ); $result = api_curl($method, $url, $headers, $params); if ($result) { $body = json_decode($result["body"], TRUE); $status_code = $body["status"]; if ($status_code == "200") { var_dump($body["result"]); }else var_dump($body); }else echo "发送请求失败";
/** * 主函数 * @param args */ public static void main(String args[]) { //请求地址设置 String url = "http://open.6api.net/cybermoney/markets"; //请求方法设置 String requestMethod = "POST"; //请求头部设置 Map<String, String> headers = new HashMap<String, String>(); //请求参数设置 Map<String, String> params = new HashMap<String, String>(); params.put("appkey", "yourappsecret"); params.put("exchangeId", "poloniex"); params.put("baseSymbol", "BTC"); params.put("quoteSymbol", "ETH"); params.put("baseId", "bitcoin"); params.put("quoteId", "ethereum"); params.put("assetSymbol", "BTC"); params.put("assetId", "bitcoin"); params.put("limit", "5"); params.put("offset", "1"); String result = proxyToDesURL(requestMethod, url, headers, params); if (result != null) { JSONObject jsonObject = JSONObject.parseObject(result); String status_code = jsonObject.getString("status"); if (status_code.equals("200")) { System.out.println("请求成功:" + jsonObject.getString("result")); } else { System.out.println("请求失败:" + jsonObject.getString("msg")); } } else { System.out.println("
#!/usr/bin/env python # -*- coding: utf-8 -*- # 测试环境: python2.7 # 安装requests依赖 => pip install requests/ easy_install requests import requests import json import sys reload(sys) sys.setdefaultencoding("utf-8") def api_send_request(method, url, params=None, headers=None): ''' 转发请求到目的主机 @param method str 请求方法 @param url str 请求地址 @param params dict 请求参数 @param headers dict 请求头 ''' method = str.upper(method) if method == "POST": return requests.post(url=url, data=params, headers=headers) elif method == "GET": return requests.get(url=url, params=params, headers=headers) else: return None method = "POST" url = "http://open.6api.net/cybermoney/markets" headers = None params = { "appkey" : "yourappsecret", "exchangeId" : "poloniex", "baseSymbol" : "BTC", "quoteSymbol" : "ETH", "baseId" : "bitcoin", "quoteId" : "ethereum", "assetSymbol" : "BTC", "assetId" : "bitcoin", "limit" : "5", "offset" : "1" } result = api_send_request(method=method, url=url, params=params, headers=headers) if result: body = result.result response = json.loads(body) status_code = response["status"] if (status_code == "200"):
{ "status": 200, "msg": "OK", "result": [ { "exchangeId": "bitstamp", "rank": "1", "baseSymbol": "BTC", "baseId": "bitcoin", "quoteSymbol": "USD", "quoteId": "united-states-dollar", "priceQuote": "46283.3300000000000000", "priceUsd": "46283.3300000000000000", "volumeUsd24Hr": "29392681.7053357090000000", "percentExchangeVolume": "29.5159040796895084", "tradesCount24Hr": null, "updated": 1648987015251 } ] }
参数名称 | 类型 | 必填 | 说明 |
exchange | string | 是 | 交换编号 |
interval | string | 是 | 时间间隔 m1, m5, m15, m30, h1, h2, h4, h8, h12, d1, w1 |
baseId | string | 是 | 基本编号 |
quoteId | string | 是 | 报价编号 |
start | string | 否 | UNIX 时间,以毫秒为单位。省略将返回最近的数据 |
end | string | 否 | 结束时间 |
参数名称 | 类型 | 说明 | |
open | string | 在给定时间段内完成第一笔交易的价格(报价) | |
high | string | 在该时间段内交易基础的最高价格(报价) | |
low | string | 基准在该时间段内交易的最低价(报价) | |
close | string | 在给定时间段内完成最后一笔交易的价格(报价) | |
volume | string | 在给定时间段内交易的基础资产数量 | |
period | string | 该时间段开始的时间戳,以 UNIX 毫秒表示 |
require_once("curl.func.php"); $method = "POST"; $url = "http://open.6api.net/cybermoney/candles"; $headers = NULL; $params = array( "appkey" => "yourappsecret", "exchange" => "poloniex", "interval" => "m1", "baseId" => "ethereum", "quoteId" => "bitcoin", "start" => "参数5", "end" => "参数6" ); $result = api_curl($method, $url, $headers, $params); if ($result) { $body = json_decode($result["body"], TRUE); $status_code = $body["status"]; if ($status_code == "200") { var_dump($body["result"]); }else var_dump($body); }else echo "发送请求失败";
/** * 主函数 * @param args */ public static void main(String args[]) { //请求地址设置 String url = "http://open.6api.net/cybermoney/candles"; //请求方法设置 String requestMethod = "POST"; //请求头部设置 Map<String, String> headers = new HashMap<String, String>(); //请求参数设置 Map<String, String> params = new HashMap<String, String>(); params.put("appkey", "yourappsecret"); params.put("exchange", "poloniex"); params.put("interval", "m1"); params.put("baseId", "ethereum"); params.put("quoteId", "bitcoin"); params.put("start", "参数5"); params.put("end", "参数6"); String result = proxyToDesURL(requestMethod, url, headers, params); if (result != null) { JSONObject jsonObject = JSONObject.parseObject(result); String status_code = jsonObject.getString("status"); if (status_code.equals("200")) { System.out.println("请求成功:" + jsonObject.getString("result")); } else { System.out.println("请求失败:" + jsonObject.getString("msg")); } } else { System.out.println("发送请求异常"); } }
#!/usr/bin/env python # -*- coding: utf-8 -*- # 测试环境: python2.7 # 安装requests依赖 => pip install requests/ easy_install requests import requests import json import sys reload(sys) sys.setdefaultencoding("utf-8") def api_send_request(method, url, params=None, headers=None): ''' 转发请求到目的主机 @param method str 请求方法 @param url str 请求地址 @param params dict 请求参数 @param headers dict 请求头 ''' method = str.upper(method) if method == "POST": return requests.post(url=url, data=params, headers=headers) elif method == "GET": return requests.get(url=url, params=params, headers=headers) else: return None method = "POST" url = "http://open.6api.net/cybermoney/candles" headers = None params = { "appkey" : "yourappsecret", "exchange" : "poloniex", "interval" : "m1", "baseId" : "ethereum", "quoteId" : "bitcoin", "start" : "参数5", "end" : "参数6" } result = api_send_request(method=method, url=url, params=params, headers=headers) if result: body = result.result response = json.loads(body) status_code = response["status"] if (status_code == "200"): print("请求成功:%s" % (body,)) else: print("请求失败: %s" % (body,)) else: print("发送请求失败"
状态码 | 描述 |
107 | 返回失败,请检查参数是否正确 |
状态码 | 描述 |
101 | APPKEY为空或不存在 |
102 | APPKEY已过期 |
103 | APPKEY无请求此数据权限 |
104 | 请求超过次数限制 |
105 | IP被禁 |
106 | IP请求超过限制 |
107 | 接口维护中 |
108 | 接口已停用 |
计次套餐 | 权限 | 原价 | 优惠价 | 单价 |
测试套餐 | 100次 | 免费 | / | ≈0.00000元/次 |
level1 | 30000次 | 450.00 | / | ≈0.01500元/次 |
level2 | 120000次 | 1500.00 | / | ≈0.01250元/次 |
level3 | 300000次 | 3000.00 | / | ≈0.01000元/次 |
更多优惠,请咨询 010-8639-9970 周一至周五(9:30-18:30) |
包月套餐 | 权限 | 原价 | 优惠价 | 单价 |
M-Level1 | 10000次/天 | 2500.00 | / | ≈0.00833元/次 |
* 套餐使用时限为订购之日起30日。 |
包年套餐 | 权限 | 原价 | 优惠价 | 单价 |
Y-Level1 | 10/QPS | 12800.00 | / | 不限次 |
* 套餐使用时限为订购之日起1年。 |
用户 | 购买时间 | 周期 | 套餐 |
153****1252 | 2024-12-05 19:00:50 | 一年 | ¥450.00 / 30000次 |
175****8021 | 2024-09-01 13:13:10 | 一年 | ¥450.00 / 30000次 |
182****8802 | 2024-06-21 03:30:50 | 一年 | ¥2500.00 / 10000次 |
182****8802 | 2024-06-01 19:10:53 | 一年 | ¥1500.00 / 120000次 |
176****2049 | 2024-05-25 19:41:33 | 一年 | ¥450.00 / 30000次 |
182****8802 | 2024-03-09 20:39:27 | 一年 | ¥0.00 / 100次 |
182****8802 | 2024-03-09 20:39:27 | 一年 | ¥450.00 / 30000次 |
188****9413 | 2023-08-09 09:40:16 | 一年 | ¥450.00 / 30000次 |
151****1418 | 2023-04-08 15:48:27 | 一年 | ¥450.00 / 30000次 |
151****1418 | 2023-01-19 17:17:56 | 一年 | ¥450.00 / 30000次 |