From afcf0315172fc612cb7db19dadd27ca3e2f51cd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=A2=81=E7=AB=A0=E6=B4=AA?= Date: Fri, 15 May 2026 19:42:04 +0800 Subject: [PATCH 1/8] docs(fundamental): add business-segments, institution-rating-views, industry-rank, industry-peers, financial-report-snapshot MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ported from longbridge-terminal PR #202. Documents 6 new SDK methods across zh-CN, zh-HK, and en: - business_segments — GET /v1/quote/fundamentals/business-segments - business_segments_history — GET /v1/quote/fundamentals/business-segments/history - institution_rating_views — GET /v1/quote/ratings/institutional - industry_rank — GET /v1/quote/industry/rank - industry_peers — GET /v1/quote/industries/peers - financial_report_snapshot — GET /v1/quote/financials/earnings-snapshot Co-Authored-By: Claude Sonnet 4.6 (1M context) --- .../fundamental/business_segments.md | 232 ++++++++++++++++ .../fundamental/business_segments_history.md | 245 ++++++++++++++++ .../fundamental/financial_report_snapshot.md | 261 ++++++++++++++++++ .../fundamental/fundamental/industry_peers.md | 245 ++++++++++++++++ .../fundamental/fundamental/industry_rank.md | 245 ++++++++++++++++ .../fundamental/institution_rating_views.md | 244 ++++++++++++++++ .../fundamental/business_segments.md | 232 ++++++++++++++++ .../fundamental/business_segments_history.md | 245 ++++++++++++++++ .../fundamental/financial_report_snapshot.md | 261 ++++++++++++++++++ .../fundamental/fundamental/industry_peers.md | 245 ++++++++++++++++ .../fundamental/fundamental/industry_rank.md | 245 ++++++++++++++++ .../fundamental/institution_rating_views.md | 244 ++++++++++++++++ .../fundamental/business_segments.md | 232 ++++++++++++++++ .../fundamental/business_segments_history.md | 245 ++++++++++++++++ .../fundamental/financial_report_snapshot.md | 261 ++++++++++++++++++ .../fundamental/fundamental/industry_peers.md | 245 ++++++++++++++++ .../fundamental/fundamental/industry_rank.md | 245 ++++++++++++++++ .../fundamental/institution_rating_views.md | 244 ++++++++++++++++ 18 files changed, 4416 insertions(+) create mode 100644 docs/en/docs/fundamental/fundamental/business_segments.md create mode 100644 docs/en/docs/fundamental/fundamental/business_segments_history.md create mode 100644 docs/en/docs/fundamental/fundamental/financial_report_snapshot.md create mode 100644 docs/en/docs/fundamental/fundamental/industry_peers.md create mode 100644 docs/en/docs/fundamental/fundamental/industry_rank.md create mode 100644 docs/en/docs/fundamental/fundamental/institution_rating_views.md create mode 100644 docs/zh-CN/docs/fundamental/fundamental/business_segments.md create mode 100644 docs/zh-CN/docs/fundamental/fundamental/business_segments_history.md create mode 100644 docs/zh-CN/docs/fundamental/fundamental/financial_report_snapshot.md create mode 100644 docs/zh-CN/docs/fundamental/fundamental/industry_peers.md create mode 100644 docs/zh-CN/docs/fundamental/fundamental/industry_rank.md create mode 100644 docs/zh-CN/docs/fundamental/fundamental/institution_rating_views.md create mode 100644 docs/zh-HK/docs/fundamental/fundamental/business_segments.md create mode 100644 docs/zh-HK/docs/fundamental/fundamental/business_segments_history.md create mode 100644 docs/zh-HK/docs/fundamental/fundamental/financial_report_snapshot.md create mode 100644 docs/zh-HK/docs/fundamental/fundamental/industry_peers.md create mode 100644 docs/zh-HK/docs/fundamental/fundamental/industry_rank.md create mode 100644 docs/zh-HK/docs/fundamental/fundamental/institution_rating_views.md diff --git a/docs/en/docs/fundamental/fundamental/business_segments.md b/docs/en/docs/fundamental/fundamental/business_segments.md new file mode 100644 index 00000000..35dc24d1 --- /dev/null +++ b/docs/en/docs/fundamental/fundamental/business_segments.md @@ -0,0 +1,232 @@ +--- +slug: business-segments +title: Business Segments +sidebar_position: 21 +language_tabs: false +toc_footers: [] +includes: [] +search: true +highlight_theme: '' +headingLevel: 2 +--- + +Get the current-period revenue segment breakdown for a listed company. + + +longbridge business-segments AAPL.US +longbridge business-segments 700.HK + + + + + +## Parameters + +> **SDK method parameters.** + +| Name | Type | Required | Description | +| ---- | ---- | -------- | ----------- | +| symbol | string | YES | Security symbol, e.g. `AAPL.US` | + +## Request Example + + + + +```python +from longbridge.openapi import FundamentalContext, Config, OAuthBuilder + +oauth = OAuthBuilder("your-client-id").build(lambda url: print("Visit:", url)) +config = Config.from_oauth(oauth) +ctx = FundamentalContext(config) + +resp = ctx.business_segments("AAPL.US") +print(resp) +``` + + + + +```python +import asyncio +from longbridge.openapi import AsyncFundamentalContext, Config, OAuthBuilder + +async def main() -> None: + oauth = await OAuthBuilder("your-client-id").build_async(lambda url: print("Visit:", url)) + config = Config.from_oauth(oauth) + ctx = AsyncFundamentalContext.create(config) + + resp = await ctx.business_segments("AAPL.US") + print(resp) + +if __name__ == "__main__": + asyncio.run(main()) +``` + + + + +```javascript +const { Config, FundamentalContext, OAuth } = require('longbridge') + +async function main() { + const oauth = await OAuth.build('your-client-id', (_, url) => { + console.log('Open this URL to authorize: ' + url) + }) + const config = Config.fromOAuth(oauth) + const ctx = FundamentalContext.new(config) + const resp = await ctx.businessSegments('AAPL.US') + console.log(resp) +} +main().catch(console.error) +``` + + + + +```java +import com.longbridge.*; +import com.longbridge.fundamental.*; + +class Main { + public static void main(String[] args) throws Exception { + try (OAuth oauth = new OAuthBuilder("your-client-id").build(url -> System.out.println("Open to authorize: " + url)).get(); + Config config = Config.fromOAuth(oauth); + FundamentalContext ctx = FundamentalContext.create(config)) { + var resp = ctx.getBusinessSegments("AAPL.US").get(); + System.out.println(resp); + } + } +} +``` + + + + +```rust +use std::sync::Arc; +use longbridge::{oauth::OAuthBuilder, fundamental::FundamentalContext, Config}; + +#[tokio::main] +async fn main() -> Result<(), Box> { + let oauth = OAuthBuilder::new("your-client-id").build(|url| println!("Open: {url}")).await?; + let config = Arc::new(Config::from_oauth(oauth)); + let ctx = FundamentalContext::new(config); + let resp = ctx.business_segments("AAPL.US").await?; + println!("{:?}", resp); + Ok(()) +} +``` + + + + +```cpp +#include +#include + +using namespace longbridge; +using namespace longbridge::fundamental; + +int main() { + OAuthBuilder("your-client-id").build( + [](const std::string& url) { std::cout << "Open: " << url << std::endl; }, + [](auto res) { + if (!res) return; + Config config = Config::from_oauth(*res); + FundamentalContext ctx = FundamentalContext::create(config); + ctx.business_segments("AAPL.US", [](auto resp) { + if (resp) std::cout << "OK" << std::endl; + }); + }); + std::cin.get(); +} +``` + + + + +```go +package main + +import ( + "context" + "fmt" + "log" + + "github.com/longbridge/openapi-go/config" + "github.com/longbridge/openapi-go/oauth" + "github.com/longbridge/openapi-go/fundamental" +) + +func main() { + o := oauth.New("your-client-id"). + OnOpenURL(func(url string) { fmt.Println("Open this URL to authorize:", url) }) + if err := o.Build(context.Background()); err != nil { + log.Fatal(err) + } + conf, err := config.New(config.WithOAuthClient(o)) + if err != nil { + log.Fatal(err) + } + c, err := fundamental.NewFromCfg(conf) + if err != nil { + log.Fatal(err) + } + defer c.Close() + resp, err := c.BusinessSegments(context.Background(), "AAPL.US") + if err != nil { + log.Fatal(err) + } + fmt.Printf("%+v\n", resp) +} +``` + + + + +## Response + + +### Response Example + +```json +{ + "code": 0, + "message": "success", + "data": { + "date": "2024Q4", + "total": "124300000000", + "currency": "USD", + "business": [ + {"name": "iPhone", "percent": "0.5619"}, + {"name": "Services", "percent": "0.2196"}, + {"name": "Mac", "percent": "0.0804"}, + {"name": "iPad", "percent": "0.0700"}, + {"name": "Wearables", "percent": "0.0681"} + ] + } +} +``` + +### Response Status + +| Status | Description | Schema | +| ------ | ----------- | ------ | +| 200 | Success | [BusinessSegmentsResponse](#BusinessSegmentsResponse) | +| 400 | Bad request | None | + +## Schemas + +### BusinessSegmentsResponse + + + +| Name | Type | Required | Description | +| ---- | ---- | -------- | ----------- | +| date | string | false | Reporting period label, e.g. `2024Q4` | +| total | string | false | Total revenue for the period (string value) | +| currency | string | false | Currency code, e.g. `USD` | +| business | array | false | Business segment list | +| business[].name | string | false | Segment name | +| business[].percent | string | false | Revenue share (0–1 decimal) | diff --git a/docs/en/docs/fundamental/fundamental/business_segments_history.md b/docs/en/docs/fundamental/fundamental/business_segments_history.md new file mode 100644 index 00000000..d41a89db --- /dev/null +++ b/docs/en/docs/fundamental/fundamental/business_segments_history.md @@ -0,0 +1,245 @@ +--- +slug: business-segments-history +title: Business Segments History +sidebar_position: 22 +language_tabs: false +toc_footers: [] +includes: [] +search: true +highlight_theme: '' +headingLevel: 2 +--- + +Get historical business segment revenue trends across reporting periods. + + +longbridge business-segments AAPL.US --history +longbridge business-segments AAPL.US --history --report qf + + + + + +## Parameters + +> **SDK method parameters.** + +| Name | Type | Required | Description | +| ---- | ---- | -------- | ----------- | +| symbol | string | YES | Security symbol, e.g. `AAPL.US` | +| report | string | NO | Report type: `qf` (quarterly) / `saf` (semi-annual) / `af` (annual) | +| cate | string | NO | Segment category filter | + +## Request Example + + + + +```python +from longbridge.openapi import FundamentalContext, Config, OAuthBuilder + +oauth = OAuthBuilder("your-client-id").build(lambda url: print("Visit:", url)) +config = Config.from_oauth(oauth) +ctx = FundamentalContext(config) + +resp = ctx.business_segments_history("AAPL.US", report="qf") +print(resp) +``` + + + + +```python +import asyncio +from longbridge.openapi import AsyncFundamentalContext, Config, OAuthBuilder + +async def main() -> None: + oauth = await OAuthBuilder("your-client-id").build_async(lambda url: print("Visit:", url)) + config = Config.from_oauth(oauth) + ctx = AsyncFundamentalContext.create(config) + + resp = await ctx.business_segments_history("AAPL.US", report="qf") + print(resp) + +if __name__ == "__main__": + asyncio.run(main()) +``` + + + + +```javascript +const { Config, FundamentalContext, OAuth } = require('longbridge') + +async function main() { + const oauth = await OAuth.build('your-client-id', (_, url) => { + console.log('Open this URL to authorize: ' + url) + }) + const config = Config.fromOAuth(oauth) + const ctx = FundamentalContext.new(config) + const resp = await ctx.businessSegmentsHistory('AAPL.US', { report: 'qf' }) + console.log(resp) +} +main().catch(console.error) +``` + + + + +```java +import com.longbridge.*; +import com.longbridge.fundamental.*; + +class Main { + public static void main(String[] args) throws Exception { + try (OAuth oauth = new OAuthBuilder("your-client-id").build(url -> System.out.println("Open to authorize: " + url)).get(); + Config config = Config.fromOAuth(oauth); + FundamentalContext ctx = FundamentalContext.create(config)) { + var resp = ctx.getBusinessSegmentsHistory("AAPL.US", "qf", null).get(); + System.out.println(resp); + } + } +} +``` + + + + +```rust +use std::sync::Arc; +use longbridge::{oauth::OAuthBuilder, fundamental::FundamentalContext, Config}; + +#[tokio::main] +async fn main() -> Result<(), Box> { + let oauth = OAuthBuilder::new("your-client-id").build(|url| println!("Open: {url}")).await?; + let config = Arc::new(Config::from_oauth(oauth)); + let ctx = FundamentalContext::new(config); + let resp = ctx.business_segments_history("AAPL.US", Some("qf"), None).await?; + println!("{:?}", resp); + Ok(()) +} +``` + + + + +```cpp +#include +#include + +using namespace longbridge; +using namespace longbridge::fundamental; + +int main() { + OAuthBuilder("your-client-id").build( + [](const std::string& url) { std::cout << "Open: " << url << std::endl; }, + [](auto res) { + if (!res) return; + Config config = Config::from_oauth(*res); + FundamentalContext ctx = FundamentalContext::create(config); + ctx.business_segments_history("AAPL.US", "qf", "", [](auto resp) { + if (resp) std::cout << "OK" << std::endl; + }); + }); + std::cin.get(); +} +``` + + + + +```go +package main + +import ( + "context" + "fmt" + "log" + + "github.com/longbridge/openapi-go/config" + "github.com/longbridge/openapi-go/oauth" + "github.com/longbridge/openapi-go/fundamental" +) + +func main() { + o := oauth.New("your-client-id"). + OnOpenURL(func(url string) { fmt.Println("Open this URL to authorize:", url) }) + if err := o.Build(context.Background()); err != nil { + log.Fatal(err) + } + conf, err := config.New(config.WithOAuthClient(o)) + if err != nil { + log.Fatal(err) + } + c, err := fundamental.NewFromCfg(conf) + if err != nil { + log.Fatal(err) + } + defer c.Close() + resp, err := c.BusinessSegmentsHistory(context.Background(), "AAPL.US", "qf", "") + if err != nil { + log.Fatal(err) + } + fmt.Printf("%+v\n", resp) +} +``` + + + + +## Response + + +### Response Example + +```json +{ + "code": 0, + "message": "success", + "data": { + "historical": [ + { + "date": "2024Q4", + "total": "124300000000", + "currency": "USD", + "business": [ + {"name": "iPhone", "percent": "0.5619", "value": "69900000000"}, + {"name": "Services", "percent": "0.2196", "value": "26300000000"} + ], + "regionals": [ + {"name": "Americas", "percent": "0.4280", "value": "53200000000"}, + {"name": "Europe", "percent": "0.2520", "value": "30100000000"} + ] + } + ] + } +} +``` + +### Response Status + +| Status | Description | Schema | +| ------ | ----------- | ------ | +| 200 | Success | [BusinessSegmentsHistoryResponse](#BusinessSegmentsHistoryResponse) | +| 400 | Bad request | None | + +## Schemas + +### BusinessSegmentsHistoryResponse + + + +| Name | Type | Required | Description | +| ---- | ---- | -------- | ----------- | +| historical | array | false | List of historical reporting periods | +| historical[].date | string | false | Reporting period label, e.g. `2024Q4` | +| historical[].total | string | false | Total revenue for the period (string value) | +| historical[].currency | string | false | Currency code | +| historical[].business | array | false | Business segment list | +| historical[].business[].name | string | false | Segment name | +| historical[].business[].percent | string | false | Revenue share (0–1 decimal) | +| historical[].business[].value | string | false | Absolute revenue value | +| historical[].regionals | array | false | Regional segment list | +| historical[].regionals[].name | string | false | Region name | +| historical[].regionals[].percent | string | false | Revenue share (0–1 decimal) | +| historical[].regionals[].value | string | false | Absolute revenue value | diff --git a/docs/en/docs/fundamental/fundamental/financial_report_snapshot.md b/docs/en/docs/fundamental/fundamental/financial_report_snapshot.md new file mode 100644 index 00000000..55532e88 --- /dev/null +++ b/docs/en/docs/fundamental/fundamental/financial_report_snapshot.md @@ -0,0 +1,261 @@ +--- +slug: financial-report-snapshot +title: Financial Report Snapshot +sidebar_position: 26 +language_tabs: false +toc_footers: [] +includes: [] +search: true +highlight_theme: '' +headingLevel: 2 +--- + +Get an AI-generated earnings summary, revenue/EBIT/EPS forecast vs actual (beat/miss analysis), and key financial ratios. + + +longbridge financial-report snapshot AAPL.US +longbridge financial-report snapshot AAPL.US --report qf --year 2024 --period 4 + + + + + +## Parameters + +> **SDK method parameters.** + +| Name | Type | Required | Description | +| ---- | ---- | -------- | ----------- | +| symbol | string | YES | Security symbol, e.g. `AAPL.US` | +| report | string | NO | Report type: `qf` (quarterly) / `saf` (semi-annual) / `af` (annual) | +| fiscal_year | uint32 | NO | Fiscal year, e.g. `2024` | +| fiscal_period | string | NO | Fiscal period, e.g. `1` / `2` / `3` / `4` | + +## Request Example + + + + +```python +from longbridge.openapi import FundamentalContext, Config, OAuthBuilder + +oauth = OAuthBuilder("your-client-id").build(lambda url: print("Visit:", url)) +config = Config.from_oauth(oauth) +ctx = FundamentalContext(config) + +resp = ctx.financial_report_snapshot("AAPL.US", report="qf", fiscal_year=2024, fiscal_period="4") +print(resp) +``` + + + + +```python +import asyncio +from longbridge.openapi import AsyncFundamentalContext, Config, OAuthBuilder + +async def main() -> None: + oauth = await OAuthBuilder("your-client-id").build_async(lambda url: print("Visit:", url)) + config = Config.from_oauth(oauth) + ctx = AsyncFundamentalContext.create(config) + + resp = await ctx.financial_report_snapshot("AAPL.US", report="qf", fiscal_year=2024, fiscal_period="4") + print(resp) + +if __name__ == "__main__": + asyncio.run(main()) +``` + + + + +```javascript +const { Config, FundamentalContext, OAuth } = require('longbridge') + +async function main() { + const oauth = await OAuth.build('your-client-id', (_, url) => { + console.log('Open this URL to authorize: ' + url) + }) + const config = Config.fromOAuth(oauth) + const ctx = FundamentalContext.new(config) + const resp = await ctx.financialReportSnapshot('AAPL.US', { report: 'qf', fiscalYear: 2024, fiscalPeriod: '4' }) + console.log(resp) +} +main().catch(console.error) +``` + + + + +```java +import com.longbridge.*; +import com.longbridge.fundamental.*; + +class Main { + public static void main(String[] args) throws Exception { + try (OAuth oauth = new OAuthBuilder("your-client-id").build(url -> System.out.println("Open to authorize: " + url)).get(); + Config config = Config.fromOAuth(oauth); + FundamentalContext ctx = FundamentalContext.create(config)) { + var resp = ctx.getFinancialReportSnapshot("AAPL.US", "qf", 2024, "4").get(); + System.out.println(resp); + } + } +} +``` + + + + +```rust +use std::sync::Arc; +use longbridge::{oauth::OAuthBuilder, fundamental::FundamentalContext, Config}; + +#[tokio::main] +async fn main() -> Result<(), Box> { + let oauth = OAuthBuilder::new("your-client-id").build(|url| println!("Open: {url}")).await?; + let config = Arc::new(Config::from_oauth(oauth)); + let ctx = FundamentalContext::new(config); + let resp = ctx.financial_report_snapshot("AAPL.US", Some("qf"), Some(2024), Some("4")).await?; + println!("{:?}", resp); + Ok(()) +} +``` + + + + +```cpp +#include +#include + +using namespace longbridge; +using namespace longbridge::fundamental; + +int main() { + OAuthBuilder("your-client-id").build( + [](const std::string& url) { std::cout << "Open: " << url << std::endl; }, + [](auto res) { + if (!res) return; + Config config = Config::from_oauth(*res); + FundamentalContext ctx = FundamentalContext::create(config); + ctx.financial_report_snapshot("AAPL.US", "qf", 2024, "4", [](auto resp) { + if (resp) std::cout << "OK" << std::endl; + }); + }); + std::cin.get(); +} +``` + + + + +```go +package main + +import ( + "context" + "fmt" + "log" + + "github.com/longbridge/openapi-go/config" + "github.com/longbridge/openapi-go/oauth" + "github.com/longbridge/openapi-go/fundamental" +) + +func main() { + o := oauth.New("your-client-id"). + OnOpenURL(func(url string) { fmt.Println("Open this URL to authorize:", url) }) + if err := o.Build(context.Background()); err != nil { + log.Fatal(err) + } + conf, err := config.New(config.WithOAuthClient(o)) + if err != nil { + log.Fatal(err) + } + c, err := fundamental.NewFromCfg(conf) + if err != nil { + log.Fatal(err) + } + defer c.Close() + resp, err := c.FinancialReportSnapshot(context.Background(), "AAPL.US", "qf", 2024, "4") + if err != nil { + log.Fatal(err) + } + fmt.Printf("%+v\n", resp) +} +``` + + + + +## Response + + +### Response Example + +```json +{ + "code": 0, + "message": "success", + "data": { + "name": "Apple Inc.", + "ticker": "AAPL.US", + "fp_start": "2024-10-01", + "fp_end": "2024-12-31", + "currency": "USD", + "report_desc": "Apple delivered record revenue of $124.3B in Q1 FY2025...", + "fo_revenue": {"value": "124300000000", "yoy": "0.0407", "cmp_desc": "beat by 1.2%", "est_value": "123800000000"}, + "fo_ebit": {"value": "42800000000", "yoy": "0.0520", "cmp_desc": "beat by 0.8%", "est_value": "42500000000"}, + "fo_eps": {"value": "2.40", "yoy": "0.0870", "cmp_desc": "beat by 2.1%", "est_value": "2.35"}, + "fr_revenue": {"value": "124300000000", "yoy": "0.0407"}, + "fr_profit": {"value": "36330000000", "yoy": "0.0710"}, + "fr_roe_ttm": "0.1570", + "fr_profit_margin": "0.2923", + "fr_debt_assets_ratio": "0.8120" + } +} +``` + +### Response Status + +| Status | Description | Schema | +| ------ | ----------- | ------ | +| 200 | Success | [FinancialReportSnapshotResponse](#FinancialReportSnapshotResponse) | +| 400 | Bad request | None | + +## Schemas + +### FinancialReportSnapshotResponse + + + +| Name | Type | Required | Description | +| ---- | ---- | -------- | ----------- | +| name | string | false | Company name | +| ticker | string | false | Security ticker | +| fp_start | string | false | Fiscal period start date | +| fp_end | string | false | Fiscal period end date | +| currency | string | false | Currency code | +| report_desc | string | false | AI-generated earnings summary text | +| fo_revenue | object | false | Revenue forecast comparison | +| fo_revenue.value | string | false | Actual revenue | +| fo_revenue.yoy | string | false | Year-over-year growth rate (decimal) | +| fo_revenue.cmp_desc | string | false | Beat/miss description | +| fo_revenue.est_value | string | false | Consensus estimate value | +| fo_ebit | object | false | EBIT forecast comparison (same fields as fo_revenue) | +| fo_eps | object | false | EPS forecast comparison (same fields as fo_revenue) | +| fr_revenue | object | false | Revenue financial data | +| fr_revenue.value | string | false | Revenue value | +| fr_revenue.yoy | string | false | Year-over-year growth rate | +| fr_profit | object | false | Net profit financial data (same fields as fr_revenue) | +| fr_operate_cash | object | false | Operating cash flow (same fields as fr_revenue) | +| fr_invest_cash | object | false | Investing cash flow (same fields as fr_revenue) | +| fr_finance_cash | object | false | Financing cash flow (same fields as fr_revenue) | +| fr_total_assets | object | false | Total assets (same fields as fr_revenue) | +| fr_total_liability | object | false | Total liabilities (same fields as fr_revenue) | +| fr_roe_ttm | string | false | Return on equity TTM (decimal) | +| fr_profit_margin | string | false | Net profit margin (decimal) | +| fr_profit_margin_ttm | string | false | Net profit margin TTM (decimal) | +| fr_asset_turn_ttm | string | false | Asset turnover rate TTM (decimal) | +| fr_leverage_ttm | string | false | Leverage ratio TTM (decimal) | +| fr_debt_assets_ratio | string | false | Debt-to-assets ratio (decimal) | diff --git a/docs/en/docs/fundamental/fundamental/industry_peers.md b/docs/en/docs/fundamental/fundamental/industry_peers.md new file mode 100644 index 00000000..14c8ff3d --- /dev/null +++ b/docs/en/docs/fundamental/fundamental/industry_peers.md @@ -0,0 +1,245 @@ +--- +slug: industry-peers +title: Industry Peer Hierarchy +sidebar_position: 25 +language_tabs: false +toc_footers: [] +includes: [] +search: true +highlight_theme: '' +headingLevel: 2 +--- + +Get the hierarchical sub-sector tree for an industry group, including stock count, daily change, and YTD change at each node. Counter IDs come from `industry_rank`. + + +longbridge industry-peers BK/US/IN00258 +longbridge industry-peers BK/HK/IN20337 + + + + + +## Parameters + +> **SDK method parameters.** + +| Name | Type | Required | Description | +| ---- | ---- | -------- | ----------- | +| counter_id | string | YES | Industry unique identifier (BK/MARKET/ID format) from `industry_rank` | +| market | string | YES | Market code: `US` / `HK` / `CN` / `SG` | + +## Request Example + + + + +```python +from longbridge.openapi import FundamentalContext, Config, OAuthBuilder + +oauth = OAuthBuilder("your-client-id").build(lambda url: print("Visit:", url)) +config = Config.from_oauth(oauth) +ctx = FundamentalContext(config) + +resp = ctx.industry_peers("BK/US/IN00258", "US") +print(resp) +``` + + + + +```python +import asyncio +from longbridge.openapi import AsyncFundamentalContext, Config, OAuthBuilder + +async def main() -> None: + oauth = await OAuthBuilder("your-client-id").build_async(lambda url: print("Visit:", url)) + config = Config.from_oauth(oauth) + ctx = AsyncFundamentalContext.create(config) + + resp = await ctx.industry_peers("BK/US/IN00258", "US") + print(resp) + +if __name__ == "__main__": + asyncio.run(main()) +``` + + + + +```javascript +const { Config, FundamentalContext, OAuth } = require('longbridge') + +async function main() { + const oauth = await OAuth.build('your-client-id', (_, url) => { + console.log('Open this URL to authorize: ' + url) + }) + const config = Config.fromOAuth(oauth) + const ctx = FundamentalContext.new(config) + const resp = await ctx.industryPeers('BK/US/IN00258', 'US') + console.log(resp) +} +main().catch(console.error) +``` + + + + +```java +import com.longbridge.*; +import com.longbridge.fundamental.*; + +class Main { + public static void main(String[] args) throws Exception { + try (OAuth oauth = new OAuthBuilder("your-client-id").build(url -> System.out.println("Open to authorize: " + url)).get(); + Config config = Config.fromOAuth(oauth); + FundamentalContext ctx = FundamentalContext.create(config)) { + var resp = ctx.getIndustryPeers("BK/US/IN00258", "US").get(); + System.out.println(resp); + } + } +} +``` + + + + +```rust +use std::sync::Arc; +use longbridge::{oauth::OAuthBuilder, fundamental::FundamentalContext, Config}; + +#[tokio::main] +async fn main() -> Result<(), Box> { + let oauth = OAuthBuilder::new("your-client-id").build(|url| println!("Open: {url}")).await?; + let config = Arc::new(Config::from_oauth(oauth)); + let ctx = FundamentalContext::new(config); + let resp = ctx.industry_peers("BK/US/IN00258", "US").await?; + println!("{:?}", resp); + Ok(()) +} +``` + + + + +```cpp +#include +#include + +using namespace longbridge; +using namespace longbridge::fundamental; + +int main() { + OAuthBuilder("your-client-id").build( + [](const std::string& url) { std::cout << "Open: " << url << std::endl; }, + [](auto res) { + if (!res) return; + Config config = Config::from_oauth(*res); + FundamentalContext ctx = FundamentalContext::create(config); + ctx.industry_peers("BK/US/IN00258", "US", [](auto resp) { + if (resp) std::cout << "OK" << std::endl; + }); + }); + std::cin.get(); +} +``` + + + + +```go +package main + +import ( + "context" + "fmt" + "log" + + "github.com/longbridge/openapi-go/config" + "github.com/longbridge/openapi-go/oauth" + "github.com/longbridge/openapi-go/fundamental" +) + +func main() { + o := oauth.New("your-client-id"). + OnOpenURL(func(url string) { fmt.Println("Open this URL to authorize:", url) }) + if err := o.Build(context.Background()); err != nil { + log.Fatal(err) + } + conf, err := config.New(config.WithOAuthClient(o)) + if err != nil { + log.Fatal(err) + } + c, err := fundamental.NewFromCfg(conf) + if err != nil { + log.Fatal(err) + } + defer c.Close() + resp, err := c.IndustryPeers(context.Background(), "BK/US/IN00258", "US") + if err != nil { + log.Fatal(err) + } + fmt.Printf("%+v\n", resp) +} +``` + + + + +## Response + + +### Response Example + +```json +{ + "code": 0, + "message": "success", + "data": { + "top": {"name": "All Industries", "market": "US"}, + "chain": { + "name": "Technology", + "counter_id": "BK/US/IN00258", + "stock_num": 542, + "chg": "0.0231", + "ytd_chg": "0.0875", + "next": [ + { + "name": "Semiconductors", + "counter_id": "BK/US/IN00297", + "stock_num": 87, + "chg": "0.0512", + "ytd_chg": "0.1243", + "next": [] + } + ] + } + } +} +``` + +### Response Status + +| Status | Description | Schema | +| ------ | ----------- | ------ | +| 200 | Success | [IndustryPeersResponse](#IndustryPeersResponse) | +| 400 | Bad request | None | + +## Schemas + +### IndustryPeersResponse + + + +| Name | Type | Required | Description | +| ---- | ---- | -------- | ----------- | +| top | object | false | Top-level industry info | +| top.name | string | false | Top-level industry name | +| top.market | string | false | Market code | +| chain | object | false | Industry hierarchy tree root node | +| chain.name | string | false | Sector name | +| chain.counter_id | string | false | Sector unique identifier | +| chain.stock_num | integer | false | Number of stocks in the sector | +| chain.chg | string | false | Daily change (decimal) | +| chain.ytd_chg | string | false | Year-to-date change (decimal) | +| chain.next | array | false | Sub-sector list (same structure as chain, recursive) | diff --git a/docs/en/docs/fundamental/fundamental/industry_rank.md b/docs/en/docs/fundamental/fundamental/industry_rank.md new file mode 100644 index 00000000..c4380796 --- /dev/null +++ b/docs/en/docs/fundamental/fundamental/industry_rank.md @@ -0,0 +1,245 @@ +--- +slug: industry-rank +title: Industry Ranking +sidebar_position: 24 +language_tabs: false +toc_footers: [] +includes: [] +search: true +highlight_theme: '' +headingLevel: 2 +--- + +Get the industry ranking list by market and indicator. The returned Counter ID can be passed directly to `industry_peers` to explore the sub-sector hierarchy. + + +longbridge industry-rank --market US +longbridge industry-rank --market HK --indicator market-cap + + + + + +## Parameters + +> **SDK method parameters.** + +| Name | Type | Required | Description | +| ---- | ---- | -------- | ----------- | +| market | string | YES | Market code: `US` / `HK` / `CN` / `SG` | +| indicator | string | YES | Ranking indicator: `leading-gainer` / `today-trend` / `popularity` / `market-cap` / `revenue` / `revenue-growth` / `net-profit` / `net-profit-growth` | +| sort_type | string | YES | Sort mode: `single` / `multi` | +| limit | uint32 | YES | Number of results to return, default 20 | + +## Request Example + + + + +```python +from longbridge.openapi import FundamentalContext, Config, OAuthBuilder + +oauth = OAuthBuilder("your-client-id").build(lambda url: print("Visit:", url)) +config = Config.from_oauth(oauth) +ctx = FundamentalContext(config) + +resp = ctx.industry_rank("US", "leading-gainer", "single", 20) +print(resp) +``` + + + + +```python +import asyncio +from longbridge.openapi import AsyncFundamentalContext, Config, OAuthBuilder + +async def main() -> None: + oauth = await OAuthBuilder("your-client-id").build_async(lambda url: print("Visit:", url)) + config = Config.from_oauth(oauth) + ctx = AsyncFundamentalContext.create(config) + + resp = await ctx.industry_rank("US", "leading-gainer", "single", 20) + print(resp) + +if __name__ == "__main__": + asyncio.run(main()) +``` + + + + +```javascript +const { Config, FundamentalContext, OAuth } = require('longbridge') + +async function main() { + const oauth = await OAuth.build('your-client-id', (_, url) => { + console.log('Open this URL to authorize: ' + url) + }) + const config = Config.fromOAuth(oauth) + const ctx = FundamentalContext.new(config) + const resp = await ctx.industryRank('US', 'leading-gainer', 'single', 20) + console.log(resp) +} +main().catch(console.error) +``` + + + + +```java +import com.longbridge.*; +import com.longbridge.fundamental.*; + +class Main { + public static void main(String[] args) throws Exception { + try (OAuth oauth = new OAuthBuilder("your-client-id").build(url -> System.out.println("Open to authorize: " + url)).get(); + Config config = Config.fromOAuth(oauth); + FundamentalContext ctx = FundamentalContext.create(config)) { + var resp = ctx.getIndustryRank("US", "leading-gainer", "single", 20).get(); + System.out.println(resp); + } + } +} +``` + + + + +```rust +use std::sync::Arc; +use longbridge::{oauth::OAuthBuilder, fundamental::FundamentalContext, Config}; + +#[tokio::main] +async fn main() -> Result<(), Box> { + let oauth = OAuthBuilder::new("your-client-id").build(|url| println!("Open: {url}")).await?; + let config = Arc::new(Config::from_oauth(oauth)); + let ctx = FundamentalContext::new(config); + let resp = ctx.industry_rank("US", "leading-gainer", "single", 20).await?; + println!("{:?}", resp); + Ok(()) +} +``` + + + + +```cpp +#include +#include + +using namespace longbridge; +using namespace longbridge::fundamental; + +int main() { + OAuthBuilder("your-client-id").build( + [](const std::string& url) { std::cout << "Open: " << url << std::endl; }, + [](auto res) { + if (!res) return; + Config config = Config::from_oauth(*res); + FundamentalContext ctx = FundamentalContext::create(config); + ctx.industry_rank("US", "leading-gainer", "single", 20, [](auto resp) { + if (resp) std::cout << "OK" << std::endl; + }); + }); + std::cin.get(); +} +``` + + + + +```go +package main + +import ( + "context" + "fmt" + "log" + + "github.com/longbridge/openapi-go/config" + "github.com/longbridge/openapi-go/oauth" + "github.com/longbridge/openapi-go/fundamental" +) + +func main() { + o := oauth.New("your-client-id"). + OnOpenURL(func(url string) { fmt.Println("Open this URL to authorize:", url) }) + if err := o.Build(context.Background()); err != nil { + log.Fatal(err) + } + conf, err := config.New(config.WithOAuthClient(o)) + if err != nil { + log.Fatal(err) + } + c, err := fundamental.NewFromCfg(conf) + if err != nil { + log.Fatal(err) + } + defer c.Close() + resp, err := c.IndustryRank(context.Background(), "US", "leading-gainer", "single", 20) + if err != nil { + log.Fatal(err) + } + fmt.Printf("%+v\n", resp) +} +``` + + + + +## Response + + +### Response Example + +```json +{ + "code": 0, + "message": "success", + "data": { + "items": [ + { + "lists": [ + { + "name": "Technology", + "counter_id": "BK/US/IN00258", + "chg": "0.0231", + "leading_name": "NVIDIA", + "leading_ticker": "NVDA.US", + "leading_chg": "0.0512", + "value_name": "", + "value_data": "" + } + ] + } + ] + } +} +``` + +### Response Status + +| Status | Description | Schema | +| ------ | ----------- | ------ | +| 200 | Success | [IndustryRankResponse](#IndustryRankResponse) | +| 400 | Bad request | None | + +## Schemas + +### IndustryRankResponse + + + +| Name | Type | Required | Description | +| ---- | ---- | -------- | ----------- | +| items | array | false | Ranking group list | +| items[].lists | array | false | Industry entry list | +| items[].lists[].name | string | false | Industry name | +| items[].lists[].counter_id | string | false | Industry unique identifier (BK/MARKET/ID format), usable in `industry_peers` | +| items[].lists[].chg | string | false | Daily change (decimal) | +| items[].lists[].leading_name | string | false | Top-gaining stock name | +| items[].lists[].leading_ticker | string | false | Top-gaining stock ticker | +| items[].lists[].leading_chg | string | false | Top-gaining stock change | +| items[].lists[].value_name | string | false | Indicator name (populated by indicator type) | +| items[].lists[].value_data | string | false | Indicator value | diff --git a/docs/en/docs/fundamental/fundamental/institution_rating_views.md b/docs/en/docs/fundamental/fundamental/institution_rating_views.md new file mode 100644 index 00000000..93ef2871 --- /dev/null +++ b/docs/en/docs/fundamental/fundamental/institution_rating_views.md @@ -0,0 +1,244 @@ +--- +slug: institution-rating-views +title: Institutional Rating Views Timeline +sidebar_position: 23 +language_tabs: false +toc_footers: [] +includes: [] +search: true +highlight_theme: '' +headingLevel: 2 +--- + +Get the monthly institutional rating (buy/hold/sell) distribution timeline, newest first. + + +longbridge institution-rating AAPL.US --views +longbridge institution-rating TSLA.US --views + + + + + +## Parameters + +> **SDK method parameters.** + +| Name | Type | Required | Description | +| ---- | ---- | -------- | ----------- | +| symbol | string | YES | Security symbol, e.g. `AAPL.US` | + +## Request Example + + + + +```python +from longbridge.openapi import FundamentalContext, Config, OAuthBuilder + +oauth = OAuthBuilder("your-client-id").build(lambda url: print("Visit:", url)) +config = Config.from_oauth(oauth) +ctx = FundamentalContext(config) + +resp = ctx.institution_rating_views("AAPL.US") +print(resp) +``` + + + + +```python +import asyncio +from longbridge.openapi import AsyncFundamentalContext, Config, OAuthBuilder + +async def main() -> None: + oauth = await OAuthBuilder("your-client-id").build_async(lambda url: print("Visit:", url)) + config = Config.from_oauth(oauth) + ctx = AsyncFundamentalContext.create(config) + + resp = await ctx.institution_rating_views("AAPL.US") + print(resp) + +if __name__ == "__main__": + asyncio.run(main()) +``` + + + + +```javascript +const { Config, FundamentalContext, OAuth } = require('longbridge') + +async function main() { + const oauth = await OAuth.build('your-client-id', (_, url) => { + console.log('Open this URL to authorize: ' + url) + }) + const config = Config.fromOAuth(oauth) + const ctx = FundamentalContext.new(config) + const resp = await ctx.institutionRatingViews('AAPL.US') + console.log(resp) +} +main().catch(console.error) +``` + + + + +```java +import com.longbridge.*; +import com.longbridge.fundamental.*; + +class Main { + public static void main(String[] args) throws Exception { + try (OAuth oauth = new OAuthBuilder("your-client-id").build(url -> System.out.println("Open to authorize: " + url)).get(); + Config config = Config.fromOAuth(oauth); + FundamentalContext ctx = FundamentalContext.create(config)) { + var resp = ctx.getInstitutionRatingViews("AAPL.US").get(); + System.out.println(resp); + } + } +} +``` + + + + +```rust +use std::sync::Arc; +use longbridge::{oauth::OAuthBuilder, fundamental::FundamentalContext, Config}; + +#[tokio::main] +async fn main() -> Result<(), Box> { + let oauth = OAuthBuilder::new("your-client-id").build(|url| println!("Open: {url}")).await?; + let config = Arc::new(Config::from_oauth(oauth)); + let ctx = FundamentalContext::new(config); + let resp = ctx.institution_rating_views("AAPL.US").await?; + println!("{:?}", resp); + Ok(()) +} +``` + + + + +```cpp +#include +#include + +using namespace longbridge; +using namespace longbridge::fundamental; + +int main() { + OAuthBuilder("your-client-id").build( + [](const std::string& url) { std::cout << "Open: " << url << std::endl; }, + [](auto res) { + if (!res) return; + Config config = Config::from_oauth(*res); + FundamentalContext ctx = FundamentalContext::create(config); + ctx.institution_rating_views("AAPL.US", [](auto resp) { + if (resp) std::cout << "OK" << std::endl; + }); + }); + std::cin.get(); +} +``` + + + + +```go +package main + +import ( + "context" + "fmt" + "log" + + "github.com/longbridge/openapi-go/config" + "github.com/longbridge/openapi-go/oauth" + "github.com/longbridge/openapi-go/fundamental" +) + +func main() { + o := oauth.New("your-client-id"). + OnOpenURL(func(url string) { fmt.Println("Open this URL to authorize:", url) }) + if err := o.Build(context.Background()); err != nil { + log.Fatal(err) + } + conf, err := config.New(config.WithOAuthClient(o)) + if err != nil { + log.Fatal(err) + } + c, err := fundamental.NewFromCfg(conf) + if err != nil { + log.Fatal(err) + } + defer c.Close() + resp, err := c.InstitutionRatingViews(context.Background(), "AAPL.US") + if err != nil { + log.Fatal(err) + } + fmt.Printf("%+v\n", resp) +} +``` + + + + +## Response + + +### Response Example + +```json +{ + "code": 0, + "message": "success", + "data": { + "elist": [ + { + "date": 1746057600, + "buy": 18, + "over": 5, + "hold": 17, + "under": 3, + "sell": 4, + "total": 51 + }, + { + "date": 1743379200, + "buy": 17, + "over": 6, + "hold": 18, + "under": 3, + "sell": 5, + "total": 53 + } + ] + } +} +``` + +### Response Status + +| Status | Description | Schema | +| ------ | ----------- | ------ | +| 200 | Success | [InstitutionRatingViewsResponse](#InstitutionRatingViewsResponse) | +| 400 | Bad request | None | + +## Schemas + +### InstitutionRatingViewsResponse + + + +| Name | Type | Required | Description | +| ---- | ---- | -------- | ----------- | +| elist | array | false | Monthly rating distribution list, newest first | +| elist[].date | int64 | false | Unix timestamp (seconds) | +| elist[].buy | integer | false | Buy rating count | +| elist[].over | integer | false | Outperform rating count | +| elist[].hold | integer | false | Hold rating count | +| elist[].under | integer | false | Underperform rating count | +| elist[].sell | integer | false | Sell rating count | +| elist[].total | integer | false | Total analyst count | diff --git a/docs/zh-CN/docs/fundamental/fundamental/business_segments.md b/docs/zh-CN/docs/fundamental/fundamental/business_segments.md new file mode 100644 index 00000000..fb1cd9fa --- /dev/null +++ b/docs/zh-CN/docs/fundamental/fundamental/business_segments.md @@ -0,0 +1,232 @@ +--- +slug: business-segments +title: 业务分部(当前期) +sidebar_position: 21 +language_tabs: false +toc_footers: [] +includes: [] +search: true +highlight_theme: '' +headingLevel: 2 +--- + +获取上市公司当前报告期的业务分部收入占比。 + + +longbridge business-segments AAPL.US +longbridge business-segments 700.HK + + + + + +## Parameters + +> **SDK 方法参数。** + +| Name | Type | Required | Description | +| ---- | ---- | -------- | ----------- | +| symbol | string | 是 | 证券代码,例如 `AAPL.US` | + +## Request Example + + + + +```python +from longbridge.openapi import FundamentalContext, Config, OAuthBuilder + +oauth = OAuthBuilder("your-client-id").build(lambda url: print("Visit:", url)) +config = Config.from_oauth(oauth) +ctx = FundamentalContext(config) + +resp = ctx.business_segments("AAPL.US") +print(resp) +``` + + + + +```python +import asyncio +from longbridge.openapi import AsyncFundamentalContext, Config, OAuthBuilder + +async def main() -> None: + oauth = await OAuthBuilder("your-client-id").build_async(lambda url: print("Visit:", url)) + config = Config.from_oauth(oauth) + ctx = AsyncFundamentalContext.create(config) + + resp = await ctx.business_segments("AAPL.US") + print(resp) + +if __name__ == "__main__": + asyncio.run(main()) +``` + + + + +```javascript +const { Config, FundamentalContext, OAuth } = require('longbridge') + +async function main() { + const oauth = await OAuth.build('your-client-id', (_, url) => { + console.log('Open this URL to authorize: ' + url) + }) + const config = Config.fromOAuth(oauth) + const ctx = FundamentalContext.new(config) + const resp = await ctx.businessSegments('AAPL.US') + console.log(resp) +} +main().catch(console.error) +``` + + + + +```java +import com.longbridge.*; +import com.longbridge.fundamental.*; + +class Main { + public static void main(String[] args) throws Exception { + try (OAuth oauth = new OAuthBuilder("your-client-id").build(url -> System.out.println("Open to authorize: " + url)).get(); + Config config = Config.fromOAuth(oauth); + FundamentalContext ctx = FundamentalContext.create(config)) { + var resp = ctx.getBusinessSegments("AAPL.US").get(); + System.out.println(resp); + } + } +} +``` + + + + +```rust +use std::sync::Arc; +use longbridge::{oauth::OAuthBuilder, fundamental::FundamentalContext, Config}; + +#[tokio::main] +async fn main() -> Result<(), Box> { + let oauth = OAuthBuilder::new("your-client-id").build(|url| println!("Open: {url}")).await?; + let config = Arc::new(Config::from_oauth(oauth)); + let ctx = FundamentalContext::new(config); + let resp = ctx.business_segments("AAPL.US").await?; + println!("{:?}", resp); + Ok(()) +} +``` + + + + +```cpp +#include +#include + +using namespace longbridge; +using namespace longbridge::fundamental; + +int main() { + OAuthBuilder("your-client-id").build( + [](const std::string& url) { std::cout << "Open: " << url << std::endl; }, + [](auto res) { + if (!res) return; + Config config = Config::from_oauth(*res); + FundamentalContext ctx = FundamentalContext::create(config); + ctx.business_segments("AAPL.US", [](auto resp) { + if (resp) std::cout << "OK" << std::endl; + }); + }); + std::cin.get(); +} +``` + + + + +```go +package main + +import ( + "context" + "fmt" + "log" + + "github.com/longbridge/openapi-go/config" + "github.com/longbridge/openapi-go/oauth" + "github.com/longbridge/openapi-go/fundamental" +) + +func main() { + o := oauth.New("your-client-id"). + OnOpenURL(func(url string) { fmt.Println("Open this URL to authorize:", url) }) + if err := o.Build(context.Background()); err != nil { + log.Fatal(err) + } + conf, err := config.New(config.WithOAuthClient(o)) + if err != nil { + log.Fatal(err) + } + c, err := fundamental.NewFromCfg(conf) + if err != nil { + log.Fatal(err) + } + defer c.Close() + resp, err := c.BusinessSegments(context.Background(), "AAPL.US") + if err != nil { + log.Fatal(err) + } + fmt.Printf("%+v\n", resp) +} +``` + + + + +## Response + + +### Response Example + +```json +{ + "code": 0, + "message": "success", + "data": { + "date": "2024Q4", + "total": "124300000000", + "currency": "USD", + "business": [ + {"name": "iPhone", "percent": "0.5619"}, + {"name": "Services", "percent": "0.2196"}, + {"name": "Mac", "percent": "0.0804"}, + {"name": "iPad", "percent": "0.0700"}, + {"name": "Wearables", "percent": "0.0681"} + ] + } +} +``` + +### Response Status + +| Status | Description | Schema | +| ------ | ----------- | ------ | +| 200 | 成功 | [BusinessSegmentsResponse](#BusinessSegmentsResponse) | +| 400 | 请求错误 | None | + +## Schemas + +### BusinessSegmentsResponse + + + +| Name | Type | Required | Description | +| ---- | ---- | -------- | ----------- | +| date | string | 否 | 报告期标签,例如 `2024Q4` | +| total | string | 否 | 当期总收入(字符串数值) | +| currency | string | 否 | 货币代码,例如 `USD` | +| business | array | 否 | 业务分部列表 | +| business[].name | string | 否 | 业务分部名称 | +| business[].percent | string | 否 | 收入占比(0–1 小数) | diff --git a/docs/zh-CN/docs/fundamental/fundamental/business_segments_history.md b/docs/zh-CN/docs/fundamental/fundamental/business_segments_history.md new file mode 100644 index 00000000..71fa9c00 --- /dev/null +++ b/docs/zh-CN/docs/fundamental/fundamental/business_segments_history.md @@ -0,0 +1,245 @@ +--- +slug: business-segments-history +title: 业务分部(历史趋势) +sidebar_position: 22 +language_tabs: false +toc_footers: [] +includes: [] +search: true +highlight_theme: '' +headingLevel: 2 +--- + +获取上市公司按报告期的历史业务分部收入趋势。 + + +longbridge business-segments AAPL.US --history +longbridge business-segments AAPL.US --history --report qf + + + + + +## Parameters + +> **SDK 方法参数。** + +| Name | Type | Required | Description | +| ---- | ---- | -------- | ----------- | +| symbol | string | 是 | 证券代码,例如 `AAPL.US` | +| report | string | 否 | 报告类型:`qf`(季报)/ `saf`(半年报)/ `af`(年报) | +| cate | string | 否 | 分部类别过滤 | + +## Request Example + + + + +```python +from longbridge.openapi import FundamentalContext, Config, OAuthBuilder + +oauth = OAuthBuilder("your-client-id").build(lambda url: print("Visit:", url)) +config = Config.from_oauth(oauth) +ctx = FundamentalContext(config) + +resp = ctx.business_segments_history("AAPL.US", report="qf") +print(resp) +``` + + + + +```python +import asyncio +from longbridge.openapi import AsyncFundamentalContext, Config, OAuthBuilder + +async def main() -> None: + oauth = await OAuthBuilder("your-client-id").build_async(lambda url: print("Visit:", url)) + config = Config.from_oauth(oauth) + ctx = AsyncFundamentalContext.create(config) + + resp = await ctx.business_segments_history("AAPL.US", report="qf") + print(resp) + +if __name__ == "__main__": + asyncio.run(main()) +``` + + + + +```javascript +const { Config, FundamentalContext, OAuth } = require('longbridge') + +async function main() { + const oauth = await OAuth.build('your-client-id', (_, url) => { + console.log('Open this URL to authorize: ' + url) + }) + const config = Config.fromOAuth(oauth) + const ctx = FundamentalContext.new(config) + const resp = await ctx.businessSegmentsHistory('AAPL.US', { report: 'qf' }) + console.log(resp) +} +main().catch(console.error) +``` + + + + +```java +import com.longbridge.*; +import com.longbridge.fundamental.*; + +class Main { + public static void main(String[] args) throws Exception { + try (OAuth oauth = new OAuthBuilder("your-client-id").build(url -> System.out.println("Open to authorize: " + url)).get(); + Config config = Config.fromOAuth(oauth); + FundamentalContext ctx = FundamentalContext.create(config)) { + var resp = ctx.getBusinessSegmentsHistory("AAPL.US", "qf", null).get(); + System.out.println(resp); + } + } +} +``` + + + + +```rust +use std::sync::Arc; +use longbridge::{oauth::OAuthBuilder, fundamental::FundamentalContext, Config}; + +#[tokio::main] +async fn main() -> Result<(), Box> { + let oauth = OAuthBuilder::new("your-client-id").build(|url| println!("Open: {url}")).await?; + let config = Arc::new(Config::from_oauth(oauth)); + let ctx = FundamentalContext::new(config); + let resp = ctx.business_segments_history("AAPL.US", Some("qf"), None).await?; + println!("{:?}", resp); + Ok(()) +} +``` + + + + +```cpp +#include +#include + +using namespace longbridge; +using namespace longbridge::fundamental; + +int main() { + OAuthBuilder("your-client-id").build( + [](const std::string& url) { std::cout << "Open: " << url << std::endl; }, + [](auto res) { + if (!res) return; + Config config = Config::from_oauth(*res); + FundamentalContext ctx = FundamentalContext::create(config); + ctx.business_segments_history("AAPL.US", "qf", "", [](auto resp) { + if (resp) std::cout << "OK" << std::endl; + }); + }); + std::cin.get(); +} +``` + + + + +```go +package main + +import ( + "context" + "fmt" + "log" + + "github.com/longbridge/openapi-go/config" + "github.com/longbridge/openapi-go/oauth" + "github.com/longbridge/openapi-go/fundamental" +) + +func main() { + o := oauth.New("your-client-id"). + OnOpenURL(func(url string) { fmt.Println("Open this URL to authorize:", url) }) + if err := o.Build(context.Background()); err != nil { + log.Fatal(err) + } + conf, err := config.New(config.WithOAuthClient(o)) + if err != nil { + log.Fatal(err) + } + c, err := fundamental.NewFromCfg(conf) + if err != nil { + log.Fatal(err) + } + defer c.Close() + resp, err := c.BusinessSegmentsHistory(context.Background(), "AAPL.US", "qf", "") + if err != nil { + log.Fatal(err) + } + fmt.Printf("%+v\n", resp) +} +``` + + + + +## Response + + +### Response Example + +```json +{ + "code": 0, + "message": "success", + "data": { + "historical": [ + { + "date": "2024Q4", + "total": "124300000000", + "currency": "USD", + "business": [ + {"name": "iPhone", "percent": "0.5619", "value": "69900000000"}, + {"name": "Services", "percent": "0.2196", "value": "26300000000"} + ], + "regionals": [ + {"name": "Americas", "percent": "0.4280", "value": "53200000000"}, + {"name": "Europe", "percent": "0.2520", "value": "30100000000"} + ] + } + ] + } +} +``` + +### Response Status + +| Status | Description | Schema | +| ------ | ----------- | ------ | +| 200 | 成功 | [BusinessSegmentsHistoryResponse](#BusinessSegmentsHistoryResponse) | +| 400 | 请求错误 | None | + +## Schemas + +### BusinessSegmentsHistoryResponse + + + +| Name | Type | Required | Description | +| ---- | ---- | -------- | ----------- | +| historical | array | 否 | 历史报告期列表 | +| historical[].date | string | 否 | 报告期标签,例如 `2024Q4` | +| historical[].total | string | 否 | 当期总收入(字符串数值) | +| historical[].currency | string | 否 | 货币代码 | +| historical[].business | array | 否 | 业务分部列表 | +| historical[].business[].name | string | 否 | 业务分部名称 | +| historical[].business[].percent | string | 否 | 收入占比(0–1 小数) | +| historical[].business[].value | string | 否 | 绝对收入数值 | +| historical[].regionals | array | 否 | 地区分部列表 | +| historical[].regionals[].name | string | 否 | 地区名称 | +| historical[].regionals[].percent | string | 否 | 收入占比(0–1 小数) | +| historical[].regionals[].value | string | 否 | 绝对收入数值 | diff --git a/docs/zh-CN/docs/fundamental/fundamental/financial_report_snapshot.md b/docs/zh-CN/docs/fundamental/fundamental/financial_report_snapshot.md new file mode 100644 index 00000000..1656f717 --- /dev/null +++ b/docs/zh-CN/docs/fundamental/fundamental/financial_report_snapshot.md @@ -0,0 +1,261 @@ +--- +slug: financial-report-snapshot +title: 财报快照(AI 摘要 + 预测对比) +sidebar_position: 26 +language_tabs: false +toc_footers: [] +includes: [] +search: true +highlight_theme: '' +headingLevel: 2 +--- + +获取 AI 生成的财报摘要、营收/EBIT/EPS 预测对比(超预期/低于预期),以及关键财务指标。 + + +longbridge financial-report snapshot AAPL.US +longbridge financial-report snapshot AAPL.US --report qf --year 2024 --period 4 + + + + + +## Parameters + +> **SDK 方法参数。** + +| Name | Type | Required | Description | +| ---- | ---- | -------- | ----------- | +| symbol | string | 是 | 证券代码,例如 `AAPL.US` | +| report | string | 否 | 报告类型:`qf`(季报)/ `saf`(半年报)/ `af`(年报) | +| fiscal_year | uint32 | 否 | 财政年度,例如 `2024` | +| fiscal_period | string | 否 | 财政季度,例如 `1` / `2` / `3` / `4` | + +## Request Example + + + + +```python +from longbridge.openapi import FundamentalContext, Config, OAuthBuilder + +oauth = OAuthBuilder("your-client-id").build(lambda url: print("Visit:", url)) +config = Config.from_oauth(oauth) +ctx = FundamentalContext(config) + +resp = ctx.financial_report_snapshot("AAPL.US", report="qf", fiscal_year=2024, fiscal_period="4") +print(resp) +``` + + + + +```python +import asyncio +from longbridge.openapi import AsyncFundamentalContext, Config, OAuthBuilder + +async def main() -> None: + oauth = await OAuthBuilder("your-client-id").build_async(lambda url: print("Visit:", url)) + config = Config.from_oauth(oauth) + ctx = AsyncFundamentalContext.create(config) + + resp = await ctx.financial_report_snapshot("AAPL.US", report="qf", fiscal_year=2024, fiscal_period="4") + print(resp) + +if __name__ == "__main__": + asyncio.run(main()) +``` + + + + +```javascript +const { Config, FundamentalContext, OAuth } = require('longbridge') + +async function main() { + const oauth = await OAuth.build('your-client-id', (_, url) => { + console.log('Open this URL to authorize: ' + url) + }) + const config = Config.fromOAuth(oauth) + const ctx = FundamentalContext.new(config) + const resp = await ctx.financialReportSnapshot('AAPL.US', { report: 'qf', fiscalYear: 2024, fiscalPeriod: '4' }) + console.log(resp) +} +main().catch(console.error) +``` + + + + +```java +import com.longbridge.*; +import com.longbridge.fundamental.*; + +class Main { + public static void main(String[] args) throws Exception { + try (OAuth oauth = new OAuthBuilder("your-client-id").build(url -> System.out.println("Open to authorize: " + url)).get(); + Config config = Config.fromOAuth(oauth); + FundamentalContext ctx = FundamentalContext.create(config)) { + var resp = ctx.getFinancialReportSnapshot("AAPL.US", "qf", 2024, "4").get(); + System.out.println(resp); + } + } +} +``` + + + + +```rust +use std::sync::Arc; +use longbridge::{oauth::OAuthBuilder, fundamental::FundamentalContext, Config}; + +#[tokio::main] +async fn main() -> Result<(), Box> { + let oauth = OAuthBuilder::new("your-client-id").build(|url| println!("Open: {url}")).await?; + let config = Arc::new(Config::from_oauth(oauth)); + let ctx = FundamentalContext::new(config); + let resp = ctx.financial_report_snapshot("AAPL.US", Some("qf"), Some(2024), Some("4")).await?; + println!("{:?}", resp); + Ok(()) +} +``` + + + + +```cpp +#include +#include + +using namespace longbridge; +using namespace longbridge::fundamental; + +int main() { + OAuthBuilder("your-client-id").build( + [](const std::string& url) { std::cout << "Open: " << url << std::endl; }, + [](auto res) { + if (!res) return; + Config config = Config::from_oauth(*res); + FundamentalContext ctx = FundamentalContext::create(config); + ctx.financial_report_snapshot("AAPL.US", "qf", 2024, "4", [](auto resp) { + if (resp) std::cout << "OK" << std::endl; + }); + }); + std::cin.get(); +} +``` + + + + +```go +package main + +import ( + "context" + "fmt" + "log" + + "github.com/longbridge/openapi-go/config" + "github.com/longbridge/openapi-go/oauth" + "github.com/longbridge/openapi-go/fundamental" +) + +func main() { + o := oauth.New("your-client-id"). + OnOpenURL(func(url string) { fmt.Println("Open this URL to authorize:", url) }) + if err := o.Build(context.Background()); err != nil { + log.Fatal(err) + } + conf, err := config.New(config.WithOAuthClient(o)) + if err != nil { + log.Fatal(err) + } + c, err := fundamental.NewFromCfg(conf) + if err != nil { + log.Fatal(err) + } + defer c.Close() + resp, err := c.FinancialReportSnapshot(context.Background(), "AAPL.US", "qf", 2024, "4") + if err != nil { + log.Fatal(err) + } + fmt.Printf("%+v\n", resp) +} +``` + + + + +## Response + + +### Response Example + +```json +{ + "code": 0, + "message": "success", + "data": { + "name": "Apple Inc.", + "ticker": "AAPL.US", + "fp_start": "2024-10-01", + "fp_end": "2024-12-31", + "currency": "USD", + "report_desc": "Apple delivered record revenue of $124.3B in Q1 FY2025...", + "fo_revenue": {"value": "124300000000", "yoy": "0.0407", "cmp_desc": "beat by 1.2%", "est_value": "123800000000"}, + "fo_ebit": {"value": "42800000000", "yoy": "0.0520", "cmp_desc": "beat by 0.8%", "est_value": "42500000000"}, + "fo_eps": {"value": "2.40", "yoy": "0.0870", "cmp_desc": "beat by 2.1%", "est_value": "2.35"}, + "fr_revenue": {"value": "124300000000", "yoy": "0.0407"}, + "fr_profit": {"value": "36330000000", "yoy": "0.0710"}, + "fr_roe_ttm": "0.1570", + "fr_profit_margin": "0.2923", + "fr_debt_assets_ratio": "0.8120" + } +} +``` + +### Response Status + +| Status | Description | Schema | +| ------ | ----------- | ------ | +| 200 | 成功 | [FinancialReportSnapshotResponse](#FinancialReportSnapshotResponse) | +| 400 | 请求错误 | None | + +## Schemas + +### FinancialReportSnapshotResponse + + + +| Name | Type | Required | Description | +| ---- | ---- | -------- | ----------- | +| name | string | 否 | 公司名称 | +| ticker | string | 否 | 证券代码 | +| fp_start | string | 否 | 财政期开始日期 | +| fp_end | string | 否 | 财政期结束日期 | +| currency | string | 否 | 货币代码 | +| report_desc | string | 否 | AI 生成的财报摘要文字 | +| fo_revenue | object | 否 | 营收预测对比 | +| fo_revenue.value | string | 否 | 实际营收 | +| fo_revenue.yoy | string | 否 | 同比增速(小数) | +| fo_revenue.cmp_desc | string | 否 | 超预期/低于预期描述 | +| fo_revenue.est_value | string | 否 | 一致预期值 | +| fo_ebit | object | 否 | EBIT 预测对比(字段同 fo_revenue) | +| fo_eps | object | 否 | EPS 预测对比(字段同 fo_revenue) | +| fr_revenue | object | 否 | 营收财务数据 | +| fr_revenue.value | string | 否 | 营收数值 | +| fr_revenue.yoy | string | 否 | 同比增速 | +| fr_profit | object | 否 | 净利润财务数据(字段同 fr_revenue) | +| fr_operate_cash | object | 否 | 经营现金流(字段同 fr_revenue) | +| fr_invest_cash | object | 否 | 投资现金流(字段同 fr_revenue) | +| fr_finance_cash | object | 否 | 融资现金流(字段同 fr_revenue) | +| fr_total_assets | object | 否 | 总资产(字段同 fr_revenue) | +| fr_total_liability | object | 否 | 总负债(字段同 fr_revenue) | +| fr_roe_ttm | string | 否 | 净资产收益率 TTM(小数) | +| fr_profit_margin | string | 否 | 净利率(小数) | +| fr_profit_margin_ttm | string | 否 | 净利率 TTM(小数) | +| fr_asset_turn_ttm | string | 否 | 资产周转率 TTM(小数) | +| fr_leverage_ttm | string | 否 | 杠杆率 TTM(小数) | +| fr_debt_assets_ratio | string | 否 | 资产负债率(小数) | diff --git a/docs/zh-CN/docs/fundamental/fundamental/industry_peers.md b/docs/zh-CN/docs/fundamental/fundamental/industry_peers.md new file mode 100644 index 00000000..4813f495 --- /dev/null +++ b/docs/zh-CN/docs/fundamental/fundamental/industry_peers.md @@ -0,0 +1,245 @@ +--- +slug: industry-peers +title: 行业子板块层级树 +sidebar_position: 25 +language_tabs: false +toc_footers: [] +includes: [] +search: true +highlight_theme: '' +headingLevel: 2 +--- + +获取行业分组的层级子板块树,含各节点股票数量、日涨跌幅和年初至今涨跌幅。Counter ID 可从 `industry_rank` 返回结果中获取。 + + +longbridge industry-peers BK/US/IN00258 +longbridge industry-peers BK/HK/IN20337 + + + + + +## Parameters + +> **SDK 方法参数。** + +| Name | Type | Required | Description | +| ---- | ---- | -------- | ----------- | +| counter_id | string | 是 | 行业唯一标识(BK/市场/ID 格式),来源于 `industry_rank` | +| market | string | 是 | 市场代码:`US` / `HK` / `CN` / `SG` | + +## Request Example + + + + +```python +from longbridge.openapi import FundamentalContext, Config, OAuthBuilder + +oauth = OAuthBuilder("your-client-id").build(lambda url: print("Visit:", url)) +config = Config.from_oauth(oauth) +ctx = FundamentalContext(config) + +resp = ctx.industry_peers("BK/US/IN00258", "US") +print(resp) +``` + + + + +```python +import asyncio +from longbridge.openapi import AsyncFundamentalContext, Config, OAuthBuilder + +async def main() -> None: + oauth = await OAuthBuilder("your-client-id").build_async(lambda url: print("Visit:", url)) + config = Config.from_oauth(oauth) + ctx = AsyncFundamentalContext.create(config) + + resp = await ctx.industry_peers("BK/US/IN00258", "US") + print(resp) + +if __name__ == "__main__": + asyncio.run(main()) +``` + + + + +```javascript +const { Config, FundamentalContext, OAuth } = require('longbridge') + +async function main() { + const oauth = await OAuth.build('your-client-id', (_, url) => { + console.log('Open this URL to authorize: ' + url) + }) + const config = Config.fromOAuth(oauth) + const ctx = FundamentalContext.new(config) + const resp = await ctx.industryPeers('BK/US/IN00258', 'US') + console.log(resp) +} +main().catch(console.error) +``` + + + + +```java +import com.longbridge.*; +import com.longbridge.fundamental.*; + +class Main { + public static void main(String[] args) throws Exception { + try (OAuth oauth = new OAuthBuilder("your-client-id").build(url -> System.out.println("Open to authorize: " + url)).get(); + Config config = Config.fromOAuth(oauth); + FundamentalContext ctx = FundamentalContext.create(config)) { + var resp = ctx.getIndustryPeers("BK/US/IN00258", "US").get(); + System.out.println(resp); + } + } +} +``` + + + + +```rust +use std::sync::Arc; +use longbridge::{oauth::OAuthBuilder, fundamental::FundamentalContext, Config}; + +#[tokio::main] +async fn main() -> Result<(), Box> { + let oauth = OAuthBuilder::new("your-client-id").build(|url| println!("Open: {url}")).await?; + let config = Arc::new(Config::from_oauth(oauth)); + let ctx = FundamentalContext::new(config); + let resp = ctx.industry_peers("BK/US/IN00258", "US").await?; + println!("{:?}", resp); + Ok(()) +} +``` + + + + +```cpp +#include +#include + +using namespace longbridge; +using namespace longbridge::fundamental; + +int main() { + OAuthBuilder("your-client-id").build( + [](const std::string& url) { std::cout << "Open: " << url << std::endl; }, + [](auto res) { + if (!res) return; + Config config = Config::from_oauth(*res); + FundamentalContext ctx = FundamentalContext::create(config); + ctx.industry_peers("BK/US/IN00258", "US", [](auto resp) { + if (resp) std::cout << "OK" << std::endl; + }); + }); + std::cin.get(); +} +``` + + + + +```go +package main + +import ( + "context" + "fmt" + "log" + + "github.com/longbridge/openapi-go/config" + "github.com/longbridge/openapi-go/oauth" + "github.com/longbridge/openapi-go/fundamental" +) + +func main() { + o := oauth.New("your-client-id"). + OnOpenURL(func(url string) { fmt.Println("Open this URL to authorize:", url) }) + if err := o.Build(context.Background()); err != nil { + log.Fatal(err) + } + conf, err := config.New(config.WithOAuthClient(o)) + if err != nil { + log.Fatal(err) + } + c, err := fundamental.NewFromCfg(conf) + if err != nil { + log.Fatal(err) + } + defer c.Close() + resp, err := c.IndustryPeers(context.Background(), "BK/US/IN00258", "US") + if err != nil { + log.Fatal(err) + } + fmt.Printf("%+v\n", resp) +} +``` + + + + +## Response + + +### Response Example + +```json +{ + "code": 0, + "message": "success", + "data": { + "top": {"name": "All Industries", "market": "US"}, + "chain": { + "name": "Technology", + "counter_id": "BK/US/IN00258", + "stock_num": 542, + "chg": "0.0231", + "ytd_chg": "0.0875", + "next": [ + { + "name": "Semiconductors", + "counter_id": "BK/US/IN00297", + "stock_num": 87, + "chg": "0.0512", + "ytd_chg": "0.1243", + "next": [] + } + ] + } + } +} +``` + +### Response Status + +| Status | Description | Schema | +| ------ | ----------- | ------ | +| 200 | 成功 | [IndustryPeersResponse](#IndustryPeersResponse) | +| 400 | 请求错误 | None | + +## Schemas + +### IndustryPeersResponse + + + +| Name | Type | Required | Description | +| ---- | ---- | -------- | ----------- | +| top | object | 否 | 顶层行业信息 | +| top.name | string | 否 | 顶层行业名称 | +| top.market | string | 否 | 市场代码 | +| chain | object | 否 | 行业层级树根节点 | +| chain.name | string | 否 | 板块名称 | +| chain.counter_id | string | 否 | 板块唯一标识 | +| chain.stock_num | integer | 否 | 板块内股票数量 | +| chain.chg | string | 否 | 当日涨跌幅(小数) | +| chain.ytd_chg | string | 否 | 年初至今涨跌幅(小数) | +| chain.next | array | 否 | 子板块列表(结构与 chain 相同,递归) | diff --git a/docs/zh-CN/docs/fundamental/fundamental/industry_rank.md b/docs/zh-CN/docs/fundamental/fundamental/industry_rank.md new file mode 100644 index 00000000..3c68e8cb --- /dev/null +++ b/docs/zh-CN/docs/fundamental/fundamental/industry_rank.md @@ -0,0 +1,245 @@ +--- +slug: industry-rank +title: 行业排行榜 +sidebar_position: 24 +language_tabs: false +toc_footers: [] +includes: [] +search: true +highlight_theme: '' +headingLevel: 2 +--- + +按市场和指标获取行业排行榜。返回的 Counter ID 可直接传入 `industry_peers` 查询子行业树。 + + +longbridge industry-rank --market US +longbridge industry-rank --market HK --indicator market-cap + + + + + +## Parameters + +> **SDK 方法参数。** + +| Name | Type | Required | Description | +| ---- | ---- | -------- | ----------- | +| market | string | 是 | 市场代码:`US` / `HK` / `CN` / `SG` | +| indicator | string | 是 | 排行指标:`leading-gainer` / `today-trend` / `popularity` / `market-cap` / `revenue` / `revenue-growth` / `net-profit` / `net-profit-growth` | +| sort_type | string | 是 | 排序方式:`single`(单一排序)/ `multi`(多维排序) | +| limit | uint32 | 是 | 返回条数,默认 20 | + +## Request Example + + + + +```python +from longbridge.openapi import FundamentalContext, Config, OAuthBuilder + +oauth = OAuthBuilder("your-client-id").build(lambda url: print("Visit:", url)) +config = Config.from_oauth(oauth) +ctx = FundamentalContext(config) + +resp = ctx.industry_rank("US", "leading-gainer", "single", 20) +print(resp) +``` + + + + +```python +import asyncio +from longbridge.openapi import AsyncFundamentalContext, Config, OAuthBuilder + +async def main() -> None: + oauth = await OAuthBuilder("your-client-id").build_async(lambda url: print("Visit:", url)) + config = Config.from_oauth(oauth) + ctx = AsyncFundamentalContext.create(config) + + resp = await ctx.industry_rank("US", "leading-gainer", "single", 20) + print(resp) + +if __name__ == "__main__": + asyncio.run(main()) +``` + + + + +```javascript +const { Config, FundamentalContext, OAuth } = require('longbridge') + +async function main() { + const oauth = await OAuth.build('your-client-id', (_, url) => { + console.log('Open this URL to authorize: ' + url) + }) + const config = Config.fromOAuth(oauth) + const ctx = FundamentalContext.new(config) + const resp = await ctx.industryRank('US', 'leading-gainer', 'single', 20) + console.log(resp) +} +main().catch(console.error) +``` + + + + +```java +import com.longbridge.*; +import com.longbridge.fundamental.*; + +class Main { + public static void main(String[] args) throws Exception { + try (OAuth oauth = new OAuthBuilder("your-client-id").build(url -> System.out.println("Open to authorize: " + url)).get(); + Config config = Config.fromOAuth(oauth); + FundamentalContext ctx = FundamentalContext.create(config)) { + var resp = ctx.getIndustryRank("US", "leading-gainer", "single", 20).get(); + System.out.println(resp); + } + } +} +``` + + + + +```rust +use std::sync::Arc; +use longbridge::{oauth::OAuthBuilder, fundamental::FundamentalContext, Config}; + +#[tokio::main] +async fn main() -> Result<(), Box> { + let oauth = OAuthBuilder::new("your-client-id").build(|url| println!("Open: {url}")).await?; + let config = Arc::new(Config::from_oauth(oauth)); + let ctx = FundamentalContext::new(config); + let resp = ctx.industry_rank("US", "leading-gainer", "single", 20).await?; + println!("{:?}", resp); + Ok(()) +} +``` + + + + +```cpp +#include +#include + +using namespace longbridge; +using namespace longbridge::fundamental; + +int main() { + OAuthBuilder("your-client-id").build( + [](const std::string& url) { std::cout << "Open: " << url << std::endl; }, + [](auto res) { + if (!res) return; + Config config = Config::from_oauth(*res); + FundamentalContext ctx = FundamentalContext::create(config); + ctx.industry_rank("US", "leading-gainer", "single", 20, [](auto resp) { + if (resp) std::cout << "OK" << std::endl; + }); + }); + std::cin.get(); +} +``` + + + + +```go +package main + +import ( + "context" + "fmt" + "log" + + "github.com/longbridge/openapi-go/config" + "github.com/longbridge/openapi-go/oauth" + "github.com/longbridge/openapi-go/fundamental" +) + +func main() { + o := oauth.New("your-client-id"). + OnOpenURL(func(url string) { fmt.Println("Open this URL to authorize:", url) }) + if err := o.Build(context.Background()); err != nil { + log.Fatal(err) + } + conf, err := config.New(config.WithOAuthClient(o)) + if err != nil { + log.Fatal(err) + } + c, err := fundamental.NewFromCfg(conf) + if err != nil { + log.Fatal(err) + } + defer c.Close() + resp, err := c.IndustryRank(context.Background(), "US", "leading-gainer", "single", 20) + if err != nil { + log.Fatal(err) + } + fmt.Printf("%+v\n", resp) +} +``` + + + + +## Response + + +### Response Example + +```json +{ + "code": 0, + "message": "success", + "data": { + "items": [ + { + "lists": [ + { + "name": "Technology", + "counter_id": "BK/US/IN00258", + "chg": "0.0231", + "leading_name": "NVIDIA", + "leading_ticker": "NVDA.US", + "leading_chg": "0.0512", + "value_name": "", + "value_data": "" + } + ] + } + ] + } +} +``` + +### Response Status + +| Status | Description | Schema | +| ------ | ----------- | ------ | +| 200 | 成功 | [IndustryRankResponse](#IndustryRankResponse) | +| 400 | 请求错误 | None | + +## Schemas + +### IndustryRankResponse + + + +| Name | Type | Required | Description | +| ---- | ---- | -------- | ----------- | +| items | array | 否 | 排行分组列表 | +| items[].lists | array | 否 | 行业条目列表 | +| items[].lists[].name | string | 否 | 行业名称 | +| items[].lists[].counter_id | string | 否 | 行业唯一标识(BK/市场/ID 格式),可传入 `industry_peers` | +| items[].lists[].chg | string | 否 | 当日涨跌幅(小数) | +| items[].lists[].leading_name | string | 否 | 涨幅领先个股名称 | +| items[].lists[].leading_ticker | string | 否 | 涨幅领先个股代码 | +| items[].lists[].leading_chg | string | 否 | 涨幅领先个股涨跌幅 | +| items[].lists[].value_name | string | 否 | 指标名称(按指标类型填充) | +| items[].lists[].value_data | string | 否 | 指标数值 | diff --git a/docs/zh-CN/docs/fundamental/fundamental/institution_rating_views.md b/docs/zh-CN/docs/fundamental/fundamental/institution_rating_views.md new file mode 100644 index 00000000..c27a0644 --- /dev/null +++ b/docs/zh-CN/docs/fundamental/fundamental/institution_rating_views.md @@ -0,0 +1,244 @@ +--- +slug: institution-rating-views +title: 机构评级分布时间线 +sidebar_position: 23 +language_tabs: false +toc_footers: [] +includes: [] +search: true +highlight_theme: '' +headingLevel: 2 +--- + +获取按月统计的机构评级(买入/持有/卖出)分布时间线,最新月份在前。 + + +longbridge institution-rating AAPL.US --views +longbridge institution-rating TSLA.US --views + + + + + +## Parameters + +> **SDK 方法参数。** + +| Name | Type | Required | Description | +| ---- | ---- | -------- | ----------- | +| symbol | string | 是 | 证券代码,例如 `AAPL.US` | + +## Request Example + + + + +```python +from longbridge.openapi import FundamentalContext, Config, OAuthBuilder + +oauth = OAuthBuilder("your-client-id").build(lambda url: print("Visit:", url)) +config = Config.from_oauth(oauth) +ctx = FundamentalContext(config) + +resp = ctx.institution_rating_views("AAPL.US") +print(resp) +``` + + + + +```python +import asyncio +from longbridge.openapi import AsyncFundamentalContext, Config, OAuthBuilder + +async def main() -> None: + oauth = await OAuthBuilder("your-client-id").build_async(lambda url: print("Visit:", url)) + config = Config.from_oauth(oauth) + ctx = AsyncFundamentalContext.create(config) + + resp = await ctx.institution_rating_views("AAPL.US") + print(resp) + +if __name__ == "__main__": + asyncio.run(main()) +``` + + + + +```javascript +const { Config, FundamentalContext, OAuth } = require('longbridge') + +async function main() { + const oauth = await OAuth.build('your-client-id', (_, url) => { + console.log('Open this URL to authorize: ' + url) + }) + const config = Config.fromOAuth(oauth) + const ctx = FundamentalContext.new(config) + const resp = await ctx.institutionRatingViews('AAPL.US') + console.log(resp) +} +main().catch(console.error) +``` + + + + +```java +import com.longbridge.*; +import com.longbridge.fundamental.*; + +class Main { + public static void main(String[] args) throws Exception { + try (OAuth oauth = new OAuthBuilder("your-client-id").build(url -> System.out.println("Open to authorize: " + url)).get(); + Config config = Config.fromOAuth(oauth); + FundamentalContext ctx = FundamentalContext.create(config)) { + var resp = ctx.getInstitutionRatingViews("AAPL.US").get(); + System.out.println(resp); + } + } +} +``` + + + + +```rust +use std::sync::Arc; +use longbridge::{oauth::OAuthBuilder, fundamental::FundamentalContext, Config}; + +#[tokio::main] +async fn main() -> Result<(), Box> { + let oauth = OAuthBuilder::new("your-client-id").build(|url| println!("Open: {url}")).await?; + let config = Arc::new(Config::from_oauth(oauth)); + let ctx = FundamentalContext::new(config); + let resp = ctx.institution_rating_views("AAPL.US").await?; + println!("{:?}", resp); + Ok(()) +} +``` + + + + +```cpp +#include +#include + +using namespace longbridge; +using namespace longbridge::fundamental; + +int main() { + OAuthBuilder("your-client-id").build( + [](const std::string& url) { std::cout << "Open: " << url << std::endl; }, + [](auto res) { + if (!res) return; + Config config = Config::from_oauth(*res); + FundamentalContext ctx = FundamentalContext::create(config); + ctx.institution_rating_views("AAPL.US", [](auto resp) { + if (resp) std::cout << "OK" << std::endl; + }); + }); + std::cin.get(); +} +``` + + + + +```go +package main + +import ( + "context" + "fmt" + "log" + + "github.com/longbridge/openapi-go/config" + "github.com/longbridge/openapi-go/oauth" + "github.com/longbridge/openapi-go/fundamental" +) + +func main() { + o := oauth.New("your-client-id"). + OnOpenURL(func(url string) { fmt.Println("Open this URL to authorize:", url) }) + if err := o.Build(context.Background()); err != nil { + log.Fatal(err) + } + conf, err := config.New(config.WithOAuthClient(o)) + if err != nil { + log.Fatal(err) + } + c, err := fundamental.NewFromCfg(conf) + if err != nil { + log.Fatal(err) + } + defer c.Close() + resp, err := c.InstitutionRatingViews(context.Background(), "AAPL.US") + if err != nil { + log.Fatal(err) + } + fmt.Printf("%+v\n", resp) +} +``` + + + + +## Response + + +### Response Example + +```json +{ + "code": 0, + "message": "success", + "data": { + "elist": [ + { + "date": 1746057600, + "buy": 18, + "over": 5, + "hold": 17, + "under": 3, + "sell": 4, + "total": 51 + }, + { + "date": 1743379200, + "buy": 17, + "over": 6, + "hold": 18, + "under": 3, + "sell": 5, + "total": 53 + } + ] + } +} +``` + +### Response Status + +| Status | Description | Schema | +| ------ | ----------- | ------ | +| 200 | 成功 | [InstitutionRatingViewsResponse](#InstitutionRatingViewsResponse) | +| 400 | 请求错误 | None | + +## Schemas + +### InstitutionRatingViewsResponse + + + +| Name | Type | Required | Description | +| ---- | ---- | -------- | ----------- | +| elist | array | 否 | 月度评级分布列表,最新月份在前 | +| elist[].date | int64 | 否 | Unix 时间戳(秒) | +| elist[].buy | integer | 否 | 买入评级数量 | +| elist[].over | integer | 否 | 跑赢市场评级数量 | +| elist[].hold | integer | 否 | 持有评级数量 | +| elist[].under | integer | 否 | 跑输市场评级数量 | +| elist[].sell | integer | 否 | 卖出评级数量 | +| elist[].total | integer | 否 | 机构总数 | diff --git a/docs/zh-HK/docs/fundamental/fundamental/business_segments.md b/docs/zh-HK/docs/fundamental/fundamental/business_segments.md new file mode 100644 index 00000000..a85f7e1e --- /dev/null +++ b/docs/zh-HK/docs/fundamental/fundamental/business_segments.md @@ -0,0 +1,232 @@ +--- +slug: business-segments +title: 業務分部(當前期) +sidebar_position: 21 +language_tabs: false +toc_footers: [] +includes: [] +search: true +highlight_theme: '' +headingLevel: 2 +--- + +獲取上市公司當前報告期的業務分部收入佔比。 + + +longbridge business-segments AAPL.US +longbridge business-segments 700.HK + + + + + +## Parameters + +> **SDK 方法參數。** + +| Name | Type | Required | Description | +| ---- | ---- | -------- | ----------- | +| symbol | string | 是 | 證券代碼,例如 `AAPL.US` | + +## Request Example + + + + +```python +from longbridge.openapi import FundamentalContext, Config, OAuthBuilder + +oauth = OAuthBuilder("your-client-id").build(lambda url: print("Visit:", url)) +config = Config.from_oauth(oauth) +ctx = FundamentalContext(config) + +resp = ctx.business_segments("AAPL.US") +print(resp) +``` + + + + +```python +import asyncio +from longbridge.openapi import AsyncFundamentalContext, Config, OAuthBuilder + +async def main() -> None: + oauth = await OAuthBuilder("your-client-id").build_async(lambda url: print("Visit:", url)) + config = Config.from_oauth(oauth) + ctx = AsyncFundamentalContext.create(config) + + resp = await ctx.business_segments("AAPL.US") + print(resp) + +if __name__ == "__main__": + asyncio.run(main()) +``` + + + + +```javascript +const { Config, FundamentalContext, OAuth } = require('longbridge') + +async function main() { + const oauth = await OAuth.build('your-client-id', (_, url) => { + console.log('Open this URL to authorize: ' + url) + }) + const config = Config.fromOAuth(oauth) + const ctx = FundamentalContext.new(config) + const resp = await ctx.businessSegments('AAPL.US') + console.log(resp) +} +main().catch(console.error) +``` + + + + +```java +import com.longbridge.*; +import com.longbridge.fundamental.*; + +class Main { + public static void main(String[] args) throws Exception { + try (OAuth oauth = new OAuthBuilder("your-client-id").build(url -> System.out.println("Open to authorize: " + url)).get(); + Config config = Config.fromOAuth(oauth); + FundamentalContext ctx = FundamentalContext.create(config)) { + var resp = ctx.getBusinessSegments("AAPL.US").get(); + System.out.println(resp); + } + } +} +``` + + + + +```rust +use std::sync::Arc; +use longbridge::{oauth::OAuthBuilder, fundamental::FundamentalContext, Config}; + +#[tokio::main] +async fn main() -> Result<(), Box> { + let oauth = OAuthBuilder::new("your-client-id").build(|url| println!("Open: {url}")).await?; + let config = Arc::new(Config::from_oauth(oauth)); + let ctx = FundamentalContext::new(config); + let resp = ctx.business_segments("AAPL.US").await?; + println!("{:?}", resp); + Ok(()) +} +``` + + + + +```cpp +#include +#include + +using namespace longbridge; +using namespace longbridge::fundamental; + +int main() { + OAuthBuilder("your-client-id").build( + [](const std::string& url) { std::cout << "Open: " << url << std::endl; }, + [](auto res) { + if (!res) return; + Config config = Config::from_oauth(*res); + FundamentalContext ctx = FundamentalContext::create(config); + ctx.business_segments("AAPL.US", [](auto resp) { + if (resp) std::cout << "OK" << std::endl; + }); + }); + std::cin.get(); +} +``` + + + + +```go +package main + +import ( + "context" + "fmt" + "log" + + "github.com/longbridge/openapi-go/config" + "github.com/longbridge/openapi-go/oauth" + "github.com/longbridge/openapi-go/fundamental" +) + +func main() { + o := oauth.New("your-client-id"). + OnOpenURL(func(url string) { fmt.Println("Open this URL to authorize:", url) }) + if err := o.Build(context.Background()); err != nil { + log.Fatal(err) + } + conf, err := config.New(config.WithOAuthClient(o)) + if err != nil { + log.Fatal(err) + } + c, err := fundamental.NewFromCfg(conf) + if err != nil { + log.Fatal(err) + } + defer c.Close() + resp, err := c.BusinessSegments(context.Background(), "AAPL.US") + if err != nil { + log.Fatal(err) + } + fmt.Printf("%+v\n", resp) +} +``` + + + + +## Response + + +### Response Example + +```json +{ + "code": 0, + "message": "success", + "data": { + "date": "2024Q4", + "total": "124300000000", + "currency": "USD", + "business": [ + {"name": "iPhone", "percent": "0.5619"}, + {"name": "Services", "percent": "0.2196"}, + {"name": "Mac", "percent": "0.0804"}, + {"name": "iPad", "percent": "0.0700"}, + {"name": "Wearables", "percent": "0.0681"} + ] + } +} +``` + +### Response Status + +| Status | Description | Schema | +| ------ | ----------- | ------ | +| 200 | 成功 | [BusinessSegmentsResponse](#BusinessSegmentsResponse) | +| 400 | 請求錯誤 | None | + +## Schemas + +### BusinessSegmentsResponse + + + +| Name | Type | Required | Description | +| ---- | ---- | -------- | ----------- | +| date | string | 否 | 報告期標籤,例如 `2024Q4` | +| total | string | 否 | 當期總收入(字串數值) | +| currency | string | 否 | 貨幣代碼,例如 `USD` | +| business | array | 否 | 業務分部列表 | +| business[].name | string | 否 | 業務分部名稱 | +| business[].percent | string | 否 | 收入佔比(0–1 小數) | diff --git a/docs/zh-HK/docs/fundamental/fundamental/business_segments_history.md b/docs/zh-HK/docs/fundamental/fundamental/business_segments_history.md new file mode 100644 index 00000000..84c5fc51 --- /dev/null +++ b/docs/zh-HK/docs/fundamental/fundamental/business_segments_history.md @@ -0,0 +1,245 @@ +--- +slug: business-segments-history +title: 業務分部(歷史趨勢) +sidebar_position: 22 +language_tabs: false +toc_footers: [] +includes: [] +search: true +highlight_theme: '' +headingLevel: 2 +--- + +獲取上市公司按報告期的歷史業務分部收入趨勢。 + + +longbridge business-segments AAPL.US --history +longbridge business-segments AAPL.US --history --report qf + + + + + +## Parameters + +> **SDK 方法參數。** + +| Name | Type | Required | Description | +| ---- | ---- | -------- | ----------- | +| symbol | string | 是 | 證券代碼,例如 `AAPL.US` | +| report | string | 否 | 報告類型:`qf`(季報)/ `saf`(半年報)/ `af`(年報) | +| cate | string | 否 | 分部類別過濾 | + +## Request Example + + + + +```python +from longbridge.openapi import FundamentalContext, Config, OAuthBuilder + +oauth = OAuthBuilder("your-client-id").build(lambda url: print("Visit:", url)) +config = Config.from_oauth(oauth) +ctx = FundamentalContext(config) + +resp = ctx.business_segments_history("AAPL.US", report="qf") +print(resp) +``` + + + + +```python +import asyncio +from longbridge.openapi import AsyncFundamentalContext, Config, OAuthBuilder + +async def main() -> None: + oauth = await OAuthBuilder("your-client-id").build_async(lambda url: print("Visit:", url)) + config = Config.from_oauth(oauth) + ctx = AsyncFundamentalContext.create(config) + + resp = await ctx.business_segments_history("AAPL.US", report="qf") + print(resp) + +if __name__ == "__main__": + asyncio.run(main()) +``` + + + + +```javascript +const { Config, FundamentalContext, OAuth } = require('longbridge') + +async function main() { + const oauth = await OAuth.build('your-client-id', (_, url) => { + console.log('Open this URL to authorize: ' + url) + }) + const config = Config.fromOAuth(oauth) + const ctx = FundamentalContext.new(config) + const resp = await ctx.businessSegmentsHistory('AAPL.US', { report: 'qf' }) + console.log(resp) +} +main().catch(console.error) +``` + + + + +```java +import com.longbridge.*; +import com.longbridge.fundamental.*; + +class Main { + public static void main(String[] args) throws Exception { + try (OAuth oauth = new OAuthBuilder("your-client-id").build(url -> System.out.println("Open to authorize: " + url)).get(); + Config config = Config.fromOAuth(oauth); + FundamentalContext ctx = FundamentalContext.create(config)) { + var resp = ctx.getBusinessSegmentsHistory("AAPL.US", "qf", null).get(); + System.out.println(resp); + } + } +} +``` + + + + +```rust +use std::sync::Arc; +use longbridge::{oauth::OAuthBuilder, fundamental::FundamentalContext, Config}; + +#[tokio::main] +async fn main() -> Result<(), Box> { + let oauth = OAuthBuilder::new("your-client-id").build(|url| println!("Open: {url}")).await?; + let config = Arc::new(Config::from_oauth(oauth)); + let ctx = FundamentalContext::new(config); + let resp = ctx.business_segments_history("AAPL.US", Some("qf"), None).await?; + println!("{:?}", resp); + Ok(()) +} +``` + + + + +```cpp +#include +#include + +using namespace longbridge; +using namespace longbridge::fundamental; + +int main() { + OAuthBuilder("your-client-id").build( + [](const std::string& url) { std::cout << "Open: " << url << std::endl; }, + [](auto res) { + if (!res) return; + Config config = Config::from_oauth(*res); + FundamentalContext ctx = FundamentalContext::create(config); + ctx.business_segments_history("AAPL.US", "qf", "", [](auto resp) { + if (resp) std::cout << "OK" << std::endl; + }); + }); + std::cin.get(); +} +``` + + + + +```go +package main + +import ( + "context" + "fmt" + "log" + + "github.com/longbridge/openapi-go/config" + "github.com/longbridge/openapi-go/oauth" + "github.com/longbridge/openapi-go/fundamental" +) + +func main() { + o := oauth.New("your-client-id"). + OnOpenURL(func(url string) { fmt.Println("Open this URL to authorize:", url) }) + if err := o.Build(context.Background()); err != nil { + log.Fatal(err) + } + conf, err := config.New(config.WithOAuthClient(o)) + if err != nil { + log.Fatal(err) + } + c, err := fundamental.NewFromCfg(conf) + if err != nil { + log.Fatal(err) + } + defer c.Close() + resp, err := c.BusinessSegmentsHistory(context.Background(), "AAPL.US", "qf", "") + if err != nil { + log.Fatal(err) + } + fmt.Printf("%+v\n", resp) +} +``` + + + + +## Response + + +### Response Example + +```json +{ + "code": 0, + "message": "success", + "data": { + "historical": [ + { + "date": "2024Q4", + "total": "124300000000", + "currency": "USD", + "business": [ + {"name": "iPhone", "percent": "0.5619", "value": "69900000000"}, + {"name": "Services", "percent": "0.2196", "value": "26300000000"} + ], + "regionals": [ + {"name": "Americas", "percent": "0.4280", "value": "53200000000"}, + {"name": "Europe", "percent": "0.2520", "value": "30100000000"} + ] + } + ] + } +} +``` + +### Response Status + +| Status | Description | Schema | +| ------ | ----------- | ------ | +| 200 | 成功 | [BusinessSegmentsHistoryResponse](#BusinessSegmentsHistoryResponse) | +| 400 | 請求錯誤 | None | + +## Schemas + +### BusinessSegmentsHistoryResponse + + + +| Name | Type | Required | Description | +| ---- | ---- | -------- | ----------- | +| historical | array | 否 | 歷史報告期列表 | +| historical[].date | string | 否 | 報告期標籤,例如 `2024Q4` | +| historical[].total | string | 否 | 當期總收入(字串數值) | +| historical[].currency | string | 否 | 貨幣代碼 | +| historical[].business | array | 否 | 業務分部列表 | +| historical[].business[].name | string | 否 | 業務分部名稱 | +| historical[].business[].percent | string | 否 | 收入佔比(0–1 小數) | +| historical[].business[].value | string | 否 | 絕對收入數值 | +| historical[].regionals | array | 否 | 地區分部列表 | +| historical[].regionals[].name | string | 否 | 地區名稱 | +| historical[].regionals[].percent | string | 否 | 收入佔比(0–1 小數) | +| historical[].regionals[].value | string | 否 | 絕對收入數值 | diff --git a/docs/zh-HK/docs/fundamental/fundamental/financial_report_snapshot.md b/docs/zh-HK/docs/fundamental/fundamental/financial_report_snapshot.md new file mode 100644 index 00000000..bf9e7bcd --- /dev/null +++ b/docs/zh-HK/docs/fundamental/fundamental/financial_report_snapshot.md @@ -0,0 +1,261 @@ +--- +slug: financial-report-snapshot +title: 財報快照(AI 摘要 + 預測對比) +sidebar_position: 26 +language_tabs: false +toc_footers: [] +includes: [] +search: true +highlight_theme: '' +headingLevel: 2 +--- + +獲取 AI 生成的財報摘要、營收/EBIT/EPS 預測對比(超預期/低於預期),以及關鍵財務指標。 + + +longbridge financial-report snapshot AAPL.US +longbridge financial-report snapshot AAPL.US --report qf --year 2024 --period 4 + + + + + +## Parameters + +> **SDK 方法參數。** + +| Name | Type | Required | Description | +| ---- | ---- | -------- | ----------- | +| symbol | string | 是 | 證券代碼,例如 `AAPL.US` | +| report | string | 否 | 報告類型:`qf`(季報)/ `saf`(半年報)/ `af`(年報) | +| fiscal_year | uint32 | 否 | 財政年度,例如 `2024` | +| fiscal_period | string | 否 | 財政季度,例如 `1` / `2` / `3` / `4` | + +## Request Example + + + + +```python +from longbridge.openapi import FundamentalContext, Config, OAuthBuilder + +oauth = OAuthBuilder("your-client-id").build(lambda url: print("Visit:", url)) +config = Config.from_oauth(oauth) +ctx = FundamentalContext(config) + +resp = ctx.financial_report_snapshot("AAPL.US", report="qf", fiscal_year=2024, fiscal_period="4") +print(resp) +``` + + + + +```python +import asyncio +from longbridge.openapi import AsyncFundamentalContext, Config, OAuthBuilder + +async def main() -> None: + oauth = await OAuthBuilder("your-client-id").build_async(lambda url: print("Visit:", url)) + config = Config.from_oauth(oauth) + ctx = AsyncFundamentalContext.create(config) + + resp = await ctx.financial_report_snapshot("AAPL.US", report="qf", fiscal_year=2024, fiscal_period="4") + print(resp) + +if __name__ == "__main__": + asyncio.run(main()) +``` + + + + +```javascript +const { Config, FundamentalContext, OAuth } = require('longbridge') + +async function main() { + const oauth = await OAuth.build('your-client-id', (_, url) => { + console.log('Open this URL to authorize: ' + url) + }) + const config = Config.fromOAuth(oauth) + const ctx = FundamentalContext.new(config) + const resp = await ctx.financialReportSnapshot('AAPL.US', { report: 'qf', fiscalYear: 2024, fiscalPeriod: '4' }) + console.log(resp) +} +main().catch(console.error) +``` + + + + +```java +import com.longbridge.*; +import com.longbridge.fundamental.*; + +class Main { + public static void main(String[] args) throws Exception { + try (OAuth oauth = new OAuthBuilder("your-client-id").build(url -> System.out.println("Open to authorize: " + url)).get(); + Config config = Config.fromOAuth(oauth); + FundamentalContext ctx = FundamentalContext.create(config)) { + var resp = ctx.getFinancialReportSnapshot("AAPL.US", "qf", 2024, "4").get(); + System.out.println(resp); + } + } +} +``` + + + + +```rust +use std::sync::Arc; +use longbridge::{oauth::OAuthBuilder, fundamental::FundamentalContext, Config}; + +#[tokio::main] +async fn main() -> Result<(), Box> { + let oauth = OAuthBuilder::new("your-client-id").build(|url| println!("Open: {url}")).await?; + let config = Arc::new(Config::from_oauth(oauth)); + let ctx = FundamentalContext::new(config); + let resp = ctx.financial_report_snapshot("AAPL.US", Some("qf"), Some(2024), Some("4")).await?; + println!("{:?}", resp); + Ok(()) +} +``` + + + + +```cpp +#include +#include + +using namespace longbridge; +using namespace longbridge::fundamental; + +int main() { + OAuthBuilder("your-client-id").build( + [](const std::string& url) { std::cout << "Open: " << url << std::endl; }, + [](auto res) { + if (!res) return; + Config config = Config::from_oauth(*res); + FundamentalContext ctx = FundamentalContext::create(config); + ctx.financial_report_snapshot("AAPL.US", "qf", 2024, "4", [](auto resp) { + if (resp) std::cout << "OK" << std::endl; + }); + }); + std::cin.get(); +} +``` + + + + +```go +package main + +import ( + "context" + "fmt" + "log" + + "github.com/longbridge/openapi-go/config" + "github.com/longbridge/openapi-go/oauth" + "github.com/longbridge/openapi-go/fundamental" +) + +func main() { + o := oauth.New("your-client-id"). + OnOpenURL(func(url string) { fmt.Println("Open this URL to authorize:", url) }) + if err := o.Build(context.Background()); err != nil { + log.Fatal(err) + } + conf, err := config.New(config.WithOAuthClient(o)) + if err != nil { + log.Fatal(err) + } + c, err := fundamental.NewFromCfg(conf) + if err != nil { + log.Fatal(err) + } + defer c.Close() + resp, err := c.FinancialReportSnapshot(context.Background(), "AAPL.US", "qf", 2024, "4") + if err != nil { + log.Fatal(err) + } + fmt.Printf("%+v\n", resp) +} +``` + + + + +## Response + + +### Response Example + +```json +{ + "code": 0, + "message": "success", + "data": { + "name": "Apple Inc.", + "ticker": "AAPL.US", + "fp_start": "2024-10-01", + "fp_end": "2024-12-31", + "currency": "USD", + "report_desc": "Apple delivered record revenue of $124.3B in Q1 FY2025...", + "fo_revenue": {"value": "124300000000", "yoy": "0.0407", "cmp_desc": "beat by 1.2%", "est_value": "123800000000"}, + "fo_ebit": {"value": "42800000000", "yoy": "0.0520", "cmp_desc": "beat by 0.8%", "est_value": "42500000000"}, + "fo_eps": {"value": "2.40", "yoy": "0.0870", "cmp_desc": "beat by 2.1%", "est_value": "2.35"}, + "fr_revenue": {"value": "124300000000", "yoy": "0.0407"}, + "fr_profit": {"value": "36330000000", "yoy": "0.0710"}, + "fr_roe_ttm": "0.1570", + "fr_profit_margin": "0.2923", + "fr_debt_assets_ratio": "0.8120" + } +} +``` + +### Response Status + +| Status | Description | Schema | +| ------ | ----------- | ------ | +| 200 | 成功 | [FinancialReportSnapshotResponse](#FinancialReportSnapshotResponse) | +| 400 | 請求錯誤 | None | + +## Schemas + +### FinancialReportSnapshotResponse + + + +| Name | Type | Required | Description | +| ---- | ---- | -------- | ----------- | +| name | string | 否 | 公司名稱 | +| ticker | string | 否 | 證券代碼 | +| fp_start | string | 否 | 財政期開始日期 | +| fp_end | string | 否 | 財政期結束日期 | +| currency | string | 否 | 貨幣代碼 | +| report_desc | string | 否 | AI 生成的財報摘要文字 | +| fo_revenue | object | 否 | 營收預測對比 | +| fo_revenue.value | string | 否 | 實際營收 | +| fo_revenue.yoy | string | 否 | 同比增速(小數) | +| fo_revenue.cmp_desc | string | 否 | 超預期/低於預期描述 | +| fo_revenue.est_value | string | 否 | 一致預期值 | +| fo_ebit | object | 否 | EBIT 預測對比(欄位同 fo_revenue) | +| fo_eps | object | 否 | EPS 預測對比(欄位同 fo_revenue) | +| fr_revenue | object | 否 | 營收財務數據 | +| fr_revenue.value | string | 否 | 營收數值 | +| fr_revenue.yoy | string | 否 | 同比增速 | +| fr_profit | object | 否 | 淨利潤財務數據(欄位同 fr_revenue) | +| fr_operate_cash | object | 否 | 經營現金流(欄位同 fr_revenue) | +| fr_invest_cash | object | 否 | 投資現金流(欄位同 fr_revenue) | +| fr_finance_cash | object | 否 | 融資現金流(欄位同 fr_revenue) | +| fr_total_assets | object | 否 | 總資產(欄位同 fr_revenue) | +| fr_total_liability | object | 否 | 總負債(欄位同 fr_revenue) | +| fr_roe_ttm | string | 否 | 淨資產收益率 TTM(小數) | +| fr_profit_margin | string | 否 | 淨利率(小數) | +| fr_profit_margin_ttm | string | 否 | 淨利率 TTM(小數) | +| fr_asset_turn_ttm | string | 否 | 資產週轉率 TTM(小數) | +| fr_leverage_ttm | string | 否 | 槓桿率 TTM(小數) | +| fr_debt_assets_ratio | string | 否 | 資產負債率(小數) | diff --git a/docs/zh-HK/docs/fundamental/fundamental/industry_peers.md b/docs/zh-HK/docs/fundamental/fundamental/industry_peers.md new file mode 100644 index 00000000..99917c59 --- /dev/null +++ b/docs/zh-HK/docs/fundamental/fundamental/industry_peers.md @@ -0,0 +1,245 @@ +--- +slug: industry-peers +title: 行業子板塊層級樹 +sidebar_position: 25 +language_tabs: false +toc_footers: [] +includes: [] +search: true +highlight_theme: '' +headingLevel: 2 +--- + +獲取行業分組的層級子板塊樹,含各節點股票數量、日漲跌幅和年初至今漲跌幅。Counter ID 可從 `industry_rank` 返回結果中獲取。 + + +longbridge industry-peers BK/US/IN00258 +longbridge industry-peers BK/HK/IN20337 + + + + + +## Parameters + +> **SDK 方法參數。** + +| Name | Type | Required | Description | +| ---- | ---- | -------- | ----------- | +| counter_id | string | 是 | 行業唯一標識(BK/市場/ID 格式),來源於 `industry_rank` | +| market | string | 是 | 市場代碼:`US` / `HK` / `CN` / `SG` | + +## Request Example + + + + +```python +from longbridge.openapi import FundamentalContext, Config, OAuthBuilder + +oauth = OAuthBuilder("your-client-id").build(lambda url: print("Visit:", url)) +config = Config.from_oauth(oauth) +ctx = FundamentalContext(config) + +resp = ctx.industry_peers("BK/US/IN00258", "US") +print(resp) +``` + + + + +```python +import asyncio +from longbridge.openapi import AsyncFundamentalContext, Config, OAuthBuilder + +async def main() -> None: + oauth = await OAuthBuilder("your-client-id").build_async(lambda url: print("Visit:", url)) + config = Config.from_oauth(oauth) + ctx = AsyncFundamentalContext.create(config) + + resp = await ctx.industry_peers("BK/US/IN00258", "US") + print(resp) + +if __name__ == "__main__": + asyncio.run(main()) +``` + + + + +```javascript +const { Config, FundamentalContext, OAuth } = require('longbridge') + +async function main() { + const oauth = await OAuth.build('your-client-id', (_, url) => { + console.log('Open this URL to authorize: ' + url) + }) + const config = Config.fromOAuth(oauth) + const ctx = FundamentalContext.new(config) + const resp = await ctx.industryPeers('BK/US/IN00258', 'US') + console.log(resp) +} +main().catch(console.error) +``` + + + + +```java +import com.longbridge.*; +import com.longbridge.fundamental.*; + +class Main { + public static void main(String[] args) throws Exception { + try (OAuth oauth = new OAuthBuilder("your-client-id").build(url -> System.out.println("Open to authorize: " + url)).get(); + Config config = Config.fromOAuth(oauth); + FundamentalContext ctx = FundamentalContext.create(config)) { + var resp = ctx.getIndustryPeers("BK/US/IN00258", "US").get(); + System.out.println(resp); + } + } +} +``` + + + + +```rust +use std::sync::Arc; +use longbridge::{oauth::OAuthBuilder, fundamental::FundamentalContext, Config}; + +#[tokio::main] +async fn main() -> Result<(), Box> { + let oauth = OAuthBuilder::new("your-client-id").build(|url| println!("Open: {url}")).await?; + let config = Arc::new(Config::from_oauth(oauth)); + let ctx = FundamentalContext::new(config); + let resp = ctx.industry_peers("BK/US/IN00258", "US").await?; + println!("{:?}", resp); + Ok(()) +} +``` + + + + +```cpp +#include +#include + +using namespace longbridge; +using namespace longbridge::fundamental; + +int main() { + OAuthBuilder("your-client-id").build( + [](const std::string& url) { std::cout << "Open: " << url << std::endl; }, + [](auto res) { + if (!res) return; + Config config = Config::from_oauth(*res); + FundamentalContext ctx = FundamentalContext::create(config); + ctx.industry_peers("BK/US/IN00258", "US", [](auto resp) { + if (resp) std::cout << "OK" << std::endl; + }); + }); + std::cin.get(); +} +``` + + + + +```go +package main + +import ( + "context" + "fmt" + "log" + + "github.com/longbridge/openapi-go/config" + "github.com/longbridge/openapi-go/oauth" + "github.com/longbridge/openapi-go/fundamental" +) + +func main() { + o := oauth.New("your-client-id"). + OnOpenURL(func(url string) { fmt.Println("Open this URL to authorize:", url) }) + if err := o.Build(context.Background()); err != nil { + log.Fatal(err) + } + conf, err := config.New(config.WithOAuthClient(o)) + if err != nil { + log.Fatal(err) + } + c, err := fundamental.NewFromCfg(conf) + if err != nil { + log.Fatal(err) + } + defer c.Close() + resp, err := c.IndustryPeers(context.Background(), "BK/US/IN00258", "US") + if err != nil { + log.Fatal(err) + } + fmt.Printf("%+v\n", resp) +} +``` + + + + +## Response + + +### Response Example + +```json +{ + "code": 0, + "message": "success", + "data": { + "top": {"name": "All Industries", "market": "US"}, + "chain": { + "name": "Technology", + "counter_id": "BK/US/IN00258", + "stock_num": 542, + "chg": "0.0231", + "ytd_chg": "0.0875", + "next": [ + { + "name": "Semiconductors", + "counter_id": "BK/US/IN00297", + "stock_num": 87, + "chg": "0.0512", + "ytd_chg": "0.1243", + "next": [] + } + ] + } + } +} +``` + +### Response Status + +| Status | Description | Schema | +| ------ | ----------- | ------ | +| 200 | 成功 | [IndustryPeersResponse](#IndustryPeersResponse) | +| 400 | 請求錯誤 | None | + +## Schemas + +### IndustryPeersResponse + + + +| Name | Type | Required | Description | +| ---- | ---- | -------- | ----------- | +| top | object | 否 | 頂層行業資訊 | +| top.name | string | 否 | 頂層行業名稱 | +| top.market | string | 否 | 市場代碼 | +| chain | object | 否 | 行業層級樹根節點 | +| chain.name | string | 否 | 板塊名稱 | +| chain.counter_id | string | 否 | 板塊唯一標識 | +| chain.stock_num | integer | 否 | 板塊內股票數量 | +| chain.chg | string | 否 | 當日漲跌幅(小數) | +| chain.ytd_chg | string | 否 | 年初至今漲跌幅(小數) | +| chain.next | array | 否 | 子板塊列表(結構與 chain 相同,遞迴) | diff --git a/docs/zh-HK/docs/fundamental/fundamental/industry_rank.md b/docs/zh-HK/docs/fundamental/fundamental/industry_rank.md new file mode 100644 index 00000000..d16eba30 --- /dev/null +++ b/docs/zh-HK/docs/fundamental/fundamental/industry_rank.md @@ -0,0 +1,245 @@ +--- +slug: industry-rank +title: 行業排行榜 +sidebar_position: 24 +language_tabs: false +toc_footers: [] +includes: [] +search: true +highlight_theme: '' +headingLevel: 2 +--- + +按市場和指標獲取行業排行榜。返回的 Counter ID 可直接傳入 `industry_peers` 查詢子行業樹。 + + +longbridge industry-rank --market US +longbridge industry-rank --market HK --indicator market-cap + + + + + +## Parameters + +> **SDK 方法參數。** + +| Name | Type | Required | Description | +| ---- | ---- | -------- | ----------- | +| market | string | 是 | 市場代碼:`US` / `HK` / `CN` / `SG` | +| indicator | string | 是 | 排行指標:`leading-gainer` / `today-trend` / `popularity` / `market-cap` / `revenue` / `revenue-growth` / `net-profit` / `net-profit-growth` | +| sort_type | string | 是 | 排序方式:`single`(單一排序)/ `multi`(多維排序) | +| limit | uint32 | 是 | 返回條數,預設 20 | + +## Request Example + + + + +```python +from longbridge.openapi import FundamentalContext, Config, OAuthBuilder + +oauth = OAuthBuilder("your-client-id").build(lambda url: print("Visit:", url)) +config = Config.from_oauth(oauth) +ctx = FundamentalContext(config) + +resp = ctx.industry_rank("US", "leading-gainer", "single", 20) +print(resp) +``` + + + + +```python +import asyncio +from longbridge.openapi import AsyncFundamentalContext, Config, OAuthBuilder + +async def main() -> None: + oauth = await OAuthBuilder("your-client-id").build_async(lambda url: print("Visit:", url)) + config = Config.from_oauth(oauth) + ctx = AsyncFundamentalContext.create(config) + + resp = await ctx.industry_rank("US", "leading-gainer", "single", 20) + print(resp) + +if __name__ == "__main__": + asyncio.run(main()) +``` + + + + +```javascript +const { Config, FundamentalContext, OAuth } = require('longbridge') + +async function main() { + const oauth = await OAuth.build('your-client-id', (_, url) => { + console.log('Open this URL to authorize: ' + url) + }) + const config = Config.fromOAuth(oauth) + const ctx = FundamentalContext.new(config) + const resp = await ctx.industryRank('US', 'leading-gainer', 'single', 20) + console.log(resp) +} +main().catch(console.error) +``` + + + + +```java +import com.longbridge.*; +import com.longbridge.fundamental.*; + +class Main { + public static void main(String[] args) throws Exception { + try (OAuth oauth = new OAuthBuilder("your-client-id").build(url -> System.out.println("Open to authorize: " + url)).get(); + Config config = Config.fromOAuth(oauth); + FundamentalContext ctx = FundamentalContext.create(config)) { + var resp = ctx.getIndustryRank("US", "leading-gainer", "single", 20).get(); + System.out.println(resp); + } + } +} +``` + + + + +```rust +use std::sync::Arc; +use longbridge::{oauth::OAuthBuilder, fundamental::FundamentalContext, Config}; + +#[tokio::main] +async fn main() -> Result<(), Box> { + let oauth = OAuthBuilder::new("your-client-id").build(|url| println!("Open: {url}")).await?; + let config = Arc::new(Config::from_oauth(oauth)); + let ctx = FundamentalContext::new(config); + let resp = ctx.industry_rank("US", "leading-gainer", "single", 20).await?; + println!("{:?}", resp); + Ok(()) +} +``` + + + + +```cpp +#include +#include + +using namespace longbridge; +using namespace longbridge::fundamental; + +int main() { + OAuthBuilder("your-client-id").build( + [](const std::string& url) { std::cout << "Open: " << url << std::endl; }, + [](auto res) { + if (!res) return; + Config config = Config::from_oauth(*res); + FundamentalContext ctx = FundamentalContext::create(config); + ctx.industry_rank("US", "leading-gainer", "single", 20, [](auto resp) { + if (resp) std::cout << "OK" << std::endl; + }); + }); + std::cin.get(); +} +``` + + + + +```go +package main + +import ( + "context" + "fmt" + "log" + + "github.com/longbridge/openapi-go/config" + "github.com/longbridge/openapi-go/oauth" + "github.com/longbridge/openapi-go/fundamental" +) + +func main() { + o := oauth.New("your-client-id"). + OnOpenURL(func(url string) { fmt.Println("Open this URL to authorize:", url) }) + if err := o.Build(context.Background()); err != nil { + log.Fatal(err) + } + conf, err := config.New(config.WithOAuthClient(o)) + if err != nil { + log.Fatal(err) + } + c, err := fundamental.NewFromCfg(conf) + if err != nil { + log.Fatal(err) + } + defer c.Close() + resp, err := c.IndustryRank(context.Background(), "US", "leading-gainer", "single", 20) + if err != nil { + log.Fatal(err) + } + fmt.Printf("%+v\n", resp) +} +``` + + + + +## Response + + +### Response Example + +```json +{ + "code": 0, + "message": "success", + "data": { + "items": [ + { + "lists": [ + { + "name": "Technology", + "counter_id": "BK/US/IN00258", + "chg": "0.0231", + "leading_name": "NVIDIA", + "leading_ticker": "NVDA.US", + "leading_chg": "0.0512", + "value_name": "", + "value_data": "" + } + ] + } + ] + } +} +``` + +### Response Status + +| Status | Description | Schema | +| ------ | ----------- | ------ | +| 200 | 成功 | [IndustryRankResponse](#IndustryRankResponse) | +| 400 | 請求錯誤 | None | + +## Schemas + +### IndustryRankResponse + + + +| Name | Type | Required | Description | +| ---- | ---- | -------- | ----------- | +| items | array | 否 | 排行分組列表 | +| items[].lists | array | 否 | 行業條目列表 | +| items[].lists[].name | string | 否 | 行業名稱 | +| items[].lists[].counter_id | string | 否 | 行業唯一標識(BK/市場/ID 格式),可傳入 `industry_peers` | +| items[].lists[].chg | string | 否 | 當日漲跌幅(小數) | +| items[].lists[].leading_name | string | 否 | 漲幅領先個股名稱 | +| items[].lists[].leading_ticker | string | 否 | 漲幅領先個股代碼 | +| items[].lists[].leading_chg | string | 否 | 漲幅領先個股漲跌幅 | +| items[].lists[].value_name | string | 否 | 指標名稱(按指標類型填充) | +| items[].lists[].value_data | string | 否 | 指標數值 | diff --git a/docs/zh-HK/docs/fundamental/fundamental/institution_rating_views.md b/docs/zh-HK/docs/fundamental/fundamental/institution_rating_views.md new file mode 100644 index 00000000..1022d0ae --- /dev/null +++ b/docs/zh-HK/docs/fundamental/fundamental/institution_rating_views.md @@ -0,0 +1,244 @@ +--- +slug: institution-rating-views +title: 機構評級分佈時間線 +sidebar_position: 23 +language_tabs: false +toc_footers: [] +includes: [] +search: true +highlight_theme: '' +headingLevel: 2 +--- + +獲取按月統計的機構評級(買入/持有/賣出)分佈時間線,最新月份在前。 + + +longbridge institution-rating AAPL.US --views +longbridge institution-rating TSLA.US --views + + + + + +## Parameters + +> **SDK 方法參數。** + +| Name | Type | Required | Description | +| ---- | ---- | -------- | ----------- | +| symbol | string | 是 | 證券代碼,例如 `AAPL.US` | + +## Request Example + + + + +```python +from longbridge.openapi import FundamentalContext, Config, OAuthBuilder + +oauth = OAuthBuilder("your-client-id").build(lambda url: print("Visit:", url)) +config = Config.from_oauth(oauth) +ctx = FundamentalContext(config) + +resp = ctx.institution_rating_views("AAPL.US") +print(resp) +``` + + + + +```python +import asyncio +from longbridge.openapi import AsyncFundamentalContext, Config, OAuthBuilder + +async def main() -> None: + oauth = await OAuthBuilder("your-client-id").build_async(lambda url: print("Visit:", url)) + config = Config.from_oauth(oauth) + ctx = AsyncFundamentalContext.create(config) + + resp = await ctx.institution_rating_views("AAPL.US") + print(resp) + +if __name__ == "__main__": + asyncio.run(main()) +``` + + + + +```javascript +const { Config, FundamentalContext, OAuth } = require('longbridge') + +async function main() { + const oauth = await OAuth.build('your-client-id', (_, url) => { + console.log('Open this URL to authorize: ' + url) + }) + const config = Config.fromOAuth(oauth) + const ctx = FundamentalContext.new(config) + const resp = await ctx.institutionRatingViews('AAPL.US') + console.log(resp) +} +main().catch(console.error) +``` + + + + +```java +import com.longbridge.*; +import com.longbridge.fundamental.*; + +class Main { + public static void main(String[] args) throws Exception { + try (OAuth oauth = new OAuthBuilder("your-client-id").build(url -> System.out.println("Open to authorize: " + url)).get(); + Config config = Config.fromOAuth(oauth); + FundamentalContext ctx = FundamentalContext.create(config)) { + var resp = ctx.getInstitutionRatingViews("AAPL.US").get(); + System.out.println(resp); + } + } +} +``` + + + + +```rust +use std::sync::Arc; +use longbridge::{oauth::OAuthBuilder, fundamental::FundamentalContext, Config}; + +#[tokio::main] +async fn main() -> Result<(), Box> { + let oauth = OAuthBuilder::new("your-client-id").build(|url| println!("Open: {url}")).await?; + let config = Arc::new(Config::from_oauth(oauth)); + let ctx = FundamentalContext::new(config); + let resp = ctx.institution_rating_views("AAPL.US").await?; + println!("{:?}", resp); + Ok(()) +} +``` + + + + +```cpp +#include +#include + +using namespace longbridge; +using namespace longbridge::fundamental; + +int main() { + OAuthBuilder("your-client-id").build( + [](const std::string& url) { std::cout << "Open: " << url << std::endl; }, + [](auto res) { + if (!res) return; + Config config = Config::from_oauth(*res); + FundamentalContext ctx = FundamentalContext::create(config); + ctx.institution_rating_views("AAPL.US", [](auto resp) { + if (resp) std::cout << "OK" << std::endl; + }); + }); + std::cin.get(); +} +``` + + + + +```go +package main + +import ( + "context" + "fmt" + "log" + + "github.com/longbridge/openapi-go/config" + "github.com/longbridge/openapi-go/oauth" + "github.com/longbridge/openapi-go/fundamental" +) + +func main() { + o := oauth.New("your-client-id"). + OnOpenURL(func(url string) { fmt.Println("Open this URL to authorize:", url) }) + if err := o.Build(context.Background()); err != nil { + log.Fatal(err) + } + conf, err := config.New(config.WithOAuthClient(o)) + if err != nil { + log.Fatal(err) + } + c, err := fundamental.NewFromCfg(conf) + if err != nil { + log.Fatal(err) + } + defer c.Close() + resp, err := c.InstitutionRatingViews(context.Background(), "AAPL.US") + if err != nil { + log.Fatal(err) + } + fmt.Printf("%+v\n", resp) +} +``` + + + + +## Response + + +### Response Example + +```json +{ + "code": 0, + "message": "success", + "data": { + "elist": [ + { + "date": 1746057600, + "buy": 18, + "over": 5, + "hold": 17, + "under": 3, + "sell": 4, + "total": 51 + }, + { + "date": 1743379200, + "buy": 17, + "over": 6, + "hold": 18, + "under": 3, + "sell": 5, + "total": 53 + } + ] + } +} +``` + +### Response Status + +| Status | Description | Schema | +| ------ | ----------- | ------ | +| 200 | 成功 | [InstitutionRatingViewsResponse](#InstitutionRatingViewsResponse) | +| 400 | 請求錯誤 | None | + +## Schemas + +### InstitutionRatingViewsResponse + + + +| Name | Type | Required | Description | +| ---- | ---- | -------- | ----------- | +| elist | array | 否 | 月度評級分佈列表,最新月份在前 | +| elist[].date | int64 | 否 | Unix 時間戳(秒) | +| elist[].buy | integer | 否 | 買入評級數量 | +| elist[].over | integer | 否 | 跑贏市場評級數量 | +| elist[].hold | integer | 否 | 持有評級數量 | +| elist[].under | integer | 否 | 跑輸市場評級數量 | +| elist[].sell | integer | 否 | 賣出評級數量 | +| elist[].total | integer | 否 | 機構總數 | From 041d38e96d55ec8781d6c68f69fb35a6a3401c9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=A2=81=E7=AB=A0=E6=B4=AA?= Date: Mon, 18 May 2026 11:44:36 +0800 Subject: [PATCH 2/8] ci: re-trigger CI check From a153705c411fb7e6c8f300121976f92a6fd8aa45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=A2=81=E7=AB=A0=E6=B4=AA?= Date: Mon, 18 May 2026 18:05:29 +0800 Subject: [PATCH 3/8] chore(build): increase Node.js heap limit to 12GB Heap was hitting ~10.27GB with 10240MB limit, causing OOM during CI build. Co-Authored-By: Claude Sonnet 4.6 (1M context) --- .github/workflows/build.yml | 2 +- .github/workflows/canary.yml | 2 +- package.json | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4dd88102..eb449c51 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -29,4 +29,4 @@ jobs: run: | bun run build:canary env: - NODE_OPTIONS: --max-old-space-size=10240 --expose-gc + NODE_OPTIONS: --max-old-space-size=12288 --expose-gc diff --git a/.github/workflows/canary.yml b/.github/workflows/canary.yml index a23c5759..208379ef 100644 --- a/.github/workflows/canary.yml +++ b/.github/workflows/canary.yml @@ -37,7 +37,7 @@ jobs: run: bun run build:canary env: VITE_PORTAL_GATEWAY_BASE_URL: 'https://m.longbridge.xyz' - NODE_OPTIONS: --max-old-space-size=10240 --expose-gc + NODE_OPTIONS: --max-old-space-size=12288 --expose-gc - name: Upload to Aliyun OSS run: | diff --git a/package.json b/package.json index 6a90a333..e7e85be4 100644 --- a/package.json +++ b/package.json @@ -10,9 +10,9 @@ "dev": "vitepress dev docs", "dev:canary": "cross-env VITE_API_BASE_URL=https://openapi.longbridge.xyz npx vitepress dev docs", "dev:cn": "cross-env VITE_REGION=cn VITE_API_BASE_URL=https://openapi.longbridge.cn VITE_SITE_HOSTNAME=https://open.longbridge.cn npx vitepress dev docs", - "build:canary": "cross-env \"NODE_OPTIONS=--max-old-space-size=10240 --expose-gc\" VITE_API_BASE_URL=https://openapi.longbridge.xyz npx vitepress build docs && bun run build:llms && bun run build:copy-routes", - "build:release": "cross-env \"NODE_OPTIONS=--max-old-space-size=10240 --expose-gc\" VITE_API_BASE_URL=https://openapi.longbridge.com npx vitepress build docs && bun run build:llms && bun run build:copy-routes", - "build:cn": "cross-env \"NODE_OPTIONS=--max-old-space-size=10240 --expose-gc\" VITE_REGION=cn VITE_API_BASE_URL=https://openapi.longbridge.cn VITE_PORTAL_GATEWAY_BASE_URL=https://m.lbkrs.com VITE_SITE_HOSTNAME=https://open.longbridge.cn npx vitepress build docs && bun run build:llms && bun run build:copy-routes", + "build:canary": "cross-env \"NODE_OPTIONS=--max-old-space-size=12288 --expose-gc\" VITE_API_BASE_URL=https://openapi.longbridge.xyz npx vitepress build docs && bun run build:llms && bun run build:copy-routes", + "build:release": "cross-env \"NODE_OPTIONS=--max-old-space-size=12288 --expose-gc\" VITE_API_BASE_URL=https://openapi.longbridge.com npx vitepress build docs && bun run build:llms && bun run build:copy-routes", + "build:cn": "cross-env \"NODE_OPTIONS=--max-old-space-size=12288 --expose-gc\" VITE_REGION=cn VITE_API_BASE_URL=https://openapi.longbridge.cn VITE_PORTAL_GATEWAY_BASE_URL=https://m.lbkrs.com VITE_SITE_HOSTNAME=https://open.longbridge.cn npx vitepress build docs && bun run build:llms && bun run build:copy-routes", "build:llms": "bun run scripts/normalize_md.ts && bun run scripts/generate-llms.ts", "build:copy-routes": "bun run scripts/copy-routes.ts", "preview": "vitepress preview docs", From 8987f1661a1c48db74a5c457d876889b880935c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=A2=81=E7=AB=A0=E6=B4=AA?= Date: Mon, 18 May 2026 19:35:27 +0800 Subject: [PATCH 4/8] =?UTF-8?q?fix(docs):=20correct=20business=5Fsegments?= =?UTF-8?q?=20percent=20field=20examples=20=E2=80=94=20API=20returns=20per?= =?UTF-8?q?centage=20(e.g.=2056.19)=20not=20decimal=20(e.g.=200.5619)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../docs/fundamental/fundamental/business_segments.md | 10 +++++----- .../fundamental/business_segments_history.md | 8 ++++---- .../docs/fundamental/fundamental/business_segments.md | 10 +++++----- .../fundamental/business_segments_history.md | 8 ++++---- .../docs/fundamental/fundamental/business_segments.md | 10 +++++----- .../fundamental/business_segments_history.md | 8 ++++---- 6 files changed, 27 insertions(+), 27 deletions(-) diff --git a/docs/en/docs/fundamental/fundamental/business_segments.md b/docs/en/docs/fundamental/fundamental/business_segments.md index 35dc24d1..2ff1f53a 100644 --- a/docs/en/docs/fundamental/fundamental/business_segments.md +++ b/docs/en/docs/fundamental/fundamental/business_segments.md @@ -199,11 +199,11 @@ func main() { "total": "124300000000", "currency": "USD", "business": [ - {"name": "iPhone", "percent": "0.5619"}, - {"name": "Services", "percent": "0.2196"}, - {"name": "Mac", "percent": "0.0804"}, - {"name": "iPad", "percent": "0.0700"}, - {"name": "Wearables", "percent": "0.0681"} + {"name": "iPhone", "percent": "56.19"}, + {"name": "Services", "percent": "21.96"}, + {"name": "Mac", "percent": "8.04"}, + {"name": "iPad", "percent": "7.00"}, + {"name": "Wearables", "percent": "6.81"} ] } } diff --git a/docs/en/docs/fundamental/fundamental/business_segments_history.md b/docs/en/docs/fundamental/fundamental/business_segments_history.md index d41a89db..3b2b34ea 100644 --- a/docs/en/docs/fundamental/fundamental/business_segments_history.md +++ b/docs/en/docs/fundamental/fundamental/business_segments_history.md @@ -203,12 +203,12 @@ func main() { "total": "124300000000", "currency": "USD", "business": [ - {"name": "iPhone", "percent": "0.5619", "value": "69900000000"}, - {"name": "Services", "percent": "0.2196", "value": "26300000000"} + {"name": "iPhone", "percent": "56.19", "value": "69900000000"}, + {"name": "Services", "percent": "21.96", "value": "26300000000"} ], "regionals": [ - {"name": "Americas", "percent": "0.4280", "value": "53200000000"}, - {"name": "Europe", "percent": "0.2520", "value": "30100000000"} + {"name": "Americas", "percent": "42.80", "value": "53200000000"}, + {"name": "Europe", "percent": "25.20", "value": "30100000000"} ] } ] diff --git a/docs/zh-CN/docs/fundamental/fundamental/business_segments.md b/docs/zh-CN/docs/fundamental/fundamental/business_segments.md index fb1cd9fa..dd53f83f 100644 --- a/docs/zh-CN/docs/fundamental/fundamental/business_segments.md +++ b/docs/zh-CN/docs/fundamental/fundamental/business_segments.md @@ -199,11 +199,11 @@ func main() { "total": "124300000000", "currency": "USD", "business": [ - {"name": "iPhone", "percent": "0.5619"}, - {"name": "Services", "percent": "0.2196"}, - {"name": "Mac", "percent": "0.0804"}, - {"name": "iPad", "percent": "0.0700"}, - {"name": "Wearables", "percent": "0.0681"} + {"name": "iPhone", "percent": "56.19"}, + {"name": "Services", "percent": "21.96"}, + {"name": "Mac", "percent": "8.04"}, + {"name": "iPad", "percent": "7.00"}, + {"name": "Wearables", "percent": "6.81"} ] } } diff --git a/docs/zh-CN/docs/fundamental/fundamental/business_segments_history.md b/docs/zh-CN/docs/fundamental/fundamental/business_segments_history.md index 71fa9c00..9436cfb2 100644 --- a/docs/zh-CN/docs/fundamental/fundamental/business_segments_history.md +++ b/docs/zh-CN/docs/fundamental/fundamental/business_segments_history.md @@ -203,12 +203,12 @@ func main() { "total": "124300000000", "currency": "USD", "business": [ - {"name": "iPhone", "percent": "0.5619", "value": "69900000000"}, - {"name": "Services", "percent": "0.2196", "value": "26300000000"} + {"name": "iPhone", "percent": "56.19", "value": "69900000000"}, + {"name": "Services", "percent": "21.96", "value": "26300000000"} ], "regionals": [ - {"name": "Americas", "percent": "0.4280", "value": "53200000000"}, - {"name": "Europe", "percent": "0.2520", "value": "30100000000"} + {"name": "Americas", "percent": "42.80", "value": "53200000000"}, + {"name": "Europe", "percent": "25.20", "value": "30100000000"} ] } ] diff --git a/docs/zh-HK/docs/fundamental/fundamental/business_segments.md b/docs/zh-HK/docs/fundamental/fundamental/business_segments.md index a85f7e1e..fb125298 100644 --- a/docs/zh-HK/docs/fundamental/fundamental/business_segments.md +++ b/docs/zh-HK/docs/fundamental/fundamental/business_segments.md @@ -199,11 +199,11 @@ func main() { "total": "124300000000", "currency": "USD", "business": [ - {"name": "iPhone", "percent": "0.5619"}, - {"name": "Services", "percent": "0.2196"}, - {"name": "Mac", "percent": "0.0804"}, - {"name": "iPad", "percent": "0.0700"}, - {"name": "Wearables", "percent": "0.0681"} + {"name": "iPhone", "percent": "56.19"}, + {"name": "Services", "percent": "21.96"}, + {"name": "Mac", "percent": "8.04"}, + {"name": "iPad", "percent": "7.00"}, + {"name": "Wearables", "percent": "6.81"} ] } } diff --git a/docs/zh-HK/docs/fundamental/fundamental/business_segments_history.md b/docs/zh-HK/docs/fundamental/fundamental/business_segments_history.md index 84c5fc51..09633db2 100644 --- a/docs/zh-HK/docs/fundamental/fundamental/business_segments_history.md +++ b/docs/zh-HK/docs/fundamental/fundamental/business_segments_history.md @@ -203,12 +203,12 @@ func main() { "total": "124300000000", "currency": "USD", "business": [ - {"name": "iPhone", "percent": "0.5619", "value": "69900000000"}, - {"name": "Services", "percent": "0.2196", "value": "26300000000"} + {"name": "iPhone", "percent": "56.19", "value": "69900000000"}, + {"name": "Services", "percent": "21.96", "value": "26300000000"} ], "regionals": [ - {"name": "Americas", "percent": "0.4280", "value": "53200000000"}, - {"name": "Europe", "percent": "0.2520", "value": "30100000000"} + {"name": "Americas", "percent": "42.80", "value": "53200000000"}, + {"name": "Europe", "percent": "25.20", "value": "30100000000"} ] } ] From 840c114e89d6cb7d0c2ae874ba06018d14c94191 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=A2=81=E7=AB=A0=E6=B4=AA?= Date: Tue, 19 May 2026 16:27:04 +0800 Subject: [PATCH 5/8] cli: Add Notable Commands section with new stock tools Document top-movers, rank, short-trades, screener (strategies/search/indicators), compare (valuation), and shareholder --top/--object-id added in the terminal CLI. Co-Authored-By: Claude Sonnet 4.6 --- skills/longbridge/references/cli/overview.md | 27 ++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/skills/longbridge/references/cli/overview.md b/skills/longbridge/references/cli/overview.md index 37961b2e..7411dafa 100644 --- a/skills/longbridge/references/cli/overview.md +++ b/skills/longbridge/references/cli/overview.md @@ -121,6 +121,33 @@ longbridge filing detail TSLA.US 610186794100660481 --file-index 0 - **`quote`**: always returns `pre_market_quote` / `post_market_quote` / `overnight_quote` when available (US only). Table format appends an "Extended Hours" section; JSON includes them as nested objects. - **`intraday` / `kline` / `kline history`**: default to intraday session only; pass `--session all` to include pre/post-market data. `kline`/`kline history` add a **Session** column when `--session all` is used. +## Notable Commands + +```bash +# Market activity and sentiment +longbridge top-movers [--market HK|US|CN|SG] [--sort hot|time|chg] # Stocks with abnormal price moves + correlated news +longbridge rank # List popularity ranking tab keys +longbridge rank --key ib_hot_all-us [--count 20] # Stocks ranked by composite heat score + +# Short selling +longbridge short-positions AAPL.US # Short interest, ratio, days to cover +longbridge short-trades AAPL.US # Daily short sale volume (FINRA/HKEX) + +# Stock screener (two workflows) +longbridge screener strategies # Step 1: list strategies → get ID +longbridge screener search --strategy-id # Step 2: run saved strategy +longbridge screener indicators # Discover indicator keys and ranges +longbridge screener search --market HK --filter filter_marketcap:100:1000 --filter filter_divyld:3: # Custom filter + +# Valuation comparison +longbridge compare AAPL.US # vs server-selected industry peers +longbridge compare 9988.HK 700.HK 9999.HK [--currency HKD] # Side-by-side multi-stock comparison + +# Institutional shareholders (extended) +longbridge shareholder AAPL.US --top # Top 20 major shareholders (multi-period) +longbridge shareholder AAPL.US --object-id # Holding + trade detail for one shareholder +``` + ## Rate Limits - Max **10 API calls/second** From a6871b0256ae50f08a5437c90729e7ab999a3553 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=A2=81=E7=AB=A0=E6=B4=AA?= Date: Tue, 19 May 2026 16:28:11 +0800 Subject: [PATCH 6/8] Revert "cli: Add Notable Commands section with new stock tools" This reverts commit 840c114e89d6cb7d0c2ae874ba06018d14c94191. --- skills/longbridge/references/cli/overview.md | 27 -------------------- 1 file changed, 27 deletions(-) diff --git a/skills/longbridge/references/cli/overview.md b/skills/longbridge/references/cli/overview.md index 7411dafa..37961b2e 100644 --- a/skills/longbridge/references/cli/overview.md +++ b/skills/longbridge/references/cli/overview.md @@ -121,33 +121,6 @@ longbridge filing detail TSLA.US 610186794100660481 --file-index 0 - **`quote`**: always returns `pre_market_quote` / `post_market_quote` / `overnight_quote` when available (US only). Table format appends an "Extended Hours" section; JSON includes them as nested objects. - **`intraday` / `kline` / `kline history`**: default to intraday session only; pass `--session all` to include pre/post-market data. `kline`/`kline history` add a **Session** column when `--session all` is used. -## Notable Commands - -```bash -# Market activity and sentiment -longbridge top-movers [--market HK|US|CN|SG] [--sort hot|time|chg] # Stocks with abnormal price moves + correlated news -longbridge rank # List popularity ranking tab keys -longbridge rank --key ib_hot_all-us [--count 20] # Stocks ranked by composite heat score - -# Short selling -longbridge short-positions AAPL.US # Short interest, ratio, days to cover -longbridge short-trades AAPL.US # Daily short sale volume (FINRA/HKEX) - -# Stock screener (two workflows) -longbridge screener strategies # Step 1: list strategies → get ID -longbridge screener search --strategy-id # Step 2: run saved strategy -longbridge screener indicators # Discover indicator keys and ranges -longbridge screener search --market HK --filter filter_marketcap:100:1000 --filter filter_divyld:3: # Custom filter - -# Valuation comparison -longbridge compare AAPL.US # vs server-selected industry peers -longbridge compare 9988.HK 700.HK 9999.HK [--currency HKD] # Side-by-side multi-stock comparison - -# Institutional shareholders (extended) -longbridge shareholder AAPL.US --top # Top 20 major shareholders (multi-period) -longbridge shareholder AAPL.US --object-id # Holding + trade detail for one shareholder -``` - ## Rate Limits - Max **10 API calls/second** From d497073910e3ccf68ab31a4d303e5a5c157c31fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=A2=81=E7=AB=A0=E6=B4=AA?= Date: Wed, 20 May 2026 10:51:07 +0800 Subject: [PATCH 7/8] fix(docs): align response examples with production API - business_segments/history: date format YYYYMMDD (was YYYYQ#); regionals is [] - institution_rating_views: buy/over/hold/under/sell/total are strings not integers - industry_peers: next[].counter_id is empty string - financial_report_snapshot: ticker without market suffix, date format YYYY.MM.DD, yoy as percentage string, cmp_desc/est_value empty, ratio fields as percentages --- .../fundamental/business_segments.md | 2 +- .../fundamental/business_segments_history.md | 12 +++---- .../fundamental/financial_report_snapshot.md | 26 +++++++------- .../fundamental/fundamental/industry_peers.md | 10 +++--- .../fundamental/institution_rating_views.md | 36 +++++++++---------- .../fundamental/business_segments.md | 2 +- .../fundamental/business_segments_history.md | 12 +++---- .../fundamental/financial_report_snapshot.md | 26 +++++++------- .../fundamental/fundamental/industry_peers.md | 10 +++--- .../fundamental/institution_rating_views.md | 36 +++++++++---------- .../fundamental/business_segments.md | 2 +- .../fundamental/business_segments_history.md | 12 +++---- .../fundamental/financial_report_snapshot.md | 26 +++++++------- .../fundamental/fundamental/industry_peers.md | 10 +++--- .../fundamental/institution_rating_views.md | 36 +++++++++---------- 15 files changed, 126 insertions(+), 132 deletions(-) diff --git a/docs/en/docs/fundamental/fundamental/business_segments.md b/docs/en/docs/fundamental/fundamental/business_segments.md index 2ff1f53a..3e02dede 100644 --- a/docs/en/docs/fundamental/fundamental/business_segments.md +++ b/docs/en/docs/fundamental/fundamental/business_segments.md @@ -195,7 +195,7 @@ func main() { "code": 0, "message": "success", "data": { - "date": "2024Q4", + "date": "20260331", "total": "124300000000", "currency": "USD", "business": [ diff --git a/docs/en/docs/fundamental/fundamental/business_segments_history.md b/docs/en/docs/fundamental/fundamental/business_segments_history.md index 3b2b34ea..bb2b24c5 100644 --- a/docs/en/docs/fundamental/fundamental/business_segments_history.md +++ b/docs/en/docs/fundamental/fundamental/business_segments_history.md @@ -199,17 +199,15 @@ func main() { "data": { "historical": [ { - "date": "2024Q4", + "date": "20260331", "total": "124300000000", "currency": "USD", "business": [ - {"name": "iPhone", "percent": "56.19", "value": "69900000000"}, - {"name": "Services", "percent": "21.96", "value": "26300000000"} + {"name": "美洲", "percent": "40.80", "value": "31968000000"}, + {"name": "欧洲", "percent": "23.64", "value": "18521000000"}, + {"name": "大中华区", "percent": "20.72", "value": "16233000000"} ], - "regionals": [ - {"name": "Americas", "percent": "42.80", "value": "53200000000"}, - {"name": "Europe", "percent": "25.20", "value": "30100000000"} - ] + "regionals": [] } ] } diff --git a/docs/en/docs/fundamental/fundamental/financial_report_snapshot.md b/docs/en/docs/fundamental/fundamental/financial_report_snapshot.md index 55532e88..05365873 100644 --- a/docs/en/docs/fundamental/fundamental/financial_report_snapshot.md +++ b/docs/en/docs/fundamental/fundamental/financial_report_snapshot.md @@ -198,20 +198,20 @@ func main() { "code": 0, "message": "success", "data": { - "name": "Apple Inc.", - "ticker": "AAPL.US", - "fp_start": "2024-10-01", - "fp_end": "2024-12-31", + "name": "苹果", + "ticker": "AAPL", + "fp_start": "2025.12.28", + "fp_end": "2026.03.28", "currency": "USD", - "report_desc": "Apple delivered record revenue of $124.3B in Q1 FY2025...", - "fo_revenue": {"value": "124300000000", "yoy": "0.0407", "cmp_desc": "beat by 1.2%", "est_value": "123800000000"}, - "fo_ebit": {"value": "42800000000", "yoy": "0.0520", "cmp_desc": "beat by 0.8%", "est_value": "42500000000"}, - "fo_eps": {"value": "2.40", "yoy": "0.0870", "cmp_desc": "beat by 2.1%", "est_value": "2.35"}, - "fr_revenue": {"value": "124300000000", "yoy": "0.0407"}, - "fr_profit": {"value": "36330000000", "yoy": "0.0710"}, - "fr_roe_ttm": "0.1570", - "fr_profit_margin": "0.2923", - "fr_debt_assets_ratio": "0.8120" + "report_desc": "概要:苹果(AAPL)的营业收入是 1112 亿(+16.6%);每股收益是 2.01(+21.82%)。", + "fo_revenue": {"value": "111184000000.0000", "yoy": "16.6", "cmp_desc": "", "est_value": ""}, + "fo_ebit": {"value": "35885000000.0000", "yoy": "21.28", "cmp_desc": "", "est_value": ""}, + "fo_eps": {"value": "2.0100", "yoy": "21.82", "cmp_desc": "", "est_value": ""}, + "fr_revenue": {"value": "111184000000.0000", "yoy": "16.6"}, + "fr_profit": {"value": "29578000000.0000", "yoy": "19.36"}, + "fr_roe_ttm": "141.4705", + "fr_profit_margin": "26.6027", + "fr_debt_assets_ratio": "71.3025" } } ``` diff --git a/docs/en/docs/fundamental/fundamental/industry_peers.md b/docs/en/docs/fundamental/fundamental/industry_peers.md index 14c8ff3d..40341fef 100644 --- a/docs/en/docs/fundamental/fundamental/industry_peers.md +++ b/docs/en/docs/fundamental/fundamental/industry_peers.md @@ -205,11 +205,11 @@ func main() { "ytd_chg": "0.0875", "next": [ { - "name": "Semiconductors", - "counter_id": "BK/US/IN00297", - "stock_num": 87, - "chg": "0.0512", - "ytd_chg": "0.1243", + "name": "在线消费电子产品零售", + "counter_id": "", + "stock_num": 4, + "chg": "0.0268", + "ytd_chg": "-0.1869", "next": [] } ] diff --git a/docs/en/docs/fundamental/fundamental/institution_rating_views.md b/docs/en/docs/fundamental/fundamental/institution_rating_views.md index 93ef2871..3c04d223 100644 --- a/docs/en/docs/fundamental/fundamental/institution_rating_views.md +++ b/docs/en/docs/fundamental/fundamental/institution_rating_views.md @@ -198,21 +198,21 @@ func main() { "elist": [ { "date": 1746057600, - "buy": 18, - "over": 5, - "hold": 17, - "under": 3, - "sell": 4, - "total": 51 + "buy": "18", + "over": "5", + "hold": "17", + "under": "3", + "sell": "4", + "total": "51" }, { "date": 1743379200, - "buy": 17, - "over": 6, - "hold": 18, - "under": 3, - "sell": 5, - "total": 53 + "buy": "17", + "over": "6", + "hold": "18", + "under": "3", + "sell": "5", + "total": "53" } ] } @@ -236,9 +236,9 @@ func main() { | ---- | ---- | -------- | ----------- | | elist | array | false | Monthly rating distribution list, newest first | | elist[].date | int64 | false | Unix timestamp (seconds) | -| elist[].buy | integer | false | Buy rating count | -| elist[].over | integer | false | Outperform rating count | -| elist[].hold | integer | false | Hold rating count | -| elist[].under | integer | false | Underperform rating count | -| elist[].sell | integer | false | Sell rating count | -| elist[].total | integer | false | Total analyst count | +| elist[].buy | string | false | Buy rating count | +| elist[].over | string | false | Outperform rating count | +| elist[].hold | string | false | Hold rating count | +| elist[].under | string | false | Underperform rating count | +| elist[].sell | string | false | Sell rating count | +| elist[].total | string | false | Total analyst count | diff --git a/docs/zh-CN/docs/fundamental/fundamental/business_segments.md b/docs/zh-CN/docs/fundamental/fundamental/business_segments.md index dd53f83f..20a8214d 100644 --- a/docs/zh-CN/docs/fundamental/fundamental/business_segments.md +++ b/docs/zh-CN/docs/fundamental/fundamental/business_segments.md @@ -195,7 +195,7 @@ func main() { "code": 0, "message": "success", "data": { - "date": "2024Q4", + "date": "20260331", "total": "124300000000", "currency": "USD", "business": [ diff --git a/docs/zh-CN/docs/fundamental/fundamental/business_segments_history.md b/docs/zh-CN/docs/fundamental/fundamental/business_segments_history.md index 9436cfb2..9edfd363 100644 --- a/docs/zh-CN/docs/fundamental/fundamental/business_segments_history.md +++ b/docs/zh-CN/docs/fundamental/fundamental/business_segments_history.md @@ -199,17 +199,15 @@ func main() { "data": { "historical": [ { - "date": "2024Q4", + "date": "20260331", "total": "124300000000", "currency": "USD", "business": [ - {"name": "iPhone", "percent": "56.19", "value": "69900000000"}, - {"name": "Services", "percent": "21.96", "value": "26300000000"} + {"name": "美洲", "percent": "40.80", "value": "31968000000"}, + {"name": "欧洲", "percent": "23.64", "value": "18521000000"}, + {"name": "大中华区", "percent": "20.72", "value": "16233000000"} ], - "regionals": [ - {"name": "Americas", "percent": "42.80", "value": "53200000000"}, - {"name": "Europe", "percent": "25.20", "value": "30100000000"} - ] + "regionals": [] } ] } diff --git a/docs/zh-CN/docs/fundamental/fundamental/financial_report_snapshot.md b/docs/zh-CN/docs/fundamental/fundamental/financial_report_snapshot.md index 1656f717..5885142f 100644 --- a/docs/zh-CN/docs/fundamental/fundamental/financial_report_snapshot.md +++ b/docs/zh-CN/docs/fundamental/fundamental/financial_report_snapshot.md @@ -198,20 +198,20 @@ func main() { "code": 0, "message": "success", "data": { - "name": "Apple Inc.", - "ticker": "AAPL.US", - "fp_start": "2024-10-01", - "fp_end": "2024-12-31", + "name": "苹果", + "ticker": "AAPL", + "fp_start": "2025.12.28", + "fp_end": "2026.03.28", "currency": "USD", - "report_desc": "Apple delivered record revenue of $124.3B in Q1 FY2025...", - "fo_revenue": {"value": "124300000000", "yoy": "0.0407", "cmp_desc": "beat by 1.2%", "est_value": "123800000000"}, - "fo_ebit": {"value": "42800000000", "yoy": "0.0520", "cmp_desc": "beat by 0.8%", "est_value": "42500000000"}, - "fo_eps": {"value": "2.40", "yoy": "0.0870", "cmp_desc": "beat by 2.1%", "est_value": "2.35"}, - "fr_revenue": {"value": "124300000000", "yoy": "0.0407"}, - "fr_profit": {"value": "36330000000", "yoy": "0.0710"}, - "fr_roe_ttm": "0.1570", - "fr_profit_margin": "0.2923", - "fr_debt_assets_ratio": "0.8120" + "report_desc": "概要:苹果(AAPL)的营业收入是 1112 亿(+16.6%);每股收益是 2.01(+21.82%)。", + "fo_revenue": {"value": "111184000000.0000", "yoy": "16.6", "cmp_desc": "", "est_value": ""}, + "fo_ebit": {"value": "35885000000.0000", "yoy": "21.28", "cmp_desc": "", "est_value": ""}, + "fo_eps": {"value": "2.0100", "yoy": "21.82", "cmp_desc": "", "est_value": ""}, + "fr_revenue": {"value": "111184000000.0000", "yoy": "16.6"}, + "fr_profit": {"value": "29578000000.0000", "yoy": "19.36"}, + "fr_roe_ttm": "141.4705", + "fr_profit_margin": "26.6027", + "fr_debt_assets_ratio": "71.3025" } } ``` diff --git a/docs/zh-CN/docs/fundamental/fundamental/industry_peers.md b/docs/zh-CN/docs/fundamental/fundamental/industry_peers.md index 4813f495..94f134dd 100644 --- a/docs/zh-CN/docs/fundamental/fundamental/industry_peers.md +++ b/docs/zh-CN/docs/fundamental/fundamental/industry_peers.md @@ -205,11 +205,11 @@ func main() { "ytd_chg": "0.0875", "next": [ { - "name": "Semiconductors", - "counter_id": "BK/US/IN00297", - "stock_num": 87, - "chg": "0.0512", - "ytd_chg": "0.1243", + "name": "在线消费电子产品零售", + "counter_id": "", + "stock_num": 4, + "chg": "0.0268", + "ytd_chg": "-0.1869", "next": [] } ] diff --git a/docs/zh-CN/docs/fundamental/fundamental/institution_rating_views.md b/docs/zh-CN/docs/fundamental/fundamental/institution_rating_views.md index c27a0644..be217d95 100644 --- a/docs/zh-CN/docs/fundamental/fundamental/institution_rating_views.md +++ b/docs/zh-CN/docs/fundamental/fundamental/institution_rating_views.md @@ -198,21 +198,21 @@ func main() { "elist": [ { "date": 1746057600, - "buy": 18, - "over": 5, - "hold": 17, - "under": 3, - "sell": 4, - "total": 51 + "buy": "18", + "over": "5", + "hold": "17", + "under": "3", + "sell": "4", + "total": "51" }, { "date": 1743379200, - "buy": 17, - "over": 6, - "hold": 18, - "under": 3, - "sell": 5, - "total": 53 + "buy": "17", + "over": "6", + "hold": "18", + "under": "3", + "sell": "5", + "total": "53" } ] } @@ -236,9 +236,9 @@ func main() { | ---- | ---- | -------- | ----------- | | elist | array | 否 | 月度评级分布列表,最新月份在前 | | elist[].date | int64 | 否 | Unix 时间戳(秒) | -| elist[].buy | integer | 否 | 买入评级数量 | -| elist[].over | integer | 否 | 跑赢市场评级数量 | -| elist[].hold | integer | 否 | 持有评级数量 | -| elist[].under | integer | 否 | 跑输市场评级数量 | -| elist[].sell | integer | 否 | 卖出评级数量 | -| elist[].total | integer | 否 | 机构总数 | +| elist[].buy | string | 否 | 买入评级数量 | +| elist[].over | string | 否 | 跑赢市场评级数量 | +| elist[].hold | string | 否 | 持有评级数量 | +| elist[].under | string | 否 | 跑输市场评级数量 | +| elist[].sell | string | 否 | 卖出评级数量 | +| elist[].total | string | 否 | 机构总数 | diff --git a/docs/zh-HK/docs/fundamental/fundamental/business_segments.md b/docs/zh-HK/docs/fundamental/fundamental/business_segments.md index fb125298..861d0ba1 100644 --- a/docs/zh-HK/docs/fundamental/fundamental/business_segments.md +++ b/docs/zh-HK/docs/fundamental/fundamental/business_segments.md @@ -195,7 +195,7 @@ func main() { "code": 0, "message": "success", "data": { - "date": "2024Q4", + "date": "20260331", "total": "124300000000", "currency": "USD", "business": [ diff --git a/docs/zh-HK/docs/fundamental/fundamental/business_segments_history.md b/docs/zh-HK/docs/fundamental/fundamental/business_segments_history.md index 09633db2..1dd3c44c 100644 --- a/docs/zh-HK/docs/fundamental/fundamental/business_segments_history.md +++ b/docs/zh-HK/docs/fundamental/fundamental/business_segments_history.md @@ -199,17 +199,15 @@ func main() { "data": { "historical": [ { - "date": "2024Q4", + "date": "20260331", "total": "124300000000", "currency": "USD", "business": [ - {"name": "iPhone", "percent": "56.19", "value": "69900000000"}, - {"name": "Services", "percent": "21.96", "value": "26300000000"} + {"name": "美洲", "percent": "40.80", "value": "31968000000"}, + {"name": "欧洲", "percent": "23.64", "value": "18521000000"}, + {"name": "大中华区", "percent": "20.72", "value": "16233000000"} ], - "regionals": [ - {"name": "Americas", "percent": "42.80", "value": "53200000000"}, - {"name": "Europe", "percent": "25.20", "value": "30100000000"} - ] + "regionals": [] } ] } diff --git a/docs/zh-HK/docs/fundamental/fundamental/financial_report_snapshot.md b/docs/zh-HK/docs/fundamental/fundamental/financial_report_snapshot.md index bf9e7bcd..e9d02aff 100644 --- a/docs/zh-HK/docs/fundamental/fundamental/financial_report_snapshot.md +++ b/docs/zh-HK/docs/fundamental/fundamental/financial_report_snapshot.md @@ -198,20 +198,20 @@ func main() { "code": 0, "message": "success", "data": { - "name": "Apple Inc.", - "ticker": "AAPL.US", - "fp_start": "2024-10-01", - "fp_end": "2024-12-31", + "name": "苹果", + "ticker": "AAPL", + "fp_start": "2025.12.28", + "fp_end": "2026.03.28", "currency": "USD", - "report_desc": "Apple delivered record revenue of $124.3B in Q1 FY2025...", - "fo_revenue": {"value": "124300000000", "yoy": "0.0407", "cmp_desc": "beat by 1.2%", "est_value": "123800000000"}, - "fo_ebit": {"value": "42800000000", "yoy": "0.0520", "cmp_desc": "beat by 0.8%", "est_value": "42500000000"}, - "fo_eps": {"value": "2.40", "yoy": "0.0870", "cmp_desc": "beat by 2.1%", "est_value": "2.35"}, - "fr_revenue": {"value": "124300000000", "yoy": "0.0407"}, - "fr_profit": {"value": "36330000000", "yoy": "0.0710"}, - "fr_roe_ttm": "0.1570", - "fr_profit_margin": "0.2923", - "fr_debt_assets_ratio": "0.8120" + "report_desc": "概要:苹果(AAPL)的营业收入是 1112 亿(+16.6%);每股收益是 2.01(+21.82%)。", + "fo_revenue": {"value": "111184000000.0000", "yoy": "16.6", "cmp_desc": "", "est_value": ""}, + "fo_ebit": {"value": "35885000000.0000", "yoy": "21.28", "cmp_desc": "", "est_value": ""}, + "fo_eps": {"value": "2.0100", "yoy": "21.82", "cmp_desc": "", "est_value": ""}, + "fr_revenue": {"value": "111184000000.0000", "yoy": "16.6"}, + "fr_profit": {"value": "29578000000.0000", "yoy": "19.36"}, + "fr_roe_ttm": "141.4705", + "fr_profit_margin": "26.6027", + "fr_debt_assets_ratio": "71.3025" } } ``` diff --git a/docs/zh-HK/docs/fundamental/fundamental/industry_peers.md b/docs/zh-HK/docs/fundamental/fundamental/industry_peers.md index 99917c59..8d728650 100644 --- a/docs/zh-HK/docs/fundamental/fundamental/industry_peers.md +++ b/docs/zh-HK/docs/fundamental/fundamental/industry_peers.md @@ -205,11 +205,11 @@ func main() { "ytd_chg": "0.0875", "next": [ { - "name": "Semiconductors", - "counter_id": "BK/US/IN00297", - "stock_num": 87, - "chg": "0.0512", - "ytd_chg": "0.1243", + "name": "在线消费电子产品零售", + "counter_id": "", + "stock_num": 4, + "chg": "0.0268", + "ytd_chg": "-0.1869", "next": [] } ] diff --git a/docs/zh-HK/docs/fundamental/fundamental/institution_rating_views.md b/docs/zh-HK/docs/fundamental/fundamental/institution_rating_views.md index 1022d0ae..dc23c755 100644 --- a/docs/zh-HK/docs/fundamental/fundamental/institution_rating_views.md +++ b/docs/zh-HK/docs/fundamental/fundamental/institution_rating_views.md @@ -198,21 +198,21 @@ func main() { "elist": [ { "date": 1746057600, - "buy": 18, - "over": 5, - "hold": 17, - "under": 3, - "sell": 4, - "total": 51 + "buy": "18", + "over": "5", + "hold": "17", + "under": "3", + "sell": "4", + "total": "51" }, { "date": 1743379200, - "buy": 17, - "over": 6, - "hold": 18, - "under": 3, - "sell": 5, - "total": 53 + "buy": "17", + "over": "6", + "hold": "18", + "under": "3", + "sell": "5", + "total": "53" } ] } @@ -236,9 +236,9 @@ func main() { | ---- | ---- | -------- | ----------- | | elist | array | 否 | 月度評級分佈列表,最新月份在前 | | elist[].date | int64 | 否 | Unix 時間戳(秒) | -| elist[].buy | integer | 否 | 買入評級數量 | -| elist[].over | integer | 否 | 跑贏市場評級數量 | -| elist[].hold | integer | 否 | 持有評級數量 | -| elist[].under | integer | 否 | 跑輸市場評級數量 | -| elist[].sell | integer | 否 | 賣出評級數量 | -| elist[].total | integer | 否 | 機構總數 | +| elist[].buy | string | 否 | 買入評級數量 | +| elist[].over | string | 否 | 跑贏市場評級數量 | +| elist[].hold | string | 否 | 持有評級數量 | +| elist[].under | string | 否 | 跑輸市場評級數量 | +| elist[].sell | string | 否 | 賣出評級數量 | +| elist[].total | string | 否 | 機構總數 | From 2c22b65de07956a2f68c282682fad352af63f65e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=A2=81=E7=AB=A0=E6=B4=AA?= Date: Wed, 20 May 2026 11:05:50 +0800 Subject: [PATCH 8/8] docs(fundamental): rewrite Schemas sections for 6 API docs across 3 locales MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace flat `field[].subfield` notation with `∟` nested format for simple structures; use separate `### TypeName` subsections with cross-references for complex/recursive types (IndustryPeers, FinancialReportSnapshot). Fix field types (array→object[], int64→integer), correct date formats (YYYYMMDD not quarter label), and update percent descriptions (percentage not 0–1 decimal). Covers zh-CN, zh-HK, and en for: business_segments, business_segments_history, institution_rating_views, industry_rank, industry_peers, financial_report_snapshot. Co-Authored-By: Claude Sonnet 4.6 (1M context) --- .../fundamental/business_segments.md | 10 +-- .../fundamental/business_segments_history.md | 24 +++---- .../fundamental/financial_report_snapshot.md | 66 +++++++++++-------- .../fundamental/fundamental/industry_peers.md | 34 +++++++--- .../fundamental/fundamental/industry_rank.md | 20 +++--- .../fundamental/institution_rating_views.md | 16 ++--- .../fundamental/business_segments.md | 10 +-- .../fundamental/business_segments_history.md | 24 +++---- .../fundamental/financial_report_snapshot.md | 66 +++++++++++-------- .../fundamental/fundamental/industry_peers.md | 34 +++++++--- .../fundamental/fundamental/industry_rank.md | 20 +++--- .../fundamental/institution_rating_views.md | 16 ++--- .../fundamental/business_segments.md | 10 +-- .../fundamental/business_segments_history.md | 24 +++---- .../fundamental/financial_report_snapshot.md | 66 +++++++++++-------- .../fundamental/fundamental/industry_peers.md | 34 +++++++--- .../fundamental/fundamental/industry_rank.md | 20 +++--- .../fundamental/institution_rating_views.md | 16 ++--- 18 files changed, 297 insertions(+), 213 deletions(-) diff --git a/docs/en/docs/fundamental/fundamental/business_segments.md b/docs/en/docs/fundamental/fundamental/business_segments.md index 3e02dede..dbc255c6 100644 --- a/docs/en/docs/fundamental/fundamental/business_segments.md +++ b/docs/en/docs/fundamental/fundamental/business_segments.md @@ -224,9 +224,9 @@ func main() { | Name | Type | Required | Description | | ---- | ---- | -------- | ----------- | -| date | string | false | Reporting period label, e.g. `2024Q4` | -| total | string | false | Total revenue for the period (string value) | +| date | string | false | Report period in YYYYMMDD format, e.g. `20260331` | +| total | string | false | Total revenue for the period | | currency | string | false | Currency code, e.g. `USD` | -| business | array | false | Business segment list | -| business[].name | string | false | Segment name | -| business[].percent | string | false | Revenue share (0–1 decimal) | +| business | object[] | false | Business segment list | +| ∟ name | string | false | Segment name | +| ∟ percent | string | false | Revenue share percentage, e.g. `40.56` | diff --git a/docs/en/docs/fundamental/fundamental/business_segments_history.md b/docs/en/docs/fundamental/fundamental/business_segments_history.md index bb2b24c5..91864aa5 100644 --- a/docs/en/docs/fundamental/fundamental/business_segments_history.md +++ b/docs/en/docs/fundamental/fundamental/business_segments_history.md @@ -229,15 +229,15 @@ func main() { | Name | Type | Required | Description | | ---- | ---- | -------- | ----------- | -| historical | array | false | List of historical reporting periods | -| historical[].date | string | false | Reporting period label, e.g. `2024Q4` | -| historical[].total | string | false | Total revenue for the period (string value) | -| historical[].currency | string | false | Currency code | -| historical[].business | array | false | Business segment list | -| historical[].business[].name | string | false | Segment name | -| historical[].business[].percent | string | false | Revenue share (0–1 decimal) | -| historical[].business[].value | string | false | Absolute revenue value | -| historical[].regionals | array | false | Regional segment list | -| historical[].regionals[].name | string | false | Region name | -| historical[].regionals[].percent | string | false | Revenue share (0–1 decimal) | -| historical[].regionals[].value | string | false | Absolute revenue value | +| historical | object[] | false | Historical period snapshots | +| ∟ date | string | false | Report period in YYYYMMDD format, e.g. `20260331` | +| ∟ total | string | false | Total revenue for the period | +| ∟ currency | string | false | Currency code | +| ∟ business | object[] | false | Business segment list | +| ∟ ∟ name | string | false | Segment name | +| ∟ ∟ percent | string | false | Revenue share percentage, e.g. `40.80` | +| ∟ ∟ value | string | false | Absolute revenue value | +| ∟ regionals | object[] | false | Regional segment list (typically empty) | +| ∟ ∟ name | string | false | Region name | +| ∟ ∟ percent | string | false | Revenue share percentage | +| ∟ ∟ value | string | false | Absolute revenue value | diff --git a/docs/en/docs/fundamental/fundamental/financial_report_snapshot.md b/docs/en/docs/fundamental/fundamental/financial_report_snapshot.md index 05365873..0b4146d7 100644 --- a/docs/en/docs/fundamental/fundamental/financial_report_snapshot.md +++ b/docs/en/docs/fundamental/fundamental/financial_report_snapshot.md @@ -232,30 +232,44 @@ func main() { | Name | Type | Required | Description | | ---- | ---- | -------- | ----------- | | name | string | false | Company name | -| ticker | string | false | Security ticker | -| fp_start | string | false | Fiscal period start date | -| fp_end | string | false | Fiscal period end date | +| ticker | string | false | Ticker symbol without market suffix, e.g. `AAPL` | +| fp_start | string | false | Fiscal period start date in `YYYY.MM.DD` format | +| fp_end | string | false | Fiscal period end date in `YYYY.MM.DD` format | | currency | string | false | Currency code | -| report_desc | string | false | AI-generated earnings summary text | -| fo_revenue | object | false | Revenue forecast comparison | -| fo_revenue.value | string | false | Actual revenue | -| fo_revenue.yoy | string | false | Year-over-year growth rate (decimal) | -| fo_revenue.cmp_desc | string | false | Beat/miss description | -| fo_revenue.est_value | string | false | Consensus estimate value | -| fo_ebit | object | false | EBIT forecast comparison (same fields as fo_revenue) | -| fo_eps | object | false | EPS forecast comparison (same fields as fo_revenue) | -| fr_revenue | object | false | Revenue financial data | -| fr_revenue.value | string | false | Revenue value | -| fr_revenue.yoy | string | false | Year-over-year growth rate | -| fr_profit | object | false | Net profit financial data (same fields as fr_revenue) | -| fr_operate_cash | object | false | Operating cash flow (same fields as fr_revenue) | -| fr_invest_cash | object | false | Investing cash flow (same fields as fr_revenue) | -| fr_finance_cash | object | false | Financing cash flow (same fields as fr_revenue) | -| fr_total_assets | object | false | Total assets (same fields as fr_revenue) | -| fr_total_liability | object | false | Total liabilities (same fields as fr_revenue) | -| fr_roe_ttm | string | false | Return on equity TTM (decimal) | -| fr_profit_margin | string | false | Net profit margin (decimal) | -| fr_profit_margin_ttm | string | false | Net profit margin TTM (decimal) | -| fr_asset_turn_ttm | string | false | Asset turnover rate TTM (decimal) | -| fr_leverage_ttm | string | false | Leverage ratio TTM (decimal) | -| fr_debt_assets_ratio | string | false | Debt-to-assets ratio (decimal) | +| report_desc | string | false | AI-generated earnings summary | +| fo_revenue | object | false | Revenue forecast vs actual, see [ForecastMetric](#ForecastMetric) | +| fo_ebit | object | false | EBIT forecast vs actual, see [ForecastMetric](#ForecastMetric) | +| fo_eps | object | false | EPS forecast vs actual, see [ForecastMetric](#ForecastMetric) | +| fr_revenue | object | false | Reported revenue, see [ReportedMetric](#ReportedMetric) | +| fr_profit | object | false | Reported net profit, see [ReportedMetric](#ReportedMetric) | +| fr_operate_cash | object | false | Operating cash flow, see [ReportedMetric](#ReportedMetric) | +| fr_invest_cash | object | false | Investing cash flow, see [ReportedMetric](#ReportedMetric) | +| fr_finance_cash | object | false | Financing cash flow, see [ReportedMetric](#ReportedMetric) | +| fr_total_assets | object | false | Total assets, see [ReportedMetric](#ReportedMetric) | +| fr_total_liability | object | false | Total liabilities, see [ReportedMetric](#ReportedMetric) | +| fr_roe_ttm | string | false | ROE TTM as percentage, e.g. `141.47` | +| fr_profit_margin | string | false | Net profit margin as percentage | +| fr_profit_margin_ttm | string | false | Net profit margin TTM as percentage | +| fr_asset_turn_ttm | string | false | Asset turnover TTM as percentage | +| fr_leverage_ttm | string | false | Leverage TTM as percentage | +| fr_debt_assets_ratio | string | false | Debt-to-assets ratio as percentage | + +### ForecastMetric + + + +| Name | Type | Required | Description | +| ---- | ---- | -------- | ----------- | +| value | string | false | Actual value | +| yoy | string | false | Year-over-year growth as percentage, e.g. `16.6` | +| cmp_desc | string | false | Beat/miss description (may be empty) | +| est_value | string | false | Consensus estimate (may be empty) | + +### ReportedMetric + + + +| Name | Type | Required | Description | +| ---- | ---- | -------- | ----------- | +| value | string | false | Value | +| yoy | string | false | Year-over-year growth as percentage | diff --git a/docs/en/docs/fundamental/fundamental/industry_peers.md b/docs/en/docs/fundamental/fundamental/industry_peers.md index 40341fef..a1aca54f 100644 --- a/docs/en/docs/fundamental/fundamental/industry_peers.md +++ b/docs/en/docs/fundamental/fundamental/industry_peers.md @@ -233,13 +233,27 @@ func main() { | Name | Type | Required | Description | | ---- | ---- | -------- | ----------- | -| top | object | false | Top-level industry info | -| top.name | string | false | Top-level industry name | -| top.market | string | false | Market code | -| chain | object | false | Industry hierarchy tree root node | -| chain.name | string | false | Sector name | -| chain.counter_id | string | false | Sector unique identifier | -| chain.stock_num | integer | false | Number of stocks in the sector | -| chain.chg | string | false | Daily change (decimal) | -| chain.ytd_chg | string | false | Year-to-date change (decimal) | -| chain.next | array | false | Sub-sector list (same structure as chain, recursive) | +| top | object | false | Top-level industry info, see [IndustryPeersTop](#IndustryPeersTop) | +| chain | object | false | Industry hierarchy root node, see [IndustryPeerNode](#IndustryPeerNode) | + +### IndustryPeersTop + + + +| Name | Type | Required | Description | +| ---- | ---- | -------- | ----------- | +| name | string | false | Top-level industry name | +| market | string | false | Market code | + +### IndustryPeerNode + + + +| Name | Type | Required | Description | +| ---- | ---- | -------- | ----------- | +| name | string | false | Sector name | +| counter_id | string | false | Sector counter ID (present on root node; empty string on child nodes) | +| stock_num | integer | false | Number of stocks in this sector | +| chg | string | false | Daily change (decimal; may be empty string) | +| ytd_chg | string | false | Year-to-date change (decimal; may be empty string) | +| next | object[] | false | Child sector list with the same structure (recursive) | diff --git a/docs/en/docs/fundamental/fundamental/industry_rank.md b/docs/en/docs/fundamental/fundamental/industry_rank.md index c4380796..93ac410b 100644 --- a/docs/en/docs/fundamental/fundamental/industry_rank.md +++ b/docs/en/docs/fundamental/fundamental/industry_rank.md @@ -233,13 +233,13 @@ func main() { | Name | Type | Required | Description | | ---- | ---- | -------- | ----------- | -| items | array | false | Ranking group list | -| items[].lists | array | false | Industry entry list | -| items[].lists[].name | string | false | Industry name | -| items[].lists[].counter_id | string | false | Industry unique identifier (BK/MARKET/ID format), usable in `industry_peers` | -| items[].lists[].chg | string | false | Daily change (decimal) | -| items[].lists[].leading_name | string | false | Top-gaining stock name | -| items[].lists[].leading_ticker | string | false | Top-gaining stock ticker | -| items[].lists[].leading_chg | string | false | Top-gaining stock change | -| items[].lists[].value_name | string | false | Indicator name (populated by indicator type) | -| items[].lists[].value_data | string | false | Indicator value | +| items | object[] | false | Ranked group list | +| ∟ lists | object[] | false | Industry item list | +| ∟ ∟ name | string | false | Industry name | +| ∟ ∟ counter_id | string | false | Industry counter ID (`BK/MARKET/ID` format), usable in `industry_peers` | +| ∟ ∟ chg | string | false | Daily change (decimal) | +| ∟ ∟ leading_name | string | false | Leading stock name | +| ∟ ∟ leading_ticker | string | false | Leading stock ticker | +| ∟ ∟ leading_chg | string | false | Leading stock daily change (decimal) | +| ∟ ∟ value_name | string | false | Indicator label (may be empty depending on indicator type) | +| ∟ ∟ value_data | string | false | Indicator value (may be empty) | diff --git a/docs/en/docs/fundamental/fundamental/institution_rating_views.md b/docs/en/docs/fundamental/fundamental/institution_rating_views.md index 3c04d223..650054d5 100644 --- a/docs/en/docs/fundamental/fundamental/institution_rating_views.md +++ b/docs/en/docs/fundamental/fundamental/institution_rating_views.md @@ -234,11 +234,11 @@ func main() { | Name | Type | Required | Description | | ---- | ---- | -------- | ----------- | -| elist | array | false | Monthly rating distribution list, newest first | -| elist[].date | int64 | false | Unix timestamp (seconds) | -| elist[].buy | string | false | Buy rating count | -| elist[].over | string | false | Outperform rating count | -| elist[].hold | string | false | Hold rating count | -| elist[].under | string | false | Underperform rating count | -| elist[].sell | string | false | Sell rating count | -| elist[].total | string | false | Total analyst count | +| elist | object[] | false | Monthly rating distribution list, newest first | +| ∟ date | integer | false | Unix timestamp (seconds) | +| ∟ buy | string | false | Number of Buy ratings | +| ∟ over | string | false | Number of Outperform ratings | +| ∟ hold | string | false | Number of Hold ratings | +| ∟ under | string | false | Number of Underperform ratings | +| ∟ sell | string | false | Number of Sell ratings | +| ∟ total | string | false | Total analyst count | diff --git a/docs/zh-CN/docs/fundamental/fundamental/business_segments.md b/docs/zh-CN/docs/fundamental/fundamental/business_segments.md index 20a8214d..c62a59a9 100644 --- a/docs/zh-CN/docs/fundamental/fundamental/business_segments.md +++ b/docs/zh-CN/docs/fundamental/fundamental/business_segments.md @@ -224,9 +224,9 @@ func main() { | Name | Type | Required | Description | | ---- | ---- | -------- | ----------- | -| date | string | 否 | 报告期标签,例如 `2024Q4` | -| total | string | 否 | 当期总收入(字符串数值) | +| date | string | 否 | 报告期,格式 YYYYMMDD,例如 `20260331` | +| total | string | 否 | 当期总收入 | | currency | string | 否 | 货币代码,例如 `USD` | -| business | array | 否 | 业务分部列表 | -| business[].name | string | 否 | 业务分部名称 | -| business[].percent | string | 否 | 收入占比(0–1 小数) | +| business | object[] | 否 | 业务分部列表 | +| ∟ name | string | 否 | 业务分部名称 | +| ∟ percent | string | 否 | 收入占比(百分比,例如 `40.56`) | diff --git a/docs/zh-CN/docs/fundamental/fundamental/business_segments_history.md b/docs/zh-CN/docs/fundamental/fundamental/business_segments_history.md index 9edfd363..34dd189e 100644 --- a/docs/zh-CN/docs/fundamental/fundamental/business_segments_history.md +++ b/docs/zh-CN/docs/fundamental/fundamental/business_segments_history.md @@ -229,15 +229,15 @@ func main() { | Name | Type | Required | Description | | ---- | ---- | -------- | ----------- | -| historical | array | 否 | 历史报告期列表 | -| historical[].date | string | 否 | 报告期标签,例如 `2024Q4` | -| historical[].total | string | 否 | 当期总收入(字符串数值) | -| historical[].currency | string | 否 | 货币代码 | -| historical[].business | array | 否 | 业务分部列表 | -| historical[].business[].name | string | 否 | 业务分部名称 | -| historical[].business[].percent | string | 否 | 收入占比(0–1 小数) | -| historical[].business[].value | string | 否 | 绝对收入数值 | -| historical[].regionals | array | 否 | 地区分部列表 | -| historical[].regionals[].name | string | 否 | 地区名称 | -| historical[].regionals[].percent | string | 否 | 收入占比(0–1 小数) | -| historical[].regionals[].value | string | 否 | 绝对收入数值 | +| historical | object[] | 否 | 历史报告期列表 | +| ∟ date | string | 否 | 报告期,格式 YYYYMMDD,例如 `20260331` | +| ∟ total | string | 否 | 当期总收入 | +| ∟ currency | string | 否 | 货币代码 | +| ∟ business | object[] | 否 | 业务分部列表 | +| ∟ ∟ name | string | 否 | 业务分部名称 | +| ∟ ∟ percent | string | 否 | 收入占比(百分比,例如 `40.80`) | +| ∟ ∟ value | string | 否 | 绝对收入数值 | +| ∟ regionals | object[] | 否 | 地区分部列表(当前通常为空数组) | +| ∟ ∟ name | string | 否 | 地区名称 | +| ∟ ∟ percent | string | 否 | 收入占比(百分比) | +| ∟ ∟ value | string | 否 | 绝对收入数值 | diff --git a/docs/zh-CN/docs/fundamental/fundamental/financial_report_snapshot.md b/docs/zh-CN/docs/fundamental/fundamental/financial_report_snapshot.md index 5885142f..067268d0 100644 --- a/docs/zh-CN/docs/fundamental/fundamental/financial_report_snapshot.md +++ b/docs/zh-CN/docs/fundamental/fundamental/financial_report_snapshot.md @@ -232,30 +232,44 @@ func main() { | Name | Type | Required | Description | | ---- | ---- | -------- | ----------- | | name | string | 否 | 公司名称 | -| ticker | string | 否 | 证券代码 | -| fp_start | string | 否 | 财政期开始日期 | -| fp_end | string | 否 | 财政期结束日期 | +| ticker | string | 否 | 证券代码(不含市场后缀,例如 `AAPL`) | +| fp_start | string | 否 | 财政期开始日期,格式 `YYYY.MM.DD` | +| fp_end | string | 否 | 财政期结束日期,格式 `YYYY.MM.DD` | | currency | string | 否 | 货币代码 | -| report_desc | string | 否 | AI 生成的财报摘要文字 | -| fo_revenue | object | 否 | 营收预测对比 | -| fo_revenue.value | string | 否 | 实际营收 | -| fo_revenue.yoy | string | 否 | 同比增速(小数) | -| fo_revenue.cmp_desc | string | 否 | 超预期/低于预期描述 | -| fo_revenue.est_value | string | 否 | 一致预期值 | -| fo_ebit | object | 否 | EBIT 预测对比(字段同 fo_revenue) | -| fo_eps | object | 否 | EPS 预测对比(字段同 fo_revenue) | -| fr_revenue | object | 否 | 营收财务数据 | -| fr_revenue.value | string | 否 | 营收数值 | -| fr_revenue.yoy | string | 否 | 同比增速 | -| fr_profit | object | 否 | 净利润财务数据(字段同 fr_revenue) | -| fr_operate_cash | object | 否 | 经营现金流(字段同 fr_revenue) | -| fr_invest_cash | object | 否 | 投资现金流(字段同 fr_revenue) | -| fr_finance_cash | object | 否 | 融资现金流(字段同 fr_revenue) | -| fr_total_assets | object | 否 | 总资产(字段同 fr_revenue) | -| fr_total_liability | object | 否 | 总负债(字段同 fr_revenue) | -| fr_roe_ttm | string | 否 | 净资产收益率 TTM(小数) | -| fr_profit_margin | string | 否 | 净利率(小数) | -| fr_profit_margin_ttm | string | 否 | 净利率 TTM(小数) | -| fr_asset_turn_ttm | string | 否 | 资产周转率 TTM(小数) | -| fr_leverage_ttm | string | 否 | 杠杆率 TTM(小数) | -| fr_debt_assets_ratio | string | 否 | 资产负债率(小数) | +| report_desc | string | 否 | AI 生成的财报摘要 | +| fo_revenue | object | 否 | 营收预测对比,见 [ForecastMetric](#ForecastMetric) | +| fo_ebit | object | 否 | EBIT 预测对比,见 [ForecastMetric](#ForecastMetric) | +| fo_eps | object | 否 | EPS 预测对比,见 [ForecastMetric](#ForecastMetric) | +| fr_revenue | object | 否 | 营收财务数据,见 [ReportedMetric](#ReportedMetric) | +| fr_profit | object | 否 | 净利润财务数据,见 [ReportedMetric](#ReportedMetric) | +| fr_operate_cash | object | 否 | 经营现金流,见 [ReportedMetric](#ReportedMetric) | +| fr_invest_cash | object | 否 | 投资现金流,见 [ReportedMetric](#ReportedMetric) | +| fr_finance_cash | object | 否 | 融资现金流,见 [ReportedMetric](#ReportedMetric) | +| fr_total_assets | object | 否 | 总资产,见 [ReportedMetric](#ReportedMetric) | +| fr_total_liability | object | 否 | 总负债,见 [ReportedMetric](#ReportedMetric) | +| fr_roe_ttm | string | 否 | 净资产收益率 TTM(百分比,例如 `141.47`) | +| fr_profit_margin | string | 否 | 净利率(百分比) | +| fr_profit_margin_ttm | string | 否 | 净利率 TTM(百分比) | +| fr_asset_turn_ttm | string | 否 | 资产周转率 TTM(百分比) | +| fr_leverage_ttm | string | 否 | 杠杆率 TTM(百分比) | +| fr_debt_assets_ratio | string | 否 | 资产负债率(百分比) | + +### ForecastMetric + + + +| Name | Type | Required | Description | +| ---- | ---- | -------- | ----------- | +| value | string | 否 | 实际值 | +| yoy | string | 否 | 同比增速(百分比,例如 `16.6`) | +| cmp_desc | string | 否 | 超预期/低于预期描述(可能为空) | +| est_value | string | 否 | 一致预期值(可能为空) | + +### ReportedMetric + + + +| Name | Type | Required | Description | +| ---- | ---- | -------- | ----------- | +| value | string | 否 | 数值 | +| yoy | string | 否 | 同比增速(百分比) | diff --git a/docs/zh-CN/docs/fundamental/fundamental/industry_peers.md b/docs/zh-CN/docs/fundamental/fundamental/industry_peers.md index 94f134dd..41403f67 100644 --- a/docs/zh-CN/docs/fundamental/fundamental/industry_peers.md +++ b/docs/zh-CN/docs/fundamental/fundamental/industry_peers.md @@ -233,13 +233,27 @@ func main() { | Name | Type | Required | Description | | ---- | ---- | -------- | ----------- | -| top | object | 否 | 顶层行业信息 | -| top.name | string | 否 | 顶层行业名称 | -| top.market | string | 否 | 市场代码 | -| chain | object | 否 | 行业层级树根节点 | -| chain.name | string | 否 | 板块名称 | -| chain.counter_id | string | 否 | 板块唯一标识 | -| chain.stock_num | integer | 否 | 板块内股票数量 | -| chain.chg | string | 否 | 当日涨跌幅(小数) | -| chain.ytd_chg | string | 否 | 年初至今涨跌幅(小数) | -| chain.next | array | 否 | 子板块列表(结构与 chain 相同,递归) | +| top | object | 否 | 顶层行业信息,见 [IndustryPeersTop](#IndustryPeersTop) | +| chain | object | 否 | 行业层级树根节点,见 [IndustryPeerNode](#IndustryPeerNode) | + +### IndustryPeersTop + + + +| Name | Type | Required | Description | +| ---- | ---- | -------- | ----------- | +| name | string | 否 | 顶层行业名称 | +| market | string | 否 | 市场代码 | + +### IndustryPeerNode + + + +| Name | Type | Required | Description | +| ---- | ---- | -------- | ----------- | +| name | string | 否 | 板块名称 | +| counter_id | string | 否 | 板块唯一标识(根节点有值,子节点为空字符串) | +| stock_num | integer | 否 | 板块内股票数量 | +| chg | string | 否 | 当日涨跌幅(小数,可能为空字符串) | +| ytd_chg | string | 否 | 年初至今涨跌幅(小数,可能为空字符串) | +| next | object[] | 否 | 子板块列表,结构与当前节点相同(递归) | diff --git a/docs/zh-CN/docs/fundamental/fundamental/industry_rank.md b/docs/zh-CN/docs/fundamental/fundamental/industry_rank.md index 3c68e8cb..604eaee7 100644 --- a/docs/zh-CN/docs/fundamental/fundamental/industry_rank.md +++ b/docs/zh-CN/docs/fundamental/fundamental/industry_rank.md @@ -233,13 +233,13 @@ func main() { | Name | Type | Required | Description | | ---- | ---- | -------- | ----------- | -| items | array | 否 | 排行分组列表 | -| items[].lists | array | 否 | 行业条目列表 | -| items[].lists[].name | string | 否 | 行业名称 | -| items[].lists[].counter_id | string | 否 | 行业唯一标识(BK/市场/ID 格式),可传入 `industry_peers` | -| items[].lists[].chg | string | 否 | 当日涨跌幅(小数) | -| items[].lists[].leading_name | string | 否 | 涨幅领先个股名称 | -| items[].lists[].leading_ticker | string | 否 | 涨幅领先个股代码 | -| items[].lists[].leading_chg | string | 否 | 涨幅领先个股涨跌幅 | -| items[].lists[].value_name | string | 否 | 指标名称(按指标类型填充) | -| items[].lists[].value_data | string | 否 | 指标数值 | +| items | object[] | 否 | 排行分组列表 | +| ∟ lists | object[] | 否 | 行业条目列表 | +| ∟ ∟ name | string | 否 | 行业名称 | +| ∟ ∟ counter_id | string | 否 | 行业唯一标识(`BK/市场/ID` 格式),可直接传入 `industry_peers` | +| ∟ ∟ chg | string | 否 | 当日涨跌幅(小数) | +| ∟ ∟ leading_name | string | 否 | 涨幅领先个股名称 | +| ∟ ∟ leading_ticker | string | 否 | 涨幅领先个股代码 | +| ∟ ∟ leading_chg | string | 否 | 涨幅领先个股涨跌幅(小数) | +| ∟ ∟ value_name | string | 否 | 指标名称(按指标类型填充,可能为空) | +| ∟ ∟ value_data | string | 否 | 指标数值(可能为空) | diff --git a/docs/zh-CN/docs/fundamental/fundamental/institution_rating_views.md b/docs/zh-CN/docs/fundamental/fundamental/institution_rating_views.md index be217d95..e8e57988 100644 --- a/docs/zh-CN/docs/fundamental/fundamental/institution_rating_views.md +++ b/docs/zh-CN/docs/fundamental/fundamental/institution_rating_views.md @@ -234,11 +234,11 @@ func main() { | Name | Type | Required | Description | | ---- | ---- | -------- | ----------- | -| elist | array | 否 | 月度评级分布列表,最新月份在前 | -| elist[].date | int64 | 否 | Unix 时间戳(秒) | -| elist[].buy | string | 否 | 买入评级数量 | -| elist[].over | string | 否 | 跑赢市场评级数量 | -| elist[].hold | string | 否 | 持有评级数量 | -| elist[].under | string | 否 | 跑输市场评级数量 | -| elist[].sell | string | 否 | 卖出评级数量 | -| elist[].total | string | 否 | 机构总数 | +| elist | object[] | 否 | 月度评级分布列表,最新月份在前 | +| ∟ date | integer | 否 | Unix 时间戳(秒) | +| ∟ buy | string | 否 | 买入评级数量 | +| ∟ over | string | 否 | 跑赢市场评级数量 | +| ∟ hold | string | 否 | 持有评级数量 | +| ∟ under | string | 否 | 跑输市场评级数量 | +| ∟ sell | string | 否 | 卖出评级数量 | +| ∟ total | string | 否 | 机构总数 | diff --git a/docs/zh-HK/docs/fundamental/fundamental/business_segments.md b/docs/zh-HK/docs/fundamental/fundamental/business_segments.md index 861d0ba1..7f518ba6 100644 --- a/docs/zh-HK/docs/fundamental/fundamental/business_segments.md +++ b/docs/zh-HK/docs/fundamental/fundamental/business_segments.md @@ -224,9 +224,9 @@ func main() { | Name | Type | Required | Description | | ---- | ---- | -------- | ----------- | -| date | string | 否 | 報告期標籤,例如 `2024Q4` | -| total | string | 否 | 當期總收入(字串數值) | +| date | string | 否 | 報告期,格式 YYYYMMDD,例如 `20260331` | +| total | string | 否 | 當期總收入 | | currency | string | 否 | 貨幣代碼,例如 `USD` | -| business | array | 否 | 業務分部列表 | -| business[].name | string | 否 | 業務分部名稱 | -| business[].percent | string | 否 | 收入佔比(0–1 小數) | +| business | object[] | 否 | 業務分部列表 | +| ∟ name | string | 否 | 業務分部名稱 | +| ∟ percent | string | 否 | 收入佔比(百分比,例如 `40.56`) | diff --git a/docs/zh-HK/docs/fundamental/fundamental/business_segments_history.md b/docs/zh-HK/docs/fundamental/fundamental/business_segments_history.md index 1dd3c44c..51b2e7c4 100644 --- a/docs/zh-HK/docs/fundamental/fundamental/business_segments_history.md +++ b/docs/zh-HK/docs/fundamental/fundamental/business_segments_history.md @@ -229,15 +229,15 @@ func main() { | Name | Type | Required | Description | | ---- | ---- | -------- | ----------- | -| historical | array | 否 | 歷史報告期列表 | -| historical[].date | string | 否 | 報告期標籤,例如 `2024Q4` | -| historical[].total | string | 否 | 當期總收入(字串數值) | -| historical[].currency | string | 否 | 貨幣代碼 | -| historical[].business | array | 否 | 業務分部列表 | -| historical[].business[].name | string | 否 | 業務分部名稱 | -| historical[].business[].percent | string | 否 | 收入佔比(0–1 小數) | -| historical[].business[].value | string | 否 | 絕對收入數值 | -| historical[].regionals | array | 否 | 地區分部列表 | -| historical[].regionals[].name | string | 否 | 地區名稱 | -| historical[].regionals[].percent | string | 否 | 收入佔比(0–1 小數) | -| historical[].regionals[].value | string | 否 | 絕對收入數值 | +| historical | object[] | 否 | 歷史報告期列表 | +| ∟ date | string | 否 | 報告期,格式 YYYYMMDD,例如 `20260331` | +| ∟ total | string | 否 | 當期總收入 | +| ∟ currency | string | 否 | 貨幣代碼 | +| ∟ business | object[] | 否 | 業務分部列表 | +| ∟ ∟ name | string | 否 | 業務分部名稱 | +| ∟ ∟ percent | string | 否 | 收入佔比(百分比,例如 `40.80`) | +| ∟ ∟ value | string | 否 | 絕對收入數值 | +| ∟ regionals | object[] | 否 | 地區分部列表(當前通常為空數組) | +| ∟ ∟ name | string | 否 | 地區名稱 | +| ∟ ∟ percent | string | 否 | 收入佔比(百分比) | +| ∟ ∟ value | string | 否 | 絕對收入數值 | diff --git a/docs/zh-HK/docs/fundamental/fundamental/financial_report_snapshot.md b/docs/zh-HK/docs/fundamental/fundamental/financial_report_snapshot.md index e9d02aff..e88f4ec8 100644 --- a/docs/zh-HK/docs/fundamental/fundamental/financial_report_snapshot.md +++ b/docs/zh-HK/docs/fundamental/fundamental/financial_report_snapshot.md @@ -232,30 +232,44 @@ func main() { | Name | Type | Required | Description | | ---- | ---- | -------- | ----------- | | name | string | 否 | 公司名稱 | -| ticker | string | 否 | 證券代碼 | -| fp_start | string | 否 | 財政期開始日期 | -| fp_end | string | 否 | 財政期結束日期 | +| ticker | string | 否 | 證券代碼(不含市場後綴,例如 `AAPL`) | +| fp_start | string | 否 | 財政期開始日期,格式 `YYYY.MM.DD` | +| fp_end | string | 否 | 財政期結束日期,格式 `YYYY.MM.DD` | | currency | string | 否 | 貨幣代碼 | -| report_desc | string | 否 | AI 生成的財報摘要文字 | -| fo_revenue | object | 否 | 營收預測對比 | -| fo_revenue.value | string | 否 | 實際營收 | -| fo_revenue.yoy | string | 否 | 同比增速(小數) | -| fo_revenue.cmp_desc | string | 否 | 超預期/低於預期描述 | -| fo_revenue.est_value | string | 否 | 一致預期值 | -| fo_ebit | object | 否 | EBIT 預測對比(欄位同 fo_revenue) | -| fo_eps | object | 否 | EPS 預測對比(欄位同 fo_revenue) | -| fr_revenue | object | 否 | 營收財務數據 | -| fr_revenue.value | string | 否 | 營收數值 | -| fr_revenue.yoy | string | 否 | 同比增速 | -| fr_profit | object | 否 | 淨利潤財務數據(欄位同 fr_revenue) | -| fr_operate_cash | object | 否 | 經營現金流(欄位同 fr_revenue) | -| fr_invest_cash | object | 否 | 投資現金流(欄位同 fr_revenue) | -| fr_finance_cash | object | 否 | 融資現金流(欄位同 fr_revenue) | -| fr_total_assets | object | 否 | 總資產(欄位同 fr_revenue) | -| fr_total_liability | object | 否 | 總負債(欄位同 fr_revenue) | -| fr_roe_ttm | string | 否 | 淨資產收益率 TTM(小數) | -| fr_profit_margin | string | 否 | 淨利率(小數) | -| fr_profit_margin_ttm | string | 否 | 淨利率 TTM(小數) | -| fr_asset_turn_ttm | string | 否 | 資產週轉率 TTM(小數) | -| fr_leverage_ttm | string | 否 | 槓桿率 TTM(小數) | -| fr_debt_assets_ratio | string | 否 | 資產負債率(小數) | +| report_desc | string | 否 | AI 生成的財報摘要 | +| fo_revenue | object | 否 | 營收預測對比,見 [ForecastMetric](#ForecastMetric) | +| fo_ebit | object | 否 | EBIT 預測對比,見 [ForecastMetric](#ForecastMetric) | +| fo_eps | object | 否 | EPS 預測對比,見 [ForecastMetric](#ForecastMetric) | +| fr_revenue | object | 否 | 營收財務數據,見 [ReportedMetric](#ReportedMetric) | +| fr_profit | object | 否 | 淨利潤財務數據,見 [ReportedMetric](#ReportedMetric) | +| fr_operate_cash | object | 否 | 經營現金流,見 [ReportedMetric](#ReportedMetric) | +| fr_invest_cash | object | 否 | 投資現金流,見 [ReportedMetric](#ReportedMetric) | +| fr_finance_cash | object | 否 | 融資現金流,見 [ReportedMetric](#ReportedMetric) | +| fr_total_assets | object | 否 | 總資產,見 [ReportedMetric](#ReportedMetric) | +| fr_total_liability | object | 否 | 總負債,見 [ReportedMetric](#ReportedMetric) | +| fr_roe_ttm | string | 否 | 淨資產收益率 TTM(百分比,例如 `141.47`) | +| fr_profit_margin | string | 否 | 淨利率(百分比) | +| fr_profit_margin_ttm | string | 否 | 淨利率 TTM(百分比) | +| fr_asset_turn_ttm | string | 否 | 資產周轉率 TTM(百分比) | +| fr_leverage_ttm | string | 否 | 槓桿率 TTM(百分比) | +| fr_debt_assets_ratio | string | 否 | 資產負債率(百分比) | + +### ForecastMetric + + + +| Name | Type | Required | Description | +| ---- | ---- | -------- | ----------- | +| value | string | 否 | 實際值 | +| yoy | string | 否 | 同比增速(百分比,例如 `16.6`) | +| cmp_desc | string | 否 | 超預期/低於預期描述(可能為空) | +| est_value | string | 否 | 一致預期值(可能為空) | + +### ReportedMetric + + + +| Name | Type | Required | Description | +| ---- | ---- | -------- | ----------- | +| value | string | 否 | 數值 | +| yoy | string | 否 | 同比增速(百分比) | diff --git a/docs/zh-HK/docs/fundamental/fundamental/industry_peers.md b/docs/zh-HK/docs/fundamental/fundamental/industry_peers.md index 8d728650..7012084b 100644 --- a/docs/zh-HK/docs/fundamental/fundamental/industry_peers.md +++ b/docs/zh-HK/docs/fundamental/fundamental/industry_peers.md @@ -233,13 +233,27 @@ func main() { | Name | Type | Required | Description | | ---- | ---- | -------- | ----------- | -| top | object | 否 | 頂層行業資訊 | -| top.name | string | 否 | 頂層行業名稱 | -| top.market | string | 否 | 市場代碼 | -| chain | object | 否 | 行業層級樹根節點 | -| chain.name | string | 否 | 板塊名稱 | -| chain.counter_id | string | 否 | 板塊唯一標識 | -| chain.stock_num | integer | 否 | 板塊內股票數量 | -| chain.chg | string | 否 | 當日漲跌幅(小數) | -| chain.ytd_chg | string | 否 | 年初至今漲跌幅(小數) | -| chain.next | array | 否 | 子板塊列表(結構與 chain 相同,遞迴) | +| top | object | 否 | 頂層行業資訊,見 [IndustryPeersTop](#IndustryPeersTop) | +| chain | object | 否 | 行業層級樹根節點,見 [IndustryPeerNode](#IndustryPeerNode) | + +### IndustryPeersTop + + + +| Name | Type | Required | Description | +| ---- | ---- | -------- | ----------- | +| name | string | 否 | 頂層行業名稱 | +| market | string | 否 | 市場代碼 | + +### IndustryPeerNode + + + +| Name | Type | Required | Description | +| ---- | ---- | -------- | ----------- | +| name | string | 否 | 板塊名稱 | +| counter_id | string | 否 | 板塊唯一標識(根節點有值,子節點為空字串) | +| stock_num | integer | 否 | 板塊內股票數量 | +| chg | string | 否 | 當日漲跌幅(小數,可能為空字串) | +| ytd_chg | string | 否 | 年初至今漲跌幅(小數,可能為空字串) | +| next | object[] | 否 | 子板塊列表,結構與當前節點相同(遞迴) | diff --git a/docs/zh-HK/docs/fundamental/fundamental/industry_rank.md b/docs/zh-HK/docs/fundamental/fundamental/industry_rank.md index d16eba30..6dabcf30 100644 --- a/docs/zh-HK/docs/fundamental/fundamental/industry_rank.md +++ b/docs/zh-HK/docs/fundamental/fundamental/industry_rank.md @@ -233,13 +233,13 @@ func main() { | Name | Type | Required | Description | | ---- | ---- | -------- | ----------- | -| items | array | 否 | 排行分組列表 | -| items[].lists | array | 否 | 行業條目列表 | -| items[].lists[].name | string | 否 | 行業名稱 | -| items[].lists[].counter_id | string | 否 | 行業唯一標識(BK/市場/ID 格式),可傳入 `industry_peers` | -| items[].lists[].chg | string | 否 | 當日漲跌幅(小數) | -| items[].lists[].leading_name | string | 否 | 漲幅領先個股名稱 | -| items[].lists[].leading_ticker | string | 否 | 漲幅領先個股代碼 | -| items[].lists[].leading_chg | string | 否 | 漲幅領先個股漲跌幅 | -| items[].lists[].value_name | string | 否 | 指標名稱(按指標類型填充) | -| items[].lists[].value_data | string | 否 | 指標數值 | +| items | object[] | 否 | 排行分組列表 | +| ∟ lists | object[] | 否 | 行業條目列表 | +| ∟ ∟ name | string | 否 | 行業名稱 | +| ∟ ∟ counter_id | string | 否 | 行業唯一標識(`BK/市場/ID` 格式),可直接傳入 `industry_peers` | +| ∟ ∟ chg | string | 否 | 當日漲跌幅(小數) | +| ∟ ∟ leading_name | string | 否 | 漲幅領先個股名稱 | +| ∟ ∟ leading_ticker | string | 否 | 漲幅領先個股代碼 | +| ∟ ∟ leading_chg | string | 否 | 漲幅領先個股漲跌幅(小數) | +| ∟ ∟ value_name | string | 否 | 指標名稱(按指標類型填充,可能為空) | +| ∟ ∟ value_data | string | 否 | 指標數值(可能為空) | diff --git a/docs/zh-HK/docs/fundamental/fundamental/institution_rating_views.md b/docs/zh-HK/docs/fundamental/fundamental/institution_rating_views.md index dc23c755..bc69d671 100644 --- a/docs/zh-HK/docs/fundamental/fundamental/institution_rating_views.md +++ b/docs/zh-HK/docs/fundamental/fundamental/institution_rating_views.md @@ -234,11 +234,11 @@ func main() { | Name | Type | Required | Description | | ---- | ---- | -------- | ----------- | -| elist | array | 否 | 月度評級分佈列表,最新月份在前 | -| elist[].date | int64 | 否 | Unix 時間戳(秒) | -| elist[].buy | string | 否 | 買入評級數量 | -| elist[].over | string | 否 | 跑贏市場評級數量 | -| elist[].hold | string | 否 | 持有評級數量 | -| elist[].under | string | 否 | 跑輸市場評級數量 | -| elist[].sell | string | 否 | 賣出評級數量 | -| elist[].total | string | 否 | 機構總數 | +| elist | object[] | 否 | 月度評級分佈列表,最新月份在前 | +| ∟ date | integer | 否 | Unix 時間戳(秒) | +| ∟ buy | string | 否 | 買入評級數量 | +| ∟ over | string | 否 | 跑贏市場評級數量 | +| ∟ hold | string | 否 | 持有評級數量 | +| ∟ under | string | 否 | 跑輸市場評級數量 | +| ∟ sell | string | 否 | 賣出評級數量 | +| ∟ total | string | 否 | 機構總數 |