市場狀態
curl --request GET \
--url https://api.tickdb.ai/v1/fundamentals/market/status \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.tickdb.ai/v1/fundamentals/market/status"
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/fundamentals/market/status', 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/fundamentals/market/status",
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/fundamentals/market/status"
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/fundamentals/market/status")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tickdb.ai/v1/fundamentals/market/status")
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,
"data": {
"markets": [
{
"market": "US",
"market_time": "2023-11-07T05:31:56Z",
"trade_status": 123
}
]
}
}市場資訊
市場狀態
查詢不同市場當前的交易階段和市場時間。
GET
/
v1
/
fundamentals
/
market
/
status
市場狀態
curl --request GET \
--url https://api.tickdb.ai/v1/fundamentals/market/status \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.tickdb.ai/v1/fundamentals/market/status"
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/fundamentals/market/status', 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/fundamentals/market/status",
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/fundamentals/market/status"
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/fundamentals/market/status")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tickdb.ai/v1/fundamentals/market/status")
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,
"data": {
"markets": [
{
"market": "US",
"market_time": "2023-11-07T05:31:56Z",
"trade_status": 123
}
]
}
}套餐權限
| 套餐 | 可用 |
|---|---|
| 免費版 | ❌ |
| 基礎版 | ✅ |
| 專業版 | ✅ |
| 全量套餐(A 股、港股、美股) | ✅ |
| 企業版 | ✅ |
注意事項
- 這是全局接口,不接受
market或symbol參數;狀態隨交易時段變化。
支持的市場
| 市場 | 示例 |
|---|---|
| 美股 | US |
| 港股 | HK |
| A股 | CN |
請求參數
該接口不需要查詢參數。請求示例
curl -H "X-API-Key: YOUR_API_KEY" \
"https://api.tickdb.ai/v1/fundamentals/market/status"
返回字段說明
以下列出data 中的字段;外層 code=0 表示成功。
| 字段 | 說明 |
|---|---|
| markets | 各市場交易狀態列表。 |
| └─ market | 市場代碼。 |
| └─ market_time | 該市場的當前時間,RFC 3339 日期時間字符串,包含時區信息。 |
| └─ trade_status | 交易狀態代碼。 |
CN、HK、US 三個市場的市場時間和交易狀態。
trade_status 狀態碼
不同市場只會返回適用的狀態。常見及特殊交易階段的代碼如下:
| 市場 | 狀態碼 | 含義 |
|---|---|---|
| CN、HK | 101 | 開市前清算 |
| CN、HK | 102 | 開盤集合競價 |
| CN、HK | 105 | 正常交易 |
| CN、HK | 106 | 午間休市 |
| CN、HK | 107 | 收盤集合競價 |
| CN、HK | 108 | 已收市 |
| CN | 120 | 盤後固定價格交易 |
| CN、HK | 121 | 半日市收市 |
| CN、HK | 122 | 特殊情況下尚未開市 |
| CN、HK | 123 | 盤中臨時休市 |
| US | 201 | 盤前交易 |
| US | 202 | 正常交易 |
| US | 203 | 盤後交易 |
| US | 204 | 已收市 |
| US | 205 | 暫停交易 |
| US | 206 | 開市前清算及盤前時段 |
| US | 207 | 夜盤交易 |
| US | 209 | 盤前清算 |
| US | 210 | 盤後清算 |
