财务数据 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 