歷史營收構成
curl --request GET \
--url https://api.tickdb.ai/v1/fundamentals/segments/history \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.tickdb.ai/v1/fundamentals/segments/history"
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/segments/history', 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/segments/history",
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/segments/history"
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/segments/history")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tickdb.ai/v1/fundamentals/segments/history")
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>",
"segments": [
{
"report": "<string>",
"category": "<string>",
"segment_name": "<string>",
"period_start": "2023-12-25",
"period_end": "2023-12-25",
"value": "<string>",
"total_revenue": "<string>",
"currency": "<string>",
"percent": "<string>"
}
],
"report": "<string>"
}
}公司概況
歷史營收構成
展示歷史報告期按業務或地區劃分的收入金額和占比。
GET
/
v1
/
fundamentals
/
segments
/
history
歷史營收構成
curl --request GET \
--url https://api.tickdb.ai/v1/fundamentals/segments/history \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.tickdb.ai/v1/fundamentals/segments/history"
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/segments/history', 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/segments/history",
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/segments/history"
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/segments/history")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tickdb.ai/v1/fundamentals/segments/history")
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>",
"segments": [
{
"report": "<string>",
"category": "<string>",
"segment_name": "<string>",
"period_start": "2023-12-25",
"period_end": "2023-12-25",
"value": "<string>",
"total_revenue": "<string>",
"currency": "<string>",
"percent": "<string>"
}
],
"report": "<string>"
}
}套餐權限
| 套餐 | 可用 |
|---|---|
| 免費版 | ❌ |
| 基礎版 | ❌ |
| 專業版 | ✅ |
| 全量套餐(A 股、港股、美股) | ✅ |
| 企業版 | ✅ |
注意事項
- 可查詢的歷史報告期因公司而異;沒有匹配數據時可能返回結構化
404。
支持的市場
| 市場 | 示例 |
|---|---|
| 美股 | AAPL.US |
| 港股 | 700.HK |
| A股 | 600519.SH |
請求參數
| 參數 | 是否必須 | 說明 |
|---|---|---|
symbol | 是 | 股票代碼 |
type | 否 | 產品類型,當前支持 stock |
category | 否 | 營收構成維度:business 按業務;regional 按地區。不傳返回全部可用維度。 |
report | 否 | 報告周期:qf 季度報告、saf 半年度報告、af 年度報告 |
limit | 否 | 返回條數,默認 200,范圍 1–1000 |
請求示例
curl -H "X-API-Key: YOUR_API_KEY" \
"https://api.tickdb.ai/v1/fundamentals/segments/history?symbol=AAPL&type=stock&category=business&limit=200"
返回字段說明
以下列出data 中的字段;外層 code=0 表示成功。
| 字段 | 說明 |
|---|---|
| symbol | 股票代碼。 |
| report | 請求指定的報告周期;qf 季度報告、saf 半年度報告、af 年度報告,未指定時可為 null。 |
| segments | 歷史報告期的營收構成明細。 |
| └─ segment_name | 業務類別或地區名稱。 |
| └─ category | 該記錄所屬維度:business 按業務,regional 按地區。 |
| └─ value | 該業務類別或地區的收入金額。 |
| └─ total_revenue | 該報告期總收入。 |
| └─ percent | 該業務類別或地區收入占當期總收入的百分比,例如 79.74 表示 79.74%。 |
| └─ currency | 金額幣種。 |
| └─ report | 該記錄的報告周期:qf 季度報告、saf 半年度報告、af 年度報告。 |
| └─ period_start | 周期開始日期,格式 YYYY-MM-DD。 |
| └─ period_end | 周期結束日期,格式 YYYY-MM-DD。 |
404。授權
查詢參數
股票代碼
範例:
"AAPL"
"700"
"600519"
"AAPL.US"
"700.HK"
"600519.SH"
產品類型,當前支援 stock
可用選項:
stock 營收構成維度:business 按業務;regional 按地區。不傳返回全部可用維度。
可用選項:
business, regional 報告周期:qf 季度報告、saf 半年度報告、af 年度報告
範例:
"qf"
"saf"
"af"
返回條數,默認 200,范圍 1–1000
必填範圍:
1 <= x <= 1000