財務數據 TTM
curl --request GET \
--url https://api.tickdb.ai/v1/fundamentals/financials/ttm \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.tickdb.ai/v1/fundamentals/financials/ttm"
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/financials/ttm', 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/financials/ttm",
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/financials/ttm"
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/financials/ttm")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tickdb.ai/v1/fundamentals/financials/ttm")
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": {
"symbol": "<string>",
"kind": "IS",
"rows": [
{
"kind": "IS",
"field_name": "<string>",
"indicator_title": "<string>",
"value": "<string>",
"fiscal_year": 123,
"fiscal_period": "<string>",
"period_type": "<string>",
"period_end": "2023-12-25",
"field_display": "<string>",
"currency": "<string>",
"is_percent": true,
"yoy": "<string>",
"ratio": "<string>"
}
]
}
}
財務報表
財務數據 TTM
查詢最近四個有效單季匯總的近12個月利潤表或現金流量表指標。
GET
/
v1
/
fundamentals
/
financials
/
ttm
財務數據 TTM
curl --request GET \
--url https://api.tickdb.ai/v1/fundamentals/financials/ttm \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.tickdb.ai/v1/fundamentals/financials/ttm"
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/financials/ttm', 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/financials/ttm",
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/financials/ttm"
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/financials/ttm")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tickdb.ai/v1/fundamentals/financials/ttm")
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": {
"symbol": "<string>",
"kind": "IS",
"rows": [
{
"kind": "IS",
"field_name": "<string>",
"indicator_title": "<string>",
"value": "<string>",
"fiscal_year": 123,
"fiscal_period": "<string>",
"period_type": "<string>",
"period_end": "2023-12-25",
"field_display": "<string>",
"currency": "<string>",
"is_percent": true,
"yoy": "<string>",
"ratio": "<string>"
}
]
}
}
套餐權限
| 套餐 | 可用 |
|---|---|
| 免費版 | ❌ |
| 基礎版 | ✅ |
| 專業版 | ✅ |
| 全量套餐(A 股、港股、美股) | ✅ |
| 企業版 | ✅ |
注意事項
- TTM 指滾動近12個月,由最近四個有效單季數據匯總;僅支持利潤表
IS和現金流量表CF。
支持的市場
| 市場 | 示例 |
|---|---|
| 美股 | AAPL.US |
| 港股 | 700.HK |
| A股 | 600519.SH |
請求參數
| 參數 | 是否必須 | 說明 |
|---|---|---|
symbol | 是 | 股票代碼 |
type | 否 | 產品類型,當前支持 stock |
kind | 是 | 報表類型:IS 利潤表或 CF 現金流量表 |
TTM 僅對利潤表
IS 和現金流量表 CF 定義,傳入資產負債表 BS 會返回參數錯誤。請求示例
curl -H "X-API-Key: YOUR_API_KEY" \
"https://api.tickdb.ai/v1/fundamentals/financials/ttm?symbol=AAPL&type=stock&kind=IS"
返回字段說明
以下列出data 中的字段;外層 code=0 表示成功。
| 字段 | 說明 |
|---|---|
| symbol | 股票代碼。 |
| kind | 報表類型:IS 利潤表或 CF 現金流量表。 |
| rows | 滾動近12個月的財務指標記錄。 |
| └─ kind | 該記錄所屬報表類型:IS 利潤表或 CF 現金流量表。 |
| └─ field_name | 財務字段代碼;查看財務字段字典。 |
| └─ field_display | 展示名稱。 |
| └─ indicator_title | 指標標題。 |
| └─ value | 對應指標的近12個月匯總值,以字符串返回。 |
| └─ currency | 幣種。 |
| └─ is_percent | 是否為百分比字段。 |
| └─ fiscal_year | 對應財年。 |
| └─ fiscal_period | 對應報告期。 |
| └─ period_type | ttm,表示滾動近12個月的匯總數據。 |
| └─ period_end | 期末日期,格式 YYYY-MM-DD。 |
| └─ yoy | 同比變化;可能為 null。 |
| └─ ratio | 比率;可能為 null。 |
授權
查詢參數
股票代碼
範例:
"AAPL"
"700"
"600519"
"AAPL.US"
"700.HK"
"600519.SH"
產品類型,當前支援 stock
可用選項:
stock 報表類型:IS 利潤表或 CF 現金流量表
可用選項:
IS, CF 