盘口深度
curl --request GET \
--url https://api.tickdb.ai/v1/market/depth \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.tickdb.ai/v1/market/depth"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.tickdb.ai/v1/market/depth', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tickdb.ai/v1/market/depth",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.tickdb.ai/v1/market/depth"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.tickdb.ai/v1/market/depth")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tickdb.ai/v1/market/depth")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"code": 0,
"message": "success",
"data": {
"symbol": "700.HK",
"type": "stock",
"timestamp": 1768274016162,
"bids": [
[
"626",
"19700"
],
[
"625.5",
"40800"
]
],
"asks": [
[
"626.5",
"36100"
],
[
"627",
"50700"
]
]
}
}通用行情接口
盘口深度
获取交易品种的实时买卖盘口数据。
GET
/
v1
/
market
/
depth
盘口深度
curl --request GET \
--url https://api.tickdb.ai/v1/market/depth \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.tickdb.ai/v1/market/depth"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.tickdb.ai/v1/market/depth', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tickdb.ai/v1/market/depth",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.tickdb.ai/v1/market/depth"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.tickdb.ai/v1/market/depth")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tickdb.ai/v1/market/depth")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"code": 0,
"message": "success",
"data": {
"symbol": "700.HK",
"type": "stock",
"timestamp": 1768274016162,
"bids": [
[
"626",
"19700"
],
[
"625.5",
"40800"
]
],
"asks": [
[
"626.5",
"36100"
],
[
"627",
"50700"
]
]
}
}套餐权限
| 套餐 | 可用 |
|---|---|
| 免费版 | ❌ |
| 基础版 | ✅ |
| 专业版 | ✅ |
| 全量套餐(A 股、港股、美股) | ✅ |
| 企业版 | ✅ |
注意事项
- 买盘(bids)按价格降序排列
- 卖盘(asks)按价格升序排列
- 返回档位数量由相应市场实际支持的深度决定
- 时间戳单位为毫秒(UTC)
支持的市场
| 市场 | 示例 | 每侧盘口档位 |
|---|---|---|
| 美股 | AAPL.US、TSLA.US、MSFT.US | 1档 |
| 港股 | 700.HK、9988.HK、3690.HK | 10档 |
| A股 | 600519.SH、000001.SZ、920186.BJ | 5档 |
| 中国期货 | BU2609、RB8888、AP8888 | 1档 |
| 香港期货 | HSI8888、MHI8888、HTI8888 | 10档 |
| 加密货币 | BTCUSDT、ETHUSDT、ADAUSDT、OKBUSDT | 最高1000档 |
请求参数
| 参数名 | 是否必须 | 描述 |
|---|---|---|
| symbol | 是 | 交易产品代码 |
| type | 否 | 产品类型,可选。代码无歧义时无需传递;若返回 AMBIGUOUS_SYMBOL 错误,按提示传入对应值即可。可选值:stock、indices、crypto、forex、futures |
返回字段说明
| 字段 | 说明 |
|---|---|
| symbol | 交易产品 |
| type | 产品类型 |
| timestamp | 数据时间戳(毫秒,UTC) |
| bids | 买盘数组,每个元素为 [价格, 数量] |
| asks | 卖盘数组,每个元素为 [价格, 数量] |
授权
查询参数
交易产品代码
示例:
"700.HK"
产品类型,可选。代码无歧义时无需传递;若返回 AMBIGUOUS_SYMBOL 错误,按提示传入对应值即可。可选值:stock、indices、crypto、forex、futures
可用选项:
stock, indices, crypto, forex, futures 示例:
"stock"
