Capital Flow
curl --request GET \
--url https://api.tickdb.ai/v1/market/capital-flow \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.tickdb.ai/v1/market/capital-flow"
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/capital-flow', 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/capital-flow",
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/capital-flow"
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/capital-flow")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tickdb.ai/v1/market/capital-flow")
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",
"timestamp": 1773306211,
"intraday_flow": [
{
"timestamp": 1773279000,
"inflow": "-12199.34"
},
{
"timestamp": 1773279060,
"inflow": "-15137.59"
}
],
"distribution": {
"timestamp": 1773303000,
"capital_in": {
"large": "173056.31",
"medium": "164958.55",
"small": "83945.69"
},
"capital_out": {
"large": "179434.39",
"medium": "176045.91",
"small": "92979.74"
}
}
}
}股票市场接口
资金流向
获取股票的资金流向数据,包括主力资金、大单、中单、小单的流入流出情况。
GET
/
v1
/
market
/
capital-flow
Capital Flow
curl --request GET \
--url https://api.tickdb.ai/v1/market/capital-flow \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.tickdb.ai/v1/market/capital-flow"
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/capital-flow', 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/capital-flow",
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/capital-flow"
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/capital-flow")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tickdb.ai/v1/market/capital-flow")
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",
"timestamp": 1773306211,
"intraday_flow": [
{
"timestamp": 1773279000,
"inflow": "-12199.34"
},
{
"timestamp": 1773279060,
"inflow": "-15137.59"
}
],
"distribution": {
"timestamp": 1773303000,
"capital_in": {
"large": "173056.31",
"medium": "164958.55",
"small": "83945.69"
},
"capital_out": {
"large": "179434.39",
"medium": "176045.91",
"small": "92979.74"
}
}
}
}注意事项
- 资金流向数据基于成交量和价格变化计算
- 数据更新频率取决于市场交易活跃度
支持的市场
美股、港股、A股 示例:- 美股:AAPL.US、TSLA.US、MSFT.US
- 港股:700.HK、9988.HK、3690.HK
- A股:000001.SH、000001.SZ
请求参数
| 参数名 | 是否必须 | 描述 |
|---|---|---|
| symbol | 是 | 股票代码 |
| type | 否 | 产品类型,可选。代码无歧义时无需传递;若返回 AMBIGUOUS_SYMBOL 错误,按提示传入对应值即可。可选值:stock、indices、crypto、forex |
返回字段说明
| 字段名 | 描述 |
|---|---|
| symbol | 交易产品 |
| timestamp | 数据更新时间戳 |
| intraday_flow | 资金流向数据 |
| └─ timestamp | 分钟开始时间戳 |
| └─ inflow | 净流入 |
| distribution | 资金分布 |
| └─ timestamp | 数据更新时间戳 |
| └─ capital_in | 流入资金 |
| └─ large | 大单 |
| └─ medium | 中单 |
| └─ small | 小单 |
| └─ capital_out | 流出资金 |
| └─ large | 大单 |
| └─ medium | 中单 |
| └─ small | 小单 |
授权
查询参数
Stock symbol
示例:
"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
可用选项:
stock, indices, crypto, forex 示例:
"stock"
响应
200 - application/json
Successful response
示例:
0
示例:
"success"
Show child attributes
Show child attributes
示例:
{ "symbol": "700.HK", "timestamp": 1773306211, "intraday_flow": [ { "timestamp": 1773279000, "inflow": "-12199.34" }, { "timestamp": 1773279060, "inflow": "-15137.59" } ], "distribution": { "timestamp": 1773303000, "capital_in": { "large": "173056.31", "medium": "164958.55", "small": "83945.69" }, "capital_out": { "large": "179434.39", "medium": "176045.91", "small": "92979.74" } } }
⌘I
