Market Metrics
curl --request GET \
--url https://api.tickdb.ai/v1/market/calc-index \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.tickdb.ai/v1/market/calc-index"
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/calc-index', 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/calc-index",
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/calc-index"
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/calc-index")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tickdb.ai/v1/market/calc-index")
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",
"last_done": "547.5",
"change_val": "-4.5",
"change_rate": "-0.0082",
"volume": "16521084",
"turnover": "0.0018",
"ytd_change_rate": "-0.086",
"turnover_rate": "0.18",
"total_market_value": "4985729978437.5",
"capital_flow": "-277985600",
"amplitude": "0.0281",
"volume_ratio": "0.47",
"pe_ttm_ratio": "20.89",
"pb_ratio": "3.88",
"dividend_ratio_ttm": "0.83",
"five_day_change_rate": "0.0906",
"ten_day_change_rate": "0.0693",
"half_year_change_rate": "-0.1492",
"five_minutes_change_rate": "0"
}
]
}Stock Market APIs
Market Metrics
Retrieve comprehensive market metrics for stocks, including market statistics, valuation indicators, capital flow, and derivatives-related indicators.
GET
/
v1
/
market
/
calc-index
Market Metrics
curl --request GET \
--url https://api.tickdb.ai/v1/market/calc-index \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.tickdb.ai/v1/market/calc-index"
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/calc-index', 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/calc-index",
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/calc-index"
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/calc-index")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tickdb.ai/v1/market/calc-index")
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",
"last_done": "547.5",
"change_val": "-4.5",
"change_rate": "-0.0082",
"volume": "16521084",
"turnover": "0.0018",
"ytd_change_rate": "-0.086",
"turnover_rate": "0.18",
"total_market_value": "4985729978437.5",
"capital_flow": "-277985600",
"amplitude": "0.0281",
"volume_ratio": "0.47",
"pe_ttm_ratio": "20.89",
"pb_ratio": "3.88",
"dividend_ratio_ttm": "0.83",
"five_day_change_rate": "0.0906",
"ten_day_change_rate": "0.0693",
"half_year_change_rate": "-0.1492",
"five_minutes_change_rate": "0"
}
]
}Supported Markets
US Stocks, HK Stocks, A-Shares Examples:- US Stocks: AAPL.US, TSLA.US, MSFT.US
- HK Stocks: 700.HK, 9988.HK, 3690.HK
- A-Shares: 000001.SH, 000001.SZ
Request Parameters
| Parameter | Required | Description |
|---|---|---|
| symbols | Yes | Stock symbol codes, comma-separated, max 50 |
| 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 |
Response Fields
| Field Name | Description |
|---|---|
| symbol | Trading Symbol |
| last_done | Last Price |
| change_val | Change Value |
| change_rate | Change Rate |
| volume | Volume |
| turnover | Turnover |
| ytd_change_rate | YTD Change Rate |
| turnover_rate | Turnover Rate |
| total_market_value | Total Market Value |
| capital_flow | Capital Flow |
| amplitude | Amplitude |
| volume_ratio | Volume Ratio |
| pe_ttm_ratio | P/E Ratio (TTM) |
| pb_ratio | P/B Ratio |
| dividend_ratio_ttm | Dividend Yield (TTM) |
| five_day_change_rate | 5-Day Change Rate |
| ten_day_change_rate | 10-Day Change Rate |
| half_year_change_rate | Half-Year Change Rate |
| five_minutes_change_rate | 5-Minute Change Rate |
Notes
- Metrics data is calculated based on real-time quotes and historical data
Authorizations
Query Parameters
Comma-separated stock symbols (max 50)
Example:
"700.HK,AAPL.US"
Symbol type, optional. Not required when the symbol is unambiguous; if the API returns an AMBIGUOUS_SYMBOL error, pass the value as indicated
Available options:
stock, indices, crypto, forex Example:
"stock"
Response
200 - application/json
Successful response
Example:
0
Example:
"success"
Show child attributes
Show child attributes
Example:
[
{
"symbol": "700.HK",
"last_done": "547.5",
"change_val": "-4.5",
"change_rate": "-0.0082",
"volume": "16521084",
"turnover": "0.0018",
"ytd_change_rate": "-0.086",
"turnover_rate": "0.18",
"total_market_value": "4985729978437.5",
"capital_flow": "-277985600",
"amplitude": "0.0281",
"volume_ratio": "0.47",
"pe_ttm_ratio": "20.89",
"pb_ratio": "3.88",
"dividend_ratio_ttm": "0.83",
"five_day_change_rate": "0.0906",
"ten_day_change_rate": "0.0693",
"half_year_change_rate": "-0.1492",
"five_minutes_change_rate": "0"
}
]
⌘I
