Order Book
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"
]
]
}
}Market Data APIs
Order Book
Retrieve real-time order book depth (bids & asks) for a trading symbol.
GET
/
v1
/
market
/
depth
Order Book
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"
]
]
}
}Plan Access
| Plan | Available |
|---|---|
| Free | ❌ |
| Starter | ✅ |
| Professional | ✅ |
| Full-Market Plans (A-Shares, HK Stocks, US Stocks) | ✅ |
| Enterprise | ✅ |
Notes
- bids sorted by price descending
- asks sorted by price ascending
- The number of returned levels is determined by the depth supported by each market
- timestamp in milliseconds (UTC)
Supported Markets
| Market | Examples | Levels per side |
|---|---|---|
| US Stocks | AAPL.US, TSLA.US, MSFT.US | 1 |
| HK Stocks | 700.HK, 9988.HK, 3690.HK | 10 |
| A-Shares | 600519.SH, 000001.SZ, 920186.BJ | 5 |
| China Futures | BU2609, RB8888, AP8888 | 1 |
| Hong Kong Futures | HSI8888, MHI8888, HTI8888 | 10 |
| Crypto | BTCUSDT, ETHUSDT, ADAUSDT, OKBUSDT | Up to 1,000 |
Request Parameters
| Parameter | Required | Description |
|---|---|---|
| symbol | Yes | Trading symbol code |
| type | No | Symbol type, optional. Not required when the symbol is unambiguous; if the API returns an AMBIGUOUS_SYMBOL error, pass the value as indicated. Values: stock, indices, crypto, forex, futures |
Response Fields
| Field | Description |
|---|---|
| symbol | Trading Symbol |
| type | Product type |
| timestamp | Data timestamp (milliseconds, UTC) |
| bids | Bid array, each element is [price, quantity] |
| asks | Ask array, each element is [price, quantity] |
Authorizations
Query Parameters
Trading symbol code
Example:
"700.HK"
Symbol type, optional. Not required when the symbol is unambiguous; if the API returns an AMBIGUOUS_SYMBOL error, pass the value as indicated. Values: stock, indices, crypto, forex, futures
Available options:
stock, indices, crypto, forex, futures Example:
"stock"
