From 61f099950fd504e61b1811a151d08a9a2bbc914a Mon Sep 17 00:00:00 2001 From: Tian Deng Date: Tue, 30 Jun 2026 16:19:35 +0800 Subject: [PATCH 1/2] fix(docs): update calendar finance_calendar code examples and add missing translations --- .../docs/market/calendar/dividend_calendar.md | 136 ++++---- .../docs/market/calendar/earnings_calendar.md | 138 ++++---- docs/en/docs/market/calendar/ipo_calendar.md | 136 ++++---- .../en/docs/market/calendar/macro_calendar.md | 142 ++++---- .../docs/market/calendar/meeting_calendar.md | 228 ++++++++++--- .../en/docs/market/calendar/merge_calendar.md | 228 ++++++++++--- .../en/docs/market/calendar/split_calendar.md | 144 +++++---- .../docs/market/calendar/dividend_calendar.md | 138 ++++---- .../docs/market/calendar/earnings_calendar.md | 140 ++++---- .../docs/market/calendar/ipo_calendar.md | 138 ++++---- .../docs/market/calendar/macro_calendar.md | 144 +++++---- .../docs/market/calendar/meeting_calendar.md | 306 ++++++++++++++++++ .../docs/market/calendar/merge_calendar.md | 306 ++++++++++++++++++ .../docs/market/calendar/split_calendar.md | 146 +++++---- .../docs/market/calendar/dividend_calendar.md | 138 ++++---- .../docs/market/calendar/earnings_calendar.md | 140 ++++---- .../docs/market/calendar/ipo_calendar.md | 138 ++++---- .../docs/market/calendar/macro_calendar.md | 144 +++++---- .../docs/market/calendar/meeting_calendar.md | 306 ++++++++++++++++++ .../docs/market/calendar/merge_calendar.md | 306 ++++++++++++++++++ .../docs/market/calendar/split_calendar.md | 146 +++++---- 21 files changed, 2853 insertions(+), 935 deletions(-) create mode 100644 docs/zh-CN/docs/market/calendar/meeting_calendar.md create mode 100644 docs/zh-CN/docs/market/calendar/merge_calendar.md create mode 100644 docs/zh-HK/docs/market/calendar/meeting_calendar.md create mode 100644 docs/zh-HK/docs/market/calendar/merge_calendar.md diff --git a/docs/en/docs/market/calendar/dividend_calendar.md b/docs/en/docs/market/calendar/dividend_calendar.md index e82654ec..c383baae 100644 --- a/docs/en/docs/market/calendar/dividend_calendar.md +++ b/docs/en/docs/market/calendar/dividend_calendar.md @@ -19,16 +19,15 @@ longbridge finance-calendar dividend --filter positions - ## Parameters > **SDK method parameters.** -| Name | Type | Required | Description | -| ---- | ---- | -------- | ----------- | -| start | string | YES | Start date, YYYY-MM-DD | -| end | string | YES | End date, YYYY-MM-DD | -| market | string | NO | Market filter: `US`, `HK`, `SH`, `SZ`. Omit for all. | +| Name | Type | Required | Description | +| ------ | ------ | -------- | ---------------------------------------------------- | +| start | string | YES | Start date, YYYY-MM-DD | +| end | string | YES | End date, YYYY-MM-DD | +| market | string | NO | Market filter: `US`, `HK`, `SH`, `SZ`. Omit for all. | ## Request Example @@ -36,14 +35,24 @@ longbridge finance-calendar dividend --filter positions ```python -from longbridge.openapi import CalendarContext, Config, OAuthBuilder +from longbridge.openapi import ( + CalendarCategory, + CalendarContext, + Config, + OAuthBuilder, +) oauth = OAuthBuilder("your-client-id").build(lambda url: print("Visit:", url)) config = Config.from_oauth(oauth) ctx = CalendarContext(config) -resp = ctx.dividend_calendar("AAPL.US") -print(resp) +resp = ctx.finance_calendar( + CalendarCategory.Dividend, "2026-06-30", "2026-06-30", "US" +) + +for group in resp.list: + for info in group.infos: + print(f" - {info.symbol:12} | {info.counter_name} | {info.date}") ``` @@ -51,15 +60,27 @@ print(resp) ```python import asyncio -from longbridge.openapi import AsyncCalendarContext, Config, OAuthBuilder +from longbridge.openapi import ( + AsyncCalendarContext, + CalendarCategory, + Config, + OAuthBuilder, +) async def main() -> None: - oauth = await OAuthBuilder("your-client-id").build_async(lambda url: print("Visit:", url)) + oauth = await OAuthBuilder("your-client-id").build_async( + lambda url: print("Visit:", url) + ) config = Config.from_oauth(oauth) ctx = AsyncCalendarContext.create(config) - resp = await ctx.dividend_calendar("AAPL.US") - print(resp) + resp = await ctx.finance_calendar( + CalendarCategory.Dividend, "2026-06-30", "2026-06-30", "US" + ) + + for group in resp.list: + for info in group.infos: + print(f" - {info.symbol:12} | {info.counter_name} | {info.date}") if __name__ == "__main__": asyncio.run(main()) @@ -69,7 +90,7 @@ if __name__ == "__main__": ```javascript -const { Config, CalendarContext, OAuth } = require('longbridge') +const { CalendarCategory, CalendarContext, Config, OAuth } = require('longbridge') async function main() { const oauth = await OAuth.build('your-client-id', (_, url) => { @@ -77,7 +98,7 @@ async function main() { }) const config = Config.fromOAuth(oauth) const ctx = CalendarContext.new(config) - const resp = await ctx.dividend_calendar('AAPL.US') + const resp = await ctx.financeCalendar(CalendarCategory.Dividend, '2026-06-30', '2026-06-30', 'US') console.log(resp) } main().catch(console.error) @@ -95,7 +116,12 @@ class Main { try (OAuth oauth = new OAuthBuilder("your-client-id").build(url -> System.out.println("Open to authorize: " + url)).get(); Config config = Config.fromOAuth(oauth); CalendarContext ctx = CalendarContext.create(config)) { - var resp = ctx.getDividendCalendar("AAPL.US").get(); + FinanceCalendarOptions opts = new FinanceCalendarOptions(); + opts.category = CalendarCategory.Dividend; + opts.start = "2026-06-30"; + opts.end = "2026-06-30"; + opts.market = "US"; + var resp = ctx.getFinanceCalendar(opts).get(); System.out.println(resp); } } @@ -107,14 +133,14 @@ class Main { ```rust use std::sync::Arc; -use longbridge::{oauth::OAuthBuilder, calendar::CalendarContext, Config}; +use longbridge::{oauth::OAuthBuilder, calendar::{CalendarCategory, CalendarContext}, 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 = CalendarContext::new(config); - let resp = ctx.dividend_calendar("AAPL.US").await?; + let resp = ctx.finance_calendar(CalendarCategory::Dividend, "2026-06-30", "2026-06-30", Some("US".to_string())).await?; println!("{:?}", resp); Ok(()) } @@ -137,7 +163,7 @@ int main() { if (!res) return; Config config = Config::from_oauth(*res); CalendarContext ctx = CalendarContext::create(config); - ctx.dividend_calendar("AAPL.US", [](auto resp) { + ctx.finance_calendar(CalendarCategory::Dividend, "2026-06-30", "2026-06-30", "US", [](auto resp) { if (resp) std::cout << "OK" << std::endl; }); }); @@ -156,9 +182,9 @@ import ( "fmt" "log" + "github.com/longbridge/openapi-go/calendar" "github.com/longbridge/openapi-go/config" "github.com/longbridge/openapi-go/oauth" - "github.com/longbridge/openapi-go/calendar" ) func main() { @@ -176,7 +202,8 @@ func main() { log.Fatal(err) } defer c.Close() - resp, err := c.DividendCalendar(context.Background(), "AAPL.US") + market := "US" + resp, err := c.FinanceCalendar(context.Background(), calendar.CalendarCategoryDividend, "2026-06-30", "2026-06-30", &market) if err != nil { log.Fatal(err) } @@ -189,7 +216,6 @@ func main() { ## Response - ### Response Example ```json @@ -197,10 +223,10 @@ func main() { "code": 0, "message": "success", "data": { - "date": "2026-04-30", + "date": "2026-06-30", "list": [ { - "date": "2026-04-30", + "date": "2026-06-30", "count": 275, "infos": [ { @@ -210,7 +236,7 @@ func main() { "counter_name": "Apple Inc.", "event_type": "", "activity_type": "", - "date": "2026-05-14", + "date": "2026-06-30", "datetime": "", "content": "", "star": 0, @@ -230,10 +256,10 @@ func main() { ### Response Status -| Status | Description | Schema | -| ------ | ----------- | ------ | +| Status | Description | Schema | +| ------ | ----------- | ------------------------------------------------- | | 200 | Success | [CalendarEventsResponse](#CalendarEventsResponse) | -| 400 | Bad request | None | +| 400 | Bad request | None | ## Schemas @@ -241,40 +267,40 @@ func main() { -| Name | Type | Required | Description | -| ---- | ---- | -------- | ----------- | -| date | string | false | Response date | -| list | object[] | true | List of calendar date groups, see [CalendarDateGroup](#CalendarDateGroup) | +| Name | Type | Required | Description | +| ---- | -------- | -------- | ------------------------------------------------------------------------- | +| date | string | false | Response date | +| list | object[] | true | List of calendar date groups, see [CalendarDateGroup](#CalendarDateGroup) | ### CalendarDateGroup -| Name | Type | Required | Description | -| ---- | ---- | -------- | ----------- | -| date | string | true | Date | -| count | integer | false | Number of events on this date | -| infos | object[] | true | List of calendar events, see [CalendarEventInfo](#CalendarEventInfo) | +| Name | Type | Required | Description | +| ----- | -------- | -------- | -------------------------------------------------------------------- | +| date | string | true | Date | +| count | integer | false | Number of events on this date | +| infos | object[] | true | List of calendar events, see [CalendarEventInfo](#CalendarEventInfo) | ### CalendarEventInfo -| Name | Type | Required | Description | -| ---- | ---- | -------- | ----------- | -| id | string | false | Event ID | -| symbol | string | false | Security symbol | -| market | string | false | Market | -| counter_name | string | false | Security name | -| event_type | string | false | Event type | -| activity_type | string | false | Activity type | -| date | string | false | Event date | -| datetime | string | false | Event datetime | -| date_type | string | false | Date type | -| content | string | false | Event content description | -| currency | string | false | Currency | -| star | integer | false | Importance rating (1-3) | -| icon | string | false | Icon URL | -| chart_uid | string | false | Chart identifier | -| financial_market_time | string | false | Financial market time | -| data_kv | object[] | false | Key-value data pairs | +| Name | Type | Required | Description | +| --------------------- | -------- | -------- | ------------------------- | +| id | string | false | Event ID | +| symbol | string | false | Security symbol | +| market | string | false | Market | +| counter_name | string | false | Security name | +| event_type | string | false | Event type | +| activity_type | string | false | Activity type | +| date | string | false | Event date | +| datetime | string | false | Event datetime | +| date_type | string | false | Date type | +| content | string | false | Event content description | +| currency | string | false | Currency | +| star | integer | false | Importance rating (1-3) | +| icon | string | false | Icon URL | +| chart_uid | string | false | Chart identifier | +| financial_market_time | string | false | Financial market time | +| data_kv | object[] | false | Key-value data pairs | diff --git a/docs/en/docs/market/calendar/earnings_calendar.md b/docs/en/docs/market/calendar/earnings_calendar.md index 4e2cee97..500cfe7f 100644 --- a/docs/en/docs/market/calendar/earnings_calendar.md +++ b/docs/en/docs/market/calendar/earnings_calendar.md @@ -19,16 +19,15 @@ longbridge finance-calendar report --market US - ## Parameters > **SDK method parameters.** -| Name | Type | Required | Description | -| ---- | ---- | -------- | ----------- | -| start | string | YES | Start date, YYYY-MM-DD | -| end | string | YES | End date, YYYY-MM-DD | -| market | string | NO | Market filter: `US`, `HK`, `SH`, `SZ`. Omit for all. | +| Name | Type | Required | Description | +| ------ | ------ | -------- | ---------------------------------------------------- | +| start | string | YES | Start date, YYYY-MM-DD | +| end | string | YES | End date, YYYY-MM-DD | +| market | string | NO | Market filter: `US`, `HK`, `SH`, `SZ`. Omit for all. | ## Request Example @@ -36,14 +35,24 @@ longbridge finance-calendar report --market US ```python -from longbridge.openapi import CalendarContext, Config, OAuthBuilder +from longbridge.openapi import ( + CalendarCategory, + CalendarContext, + Config, + OAuthBuilder, +) oauth = OAuthBuilder("your-client-id").build(lambda url: print("Visit:", url)) config = Config.from_oauth(oauth) ctx = CalendarContext(config) -resp = ctx.earnings_calendar("AAPL.US") -print(resp) +resp = ctx.finance_calendar( + CalendarCategory.Report, "2026-06-30", "2026-06-30", "US" +) + +for group in resp.list: + for info in group.infos: + print(f" - {info.symbol:12} | {info.counter_name} | {info.date}") ``` @@ -51,15 +60,27 @@ print(resp) ```python import asyncio -from longbridge.openapi import AsyncCalendarContext, Config, OAuthBuilder +from longbridge.openapi import ( + AsyncCalendarContext, + CalendarCategory, + Config, + OAuthBuilder, +) async def main() -> None: - oauth = await OAuthBuilder("your-client-id").build_async(lambda url: print("Visit:", url)) + oauth = await OAuthBuilder("your-client-id").build_async( + lambda url: print("Visit:", url) + ) config = Config.from_oauth(oauth) ctx = AsyncCalendarContext.create(config) - resp = await ctx.earnings_calendar("AAPL.US") - print(resp) + resp = await ctx.finance_calendar( + CalendarCategory.Report, "2026-06-30", "2026-06-30", "US" + ) + + for group in resp.list: + for info in group.infos: + print(f" - {info.symbol:12} | {info.counter_name} | {info.date}") if __name__ == "__main__": asyncio.run(main()) @@ -69,7 +90,7 @@ if __name__ == "__main__": ```javascript -const { Config, CalendarContext, OAuth } = require('longbridge') +const { CalendarCategory, CalendarContext, Config, OAuth } = require('longbridge') async function main() { const oauth = await OAuth.build('your-client-id', (_, url) => { @@ -77,7 +98,7 @@ async function main() { }) const config = Config.fromOAuth(oauth) const ctx = CalendarContext.new(config) - const resp = await ctx.earnings_calendar('AAPL.US') + const resp = await ctx.financeCalendar(CalendarCategory.Report, '2026-06-30', '2026-06-30', 'US') console.log(resp) } main().catch(console.error) @@ -95,7 +116,12 @@ class Main { try (OAuth oauth = new OAuthBuilder("your-client-id").build(url -> System.out.println("Open to authorize: " + url)).get(); Config config = Config.fromOAuth(oauth); CalendarContext ctx = CalendarContext.create(config)) { - var resp = ctx.getEarningsCalendar("AAPL.US").get(); + FinanceCalendarOptions opts = new FinanceCalendarOptions(); + opts.category = CalendarCategory.Report; + opts.start = "2026-06-30"; + opts.end = "2026-06-30"; + opts.market = "US"; + var resp = ctx.getFinanceCalendar(opts).get(); System.out.println(resp); } } @@ -107,14 +133,14 @@ class Main { ```rust use std::sync::Arc; -use longbridge::{oauth::OAuthBuilder, calendar::CalendarContext, Config}; +use longbridge::{oauth::OAuthBuilder, calendar::{CalendarCategory, CalendarContext}, 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 = CalendarContext::new(config); - let resp = ctx.earnings_calendar("AAPL.US").await?; + let resp = ctx.finance_calendar(CalendarCategory::Report, "2026-06-30", "2026-06-30", Some("US".to_string())).await?; println!("{:?}", resp); Ok(()) } @@ -137,7 +163,7 @@ int main() { if (!res) return; Config config = Config::from_oauth(*res); CalendarContext ctx = CalendarContext::create(config); - ctx.earnings_calendar("AAPL.US", [](auto resp) { + ctx.finance_calendar(CalendarCategory::Report, "2026-06-30", "2026-06-30", "US", [](auto resp) { if (resp) std::cout << "OK" << std::endl; }); }); @@ -156,9 +182,9 @@ import ( "fmt" "log" + "github.com/longbridge/openapi-go/calendar" "github.com/longbridge/openapi-go/config" "github.com/longbridge/openapi-go/oauth" - "github.com/longbridge/openapi-go/calendar" ) func main() { @@ -176,7 +202,8 @@ func main() { log.Fatal(err) } defer c.Close() - resp, err := c.EarningsCalendar(context.Background(), "AAPL.US") + market := "US" + resp, err := c.FinanceCalendar(context.Background(), calendar.CalendarCategoryReport, "2026-06-30", "2026-06-30", &market) if err != nil { log.Fatal(err) } @@ -189,7 +216,6 @@ func main() { ## Response - ### Response Example ```json @@ -197,11 +223,11 @@ func main() { "code": 0, "message": "success", "data": { - "date": "2026-04-30", + "date": "2026-06-30", "list": [ { - "date": "2026-04-30", - "count": 2228, + "date": "2026-06-30", + "count": 1, "infos": [ { "id": "12345", @@ -210,7 +236,7 @@ func main() { "counter_name": "Apple Inc.", "event_type": "", "activity_type": "", - "date": "2026-05-14", + "date": "2026-06-30", "datetime": "", "content": "", "star": 0, @@ -230,10 +256,10 @@ func main() { ### Response Status -| Status | Description | Schema | -| ------ | ----------- | ------ | +| Status | Description | Schema | +| ------ | ----------- | ------------------------------------------------- | | 200 | Success | [CalendarEventsResponse](#CalendarEventsResponse) | -| 400 | Bad request | None | +| 400 | Bad request | None | ## Schemas @@ -241,40 +267,40 @@ func main() { -| Name | Type | Required | Description | -| ---- | ---- | -------- | ----------- | -| date | string | false | Response date | -| list | object[] | true | List of calendar date groups, see [CalendarDateGroup](#CalendarDateGroup) | +| Name | Type | Required | Description | +| ---- | -------- | -------- | ------------------------------------------------------------------------- | +| date | string | false | Response date | +| list | object[] | true | List of calendar date groups, see [CalendarDateGroup](#CalendarDateGroup) | ### CalendarDateGroup -| Name | Type | Required | Description | -| ---- | ---- | -------- | ----------- | -| date | string | true | Date | -| count | integer | false | Number of events on this date | -| infos | object[] | true | List of calendar events, see [CalendarEventInfo](#CalendarEventInfo) | +| Name | Type | Required | Description | +| ----- | -------- | -------- | -------------------------------------------------------------------- | +| date | string | true | Date | +| count | integer | false | Number of events on this date | +| infos | object[] | true | List of calendar events, see [CalendarEventInfo](#CalendarEventInfo) | ### CalendarEventInfo -| Name | Type | Required | Description | -| ---- | ---- | -------- | ----------- | -| id | string | false | Event ID | -| symbol | string | false | Security symbol | -| market | string | false | Market | -| counter_name | string | false | Security name | -| event_type | string | false | Event type | -| activity_type | string | false | Activity type | -| date | string | false | Event date | -| datetime | string | false | Event datetime | -| date_type | string | false | Date type | -| content | string | false | Event content description | -| currency | string | false | Currency | -| star | integer | false | Importance rating (1-3) | -| icon | string | false | Icon URL | -| chart_uid | string | false | Chart identifier | -| financial_market_time | string | false | Financial market time | -| data_kv | object[] | false | Key-value data pairs | +| Name | Type | Required | Description | +| --------------------- | -------- | -------- | ------------------------- | +| id | string | false | Event ID | +| symbol | string | false | Security symbol | +| market | string | false | Market | +| counter_name | string | false | Security name | +| event_type | string | false | Event type | +| activity_type | string | false | Activity type | +| date | string | false | Event date | +| datetime | string | false | Event datetime | +| date_type | string | false | Date type | +| content | string | false | Event content description | +| currency | string | false | Currency | +| star | integer | false | Importance rating (1-3) | +| icon | string | false | Icon URL | +| chart_uid | string | false | Chart identifier | +| financial_market_time | string | false | Financial market time | +| data_kv | object[] | false | Key-value data pairs | diff --git a/docs/en/docs/market/calendar/ipo_calendar.md b/docs/en/docs/market/calendar/ipo_calendar.md index 28d1a036..3ffebe89 100644 --- a/docs/en/docs/market/calendar/ipo_calendar.md +++ b/docs/en/docs/market/calendar/ipo_calendar.md @@ -19,16 +19,15 @@ longbridge finance-calendar ipo --market US - ## Parameters > **SDK method parameters.** -| Name | Type | Required | Description | -| ---- | ---- | -------- | ----------- | -| start | string | YES | Start date, YYYY-MM-DD | -| end | string | YES | End date, YYYY-MM-DD | -| market | string | NO | Market filter: `US`, `HK`, `SH`, `SZ`. Omit for all. | +| Name | Type | Required | Description | +| ------ | ------ | -------- | ---------------------------------------------------- | +| start | string | YES | Start date, YYYY-MM-DD | +| end | string | YES | End date, YYYY-MM-DD | +| market | string | NO | Market filter: `US`, `HK`, `SH`, `SZ`. Omit for all. | ## Request Example @@ -36,14 +35,24 @@ longbridge finance-calendar ipo --market US ```python -from longbridge.openapi import CalendarContext, Config, OAuthBuilder +from longbridge.openapi import ( + CalendarCategory, + CalendarContext, + Config, + OAuthBuilder, +) oauth = OAuthBuilder("your-client-id").build(lambda url: print("Visit:", url)) config = Config.from_oauth(oauth) ctx = CalendarContext(config) -resp = ctx.ipo_calendar("AAPL.US") -print(resp) +resp = ctx.finance_calendar( + CalendarCategory.Ipo, "2026-06-30", "2026-06-30", "US" +) + +for group in resp.list: + for info in group.infos: + print(f" - {info.symbol:12} | {info.counter_name} | {info.date}") ``` @@ -51,15 +60,27 @@ print(resp) ```python import asyncio -from longbridge.openapi import AsyncCalendarContext, Config, OAuthBuilder +from longbridge.openapi import ( + AsyncCalendarContext, + CalendarCategory, + Config, + OAuthBuilder, +) async def main() -> None: - oauth = await OAuthBuilder("your-client-id").build_async(lambda url: print("Visit:", url)) + oauth = await OAuthBuilder("your-client-id").build_async( + lambda url: print("Visit:", url) + ) config = Config.from_oauth(oauth) ctx = AsyncCalendarContext.create(config) - resp = await ctx.ipo_calendar("AAPL.US") - print(resp) + resp = await ctx.finance_calendar( + CalendarCategory.Ipo, "2026-06-30", "2026-06-30", "US" + ) + + for group in resp.list: + for info in group.infos: + print(f" - {info.symbol:12} | {info.counter_name} | {info.date}") if __name__ == "__main__": asyncio.run(main()) @@ -69,7 +90,7 @@ if __name__ == "__main__": ```javascript -const { Config, CalendarContext, OAuth } = require('longbridge') +const { CalendarCategory, CalendarContext, Config, OAuth } = require('longbridge') async function main() { const oauth = await OAuth.build('your-client-id', (_, url) => { @@ -77,7 +98,7 @@ async function main() { }) const config = Config.fromOAuth(oauth) const ctx = CalendarContext.new(config) - const resp = await ctx.ipo_calendar('AAPL.US') + const resp = await ctx.financeCalendar(CalendarCategory.Ipo, '2026-06-30', '2026-06-30', 'US') console.log(resp) } main().catch(console.error) @@ -95,7 +116,12 @@ class Main { try (OAuth oauth = new OAuthBuilder("your-client-id").build(url -> System.out.println("Open to authorize: " + url)).get(); Config config = Config.fromOAuth(oauth); CalendarContext ctx = CalendarContext.create(config)) { - var resp = ctx.getIpoCalendar("AAPL.US").get(); + FinanceCalendarOptions opts = new FinanceCalendarOptions(); + opts.category = CalendarCategory.Ipo; + opts.start = "2026-06-30"; + opts.end = "2026-06-30"; + opts.market = "US"; + var resp = ctx.getFinanceCalendar(opts).get(); System.out.println(resp); } } @@ -107,14 +133,14 @@ class Main { ```rust use std::sync::Arc; -use longbridge::{oauth::OAuthBuilder, calendar::CalendarContext, Config}; +use longbridge::{oauth::OAuthBuilder, calendar::{CalendarCategory, CalendarContext}, 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 = CalendarContext::new(config); - let resp = ctx.ipo_calendar("AAPL.US").await?; + let resp = ctx.finance_calendar(CalendarCategory::Ipo, "2026-06-30", "2026-06-30", Some("US".to_string())).await?; println!("{:?}", resp); Ok(()) } @@ -137,7 +163,7 @@ int main() { if (!res) return; Config config = Config::from_oauth(*res); CalendarContext ctx = CalendarContext::create(config); - ctx.ipo_calendar("AAPL.US", [](auto resp) { + ctx.finance_calendar(CalendarCategory::Ipo, "2026-06-30", "2026-06-30", "US", [](auto resp) { if (resp) std::cout << "OK" << std::endl; }); }); @@ -156,9 +182,9 @@ import ( "fmt" "log" + "github.com/longbridge/openapi-go/calendar" "github.com/longbridge/openapi-go/config" "github.com/longbridge/openapi-go/oauth" - "github.com/longbridge/openapi-go/calendar" ) func main() { @@ -176,7 +202,8 @@ func main() { log.Fatal(err) } defer c.Close() - resp, err := c.IpoCalendar(context.Background(), "AAPL.US") + market := "US" + resp, err := c.FinanceCalendar(context.Background(), calendar.CalendarCategoryIpo, "2026-06-30", "2026-06-30", &market) if err != nil { log.Fatal(err) } @@ -189,7 +216,6 @@ func main() { ## Response - ### Response Example ```json @@ -197,10 +223,10 @@ func main() { "code": 0, "message": "success", "data": { - "date": "2026-04-30", + "date": "2026-06-30", "list": [ { - "date": "2026-05-05", + "date": "2026-06-30", "count": 1, "infos": [ { @@ -210,7 +236,7 @@ func main() { "counter_name": "Apple Inc.", "event_type": "", "activity_type": "", - "date": "2026-05-14", + "date": "2026-06-30", "datetime": "", "content": "", "star": 0, @@ -230,10 +256,10 @@ func main() { ### Response Status -| Status | Description | Schema | -| ------ | ----------- | ------ | +| Status | Description | Schema | +| ------ | ----------- | ------------------------------------------------- | | 200 | Success | [CalendarEventsResponse](#CalendarEventsResponse) | -| 400 | Bad request | None | +| 400 | Bad request | None | ## Schemas @@ -241,40 +267,40 @@ func main() { -| Name | Type | Required | Description | -| ---- | ---- | -------- | ----------- | -| date | string | false | Response date | -| list | object[] | true | List of calendar date groups, see [CalendarDateGroup](#CalendarDateGroup) | +| Name | Type | Required | Description | +| ---- | -------- | -------- | ------------------------------------------------------------------------- | +| date | string | false | Response date | +| list | object[] | true | List of calendar date groups, see [CalendarDateGroup](#CalendarDateGroup) | ### CalendarDateGroup -| Name | Type | Required | Description | -| ---- | ---- | -------- | ----------- | -| date | string | true | Date | -| count | integer | false | Number of events on this date | -| infos | object[] | true | List of calendar events, see [CalendarEventInfo](#CalendarEventInfo) | +| Name | Type | Required | Description | +| ----- | -------- | -------- | -------------------------------------------------------------------- | +| date | string | true | Date | +| count | integer | false | Number of events on this date | +| infos | object[] | true | List of calendar events, see [CalendarEventInfo](#CalendarEventInfo) | ### CalendarEventInfo -| Name | Type | Required | Description | -| ---- | ---- | -------- | ----------- | -| id | string | false | Event ID | -| symbol | string | false | Security symbol | -| market | string | false | Market | -| counter_name | string | false | Security name | -| event_type | string | false | Event type | -| activity_type | string | false | Activity type | -| date | string | false | Event date | -| datetime | string | false | Event datetime | -| date_type | string | false | Date type | -| content | string | false | Event content description | -| currency | string | false | Currency | -| star | integer | false | Importance rating (1-3) | -| icon | string | false | Icon URL | -| chart_uid | string | false | Chart identifier | -| financial_market_time | string | false | Financial market time | -| data_kv | object[] | false | Key-value data pairs | +| Name | Type | Required | Description | +| --------------------- | -------- | -------- | ------------------------- | +| id | string | false | Event ID | +| symbol | string | false | Security symbol | +| market | string | false | Market | +| counter_name | string | false | Security name | +| event_type | string | false | Event type | +| activity_type | string | false | Activity type | +| date | string | false | Event date | +| datetime | string | false | Event datetime | +| date_type | string | false | Date type | +| content | string | false | Event content description | +| currency | string | false | Currency | +| star | integer | false | Importance rating (1-3) | +| icon | string | false | Icon URL | +| chart_uid | string | false | Chart identifier | +| financial_market_time | string | false | Financial market time | +| data_kv | object[] | false | Key-value data pairs | diff --git a/docs/en/docs/market/calendar/macro_calendar.md b/docs/en/docs/market/calendar/macro_calendar.md index c516e636..d988f01c 100644 --- a/docs/en/docs/market/calendar/macro_calendar.md +++ b/docs/en/docs/market/calendar/macro_calendar.md @@ -19,16 +19,15 @@ longbridge finance-calendar macrodata --market US - ## Parameters > **SDK method parameters.** -| Name | Type | Required | Description | -| ---- | ---- | -------- | ----------- | -| start | string | YES | Start date, YYYY-MM-DD | -| end | string | YES | End date, YYYY-MM-DD | -| market | string | NO | Market filter: `US`, `HK`, `SH`, `SZ`. Omit for all. | +| Name | Type | Required | Description | +| ------ | ------ | -------- | ---------------------------------------------------- | +| start | string | YES | Start date, YYYY-MM-DD | +| end | string | YES | End date, YYYY-MM-DD | +| market | string | NO | Market filter: `US`, `HK`, `SH`, `SZ`. Omit for all. | ## Request Example @@ -36,14 +35,24 @@ longbridge finance-calendar macrodata --market US ```python -from longbridge.openapi import CalendarContext, Config, OAuthBuilder +from longbridge.openapi import ( + CalendarCategory, + CalendarContext, + Config, + OAuthBuilder, +) oauth = OAuthBuilder("your-client-id").build(lambda url: print("Visit:", url)) config = Config.from_oauth(oauth) ctx = CalendarContext(config) -resp = ctx.macro_calendar("AAPL.US") -print(resp) +resp = ctx.finance_calendar( + CalendarCategory.MacroData, "2026-06-30", "2026-06-30", "US" +) + +for group in resp.list: + for info in group.infos: + print(f" - {info.content} | {info.date}") ``` @@ -51,15 +60,27 @@ print(resp) ```python import asyncio -from longbridge.openapi import AsyncCalendarContext, Config, OAuthBuilder +from longbridge.openapi import ( + AsyncCalendarContext, + CalendarCategory, + Config, + OAuthBuilder, +) async def main() -> None: - oauth = await OAuthBuilder("your-client-id").build_async(lambda url: print("Visit:", url)) + oauth = await OAuthBuilder("your-client-id").build_async( + lambda url: print("Visit:", url) + ) config = Config.from_oauth(oauth) ctx = AsyncCalendarContext.create(config) - resp = await ctx.macro_calendar("AAPL.US") - print(resp) + resp = await ctx.finance_calendar( + CalendarCategory.MacroData, "2026-06-30", "2026-06-30", "US" + ) + + for group in resp.list: + for info in group.infos: + print(f" - {info.content} | {info.date}") if __name__ == "__main__": asyncio.run(main()) @@ -69,7 +90,7 @@ if __name__ == "__main__": ```javascript -const { Config, CalendarContext, OAuth } = require('longbridge') +const { CalendarCategory, CalendarContext, Config, OAuth } = require('longbridge') async function main() { const oauth = await OAuth.build('your-client-id', (_, url) => { @@ -77,7 +98,7 @@ async function main() { }) const config = Config.fromOAuth(oauth) const ctx = CalendarContext.new(config) - const resp = await ctx.macro_calendar('AAPL.US') + const resp = await ctx.financeCalendar(CalendarCategory.MacroData, '2026-06-30', '2026-06-30', 'US') console.log(resp) } main().catch(console.error) @@ -95,7 +116,12 @@ class Main { try (OAuth oauth = new OAuthBuilder("your-client-id").build(url -> System.out.println("Open to authorize: " + url)).get(); Config config = Config.fromOAuth(oauth); CalendarContext ctx = CalendarContext.create(config)) { - var resp = ctx.getMacroCalendar("AAPL.US").get(); + FinanceCalendarOptions opts = new FinanceCalendarOptions(); + opts.category = CalendarCategory.MacroData; + opts.start = "2026-06-30"; + opts.end = "2026-06-30"; + opts.market = "US"; + var resp = ctx.getFinanceCalendar(opts).get(); System.out.println(resp); } } @@ -107,14 +133,14 @@ class Main { ```rust use std::sync::Arc; -use longbridge::{oauth::OAuthBuilder, calendar::CalendarContext, Config}; +use longbridge::{oauth::OAuthBuilder, calendar::{CalendarCategory, CalendarContext}, 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 = CalendarContext::new(config); - let resp = ctx.macro_calendar("AAPL.US").await?; + let resp = ctx.finance_calendar(CalendarCategory::MacroData, "2026-06-30", "2026-06-30", Some("US".to_string())).await?; println!("{:?}", resp); Ok(()) } @@ -137,7 +163,7 @@ int main() { if (!res) return; Config config = Config::from_oauth(*res); CalendarContext ctx = CalendarContext::create(config); - ctx.macro_calendar("AAPL.US", [](auto resp) { + ctx.finance_calendar(CalendarCategory::MacroData, "2026-06-30", "2026-06-30", "US", [](auto resp) { if (resp) std::cout << "OK" << std::endl; }); }); @@ -156,9 +182,9 @@ import ( "fmt" "log" + "github.com/longbridge/openapi-go/calendar" "github.com/longbridge/openapi-go/config" "github.com/longbridge/openapi-go/oauth" - "github.com/longbridge/openapi-go/calendar" ) func main() { @@ -176,7 +202,8 @@ func main() { log.Fatal(err) } defer c.Close() - resp, err := c.MacroCalendar(context.Background(), "AAPL.US") + market := "US" + resp, err := c.FinanceCalendar(context.Background(), calendar.CalendarCategoryMacroData, "2026-06-30", "2026-06-30", &market) if err != nil { log.Fatal(err) } @@ -189,7 +216,6 @@ func main() { ## Response - ### Response Example ```json @@ -197,22 +223,22 @@ func main() { "code": 0, "message": "success", "data": { - "date": "2026-04-30", + "date": "2026-06-30", "list": [ { - "date": "2026-05-02", + "date": "2026-06-30", "count": 0, "infos": [ { "id": "12345", - "symbol": "AAPL.US", + "symbol": "", "market": "US", - "counter_name": "Apple Inc.", + "counter_name": "", "event_type": "", "activity_type": "", - "date": "2026-05-14", + "date": "2026-06-30", "datetime": "", - "content": "", + "content": "US Core PPI MoM", "star": 0, "currency": "", "icon": "", @@ -230,10 +256,10 @@ func main() { ### Response Status -| Status | Description | Schema | -| ------ | ----------- | ------ | +| Status | Description | Schema | +| ------ | ----------- | ------------------------------------------------- | | 200 | Success | [CalendarEventsResponse](#CalendarEventsResponse) | -| 400 | Bad request | None | +| 400 | Bad request | None | ## Schemas @@ -241,40 +267,40 @@ func main() { -| Name | Type | Required | Description | -| ---- | ---- | -------- | ----------- | -| date | string | false | Response date | -| list | object[] | true | List of calendar date groups, see [CalendarDateGroup](#CalendarDateGroup) | +| Name | Type | Required | Description | +| ---- | -------- | -------- | ------------------------------------------------------------------------- | +| date | string | false | Response date | +| list | object[] | true | List of calendar date groups, see [CalendarDateGroup](#CalendarDateGroup) | ### CalendarDateGroup -| Name | Type | Required | Description | -| ---- | ---- | -------- | ----------- | -| date | string | true | Date | -| count | integer | false | Number of events on this date | -| infos | object[] | true | List of calendar events, see [CalendarEventInfo](#CalendarEventInfo) | +| Name | Type | Required | Description | +| ----- | -------- | -------- | -------------------------------------------------------------------- | +| date | string | true | Date | +| count | integer | false | Number of events on this date | +| infos | object[] | true | List of calendar events, see [CalendarEventInfo](#CalendarEventInfo) | ### CalendarEventInfo -| Name | Type | Required | Description | -| ---- | ---- | -------- | ----------- | -| id | string | false | Event ID | -| symbol | string | false | Security symbol | -| market | string | false | Market | -| counter_name | string | false | Security name | -| event_type | string | false | Event type | -| activity_type | string | false | Activity type | -| date | string | false | Event date | -| datetime | string | false | Event datetime | -| date_type | string | false | Date type | -| content | string | false | Event content description | -| currency | string | false | Currency | -| star | integer | false | Importance rating (1-3) | -| icon | string | false | Icon URL | -| chart_uid | string | false | Chart identifier | -| financial_market_time | string | false | Financial market time | -| data_kv | object[] | false | Key-value data pairs | +| Name | Type | Required | Description | +| --------------------- | -------- | -------- | ------------------------- | +| id | string | false | Event ID | +| symbol | string | false | Security symbol | +| market | string | false | Market | +| counter_name | string | false | Security name | +| event_type | string | false | Event type | +| activity_type | string | false | Activity type | +| date | string | false | Event date | +| datetime | string | false | Event datetime | +| date_type | string | false | Date type | +| content | string | false | Event content description | +| currency | string | false | Currency | +| star | integer | false | Importance rating (1-3) | +| icon | string | false | Icon URL | +| chart_uid | string | false | Chart identifier | +| financial_market_time | string | false | Financial market time | +| data_kv | object[] | false | Key-value data pairs | diff --git a/docs/en/docs/market/calendar/meeting_calendar.md b/docs/en/docs/market/calendar/meeting_calendar.md index 9fa2319c..18c56826 100644 --- a/docs/en/docs/market/calendar/meeting_calendar.md +++ b/docs/en/docs/market/calendar/meeting_calendar.md @@ -12,18 +12,22 @@ headingLevel: 2 Browse upcoming shareholder meetings and company events. - + +longbridge finance-calendar meeting +longbridge finance-calendar meeting --market US + + ## Parameters > **SDK method parameters.** -| Name | Type | Required | Description | -| ---- | ---- | -------- | ----------- | -| start | string | YES | Start date, YYYY-MM-DD | -| end | string | YES | End date, YYYY-MM-DD | -| market | string | NO | Market filter: `US`, `HK`, `SH`, `SZ`. Omit for all. | +| Name | Type | Required | Description | +| ------ | ------ | -------- | ---------------------------------------------------- | +| start | string | YES | Start date, YYYY-MM-DD | +| end | string | YES | End date, YYYY-MM-DD | +| market | string | NO | Market filter: `US`, `HK`, `SH`, `SZ`. Omit for all. | ## Request Example @@ -31,14 +35,24 @@ Browse upcoming shareholder meetings and company events. ```python -from longbridge.openapi import CalendarContext, CalendarCategory, Config, OAuthBuilder +from longbridge.openapi import ( + CalendarCategory, + CalendarContext, + Config, + OAuthBuilder, +) oauth = OAuthBuilder("your-client-id").build(lambda url: print("Visit:", url)) config = Config.from_oauth(oauth) ctx = CalendarContext(config) -resp = ctx.finance_calendar(CalendarCategory.Meeting, "2024-01-01", "2024-03-31") -print(resp) +resp = ctx.finance_calendar( + CalendarCategory.Meeting, "2026-06-30", "2026-06-30", "US" +) + +for group in resp.list: + for info in group.infos: + print(f" - {info.symbol:12} | {info.counter_name} | {info.date}") ``` @@ -46,14 +60,27 @@ print(resp) ```python import asyncio -from longbridge.openapi import AsyncCalendarContext, CalendarCategory, Config, OAuthBuilder +from longbridge.openapi import ( + AsyncCalendarContext, + CalendarCategory, + Config, + OAuthBuilder, +) async def main() -> None: - oauth = await OAuthBuilder("your-client-id").build_async(lambda url: print("Visit:", url)) + oauth = await OAuthBuilder("your-client-id").build_async( + lambda url: print("Visit:", url) + ) config = Config.from_oauth(oauth) ctx = AsyncCalendarContext.create(config) - resp = await ctx.finance_calendar(CalendarCategory.Meeting, "2024-01-01", "2024-03-31") - print(resp) + + resp = await ctx.finance_calendar( + CalendarCategory.Meeting, "2026-06-30", "2026-06-30", "US" + ) + + for group in resp.list: + for info in group.infos: + print(f" - {info.symbol:12} | {info.counter_name} | {info.date}") if __name__ == "__main__": asyncio.run(main()) @@ -63,13 +90,15 @@ if __name__ == "__main__": ```javascript -const { Config, CalendarContext, CalendarCategory, OAuth } = require('longbridge') +const { CalendarCategory, CalendarContext, Config, OAuth } = require('longbridge') async function main() { - const oauth = await OAuth.build('your-client-id', (_, url) => console.log('Open:', url)) + const oauth = await OAuth.build('your-client-id', (_, url) => { + console.log('Open this URL to authorize: ' + url) + }) const config = Config.fromOAuth(oauth) const ctx = CalendarContext.new(config) - const resp = await ctx.financeCalendar(CalendarCategory.Meeting, '2024-01-01', '2024-03-31') + const resp = await ctx.financeCalendar(CalendarCategory.Meeting, '2026-06-30', '2026-06-30', 'US') console.log(resp) } main().catch(console.error) @@ -84,10 +113,15 @@ import com.longbridge.calendar.*; class Main { public static void main(String[] args) throws Exception { - try (OAuth oauth = new OAuthBuilder("your-client-id").build(url -> System.out.println("Open: " + url)).get(); + try (OAuth oauth = new OAuthBuilder("your-client-id").build(url -> System.out.println("Open to authorize: " + url)).get(); Config config = Config.fromOAuth(oauth); CalendarContext ctx = CalendarContext.create(config)) { - var resp = ctx.financeCalendar(CalendarCategory.Meeting, "2024-01-01", "2024-03-31", null).get(); + FinanceCalendarOptions opts = new FinanceCalendarOptions(); + opts.category = CalendarCategory.Meeting; + opts.start = "2026-06-30"; + opts.end = "2026-06-30"; + opts.market = "US"; + var resp = ctx.getFinanceCalendar(opts).get(); System.out.println(resp); } } @@ -99,17 +133,42 @@ class Main { ```rust use std::sync::Arc; -use longbridge::{oauth::OAuthBuilder, calendar::{CalendarContext, CalendarCategory}, Config}; +use longbridge::{oauth::OAuthBuilder, calendar::{CalendarCategory, CalendarContext}, 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 = CalendarContext::new(config); - let resp = ctx.finance_calendar(CalendarCategory::Meeting, "2024-01-01", "2024-03-31", None).await?; + let resp = ctx.finance_calendar(CalendarCategory::Meeting, "2026-06-30", "2026-06-30", Some("US".to_string())).await?; println!("{:?}", resp); Ok(()) } +``` + + + + +```cpp +#include +#include + +using namespace longbridge; +using namespace longbridge::calendar; + +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); + CalendarContext ctx = CalendarContext::create(config); + ctx.finance_calendar(CalendarCategory::Meeting, "2026-06-30", "2026-06-30", "US", [](auto resp) { + if (resp) std::cout << "OK" << std::endl; + }); + }); + std::cin.get(); +} ``` @@ -119,24 +178,36 @@ async fn main() -> Result<(), Box> { package main import ( - "context" - "fmt" - "log" + "context" + "fmt" + "log" - "github.com/longbridge/openapi-go/calendar" - "github.com/longbridge/openapi-go/config" - "github.com/longbridge/openapi-go/oauth" + "github.com/longbridge/openapi-go/calendar" + "github.com/longbridge/openapi-go/config" + "github.com/longbridge/openapi-go/oauth" ) func main() { - o := oauth.New("your-client-id").OnOpenURL(func(url string) { fmt.Println("Open:", url) }) - if err := o.Build(context.Background()); err != nil { log.Fatal(err) } - conf, _ := config.New(config.WithOAuthClient(o)) - c, _ := calendar.NewFromCfg(conf) - defer c.Close() - resp, err := c.FinanceCalendar(context.Background(), "Meeting", "2024-01-01", "2024-03-31", nil) - if err != nil { log.Fatal(err) } - fmt.Printf("%+v\n", resp) + 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 := calendar.NewFromCfg(conf) + if err != nil { + log.Fatal(err) + } + defer c.Close() + market := "US" + resp, err := c.FinanceCalendar(context.Background(), calendar.CalendarCategoryMeeting, "2026-06-30", "2026-06-30", &market) + if err != nil { + log.Fatal(err) + } + fmt.Printf("%+v\n", resp) } ``` @@ -145,10 +216,91 @@ func main() { ## Response +### Response Example + +```json +{ + "code": 0, + "message": "success", + "data": { + "date": "2026-06-30", + "list": [ + { + "date": "2026-06-30", + "count": 1, + "infos": [ + { + "id": "12345", + "symbol": "AAPL.US", + "market": "US", + "counter_name": "Apple Inc.", + "event_type": "", + "activity_type": "", + "date": "2026-06-30", + "datetime": "", + "content": "", + "star": 0, + "currency": "", + "icon": "", + "chart_uid": "", + "date_type": "", + "financial_market_time": "", + "data_kv": [] + } + ] + } + ] + } +} +``` ### Response Status -| Status | Description | Schema | -| ------ | ----------- | ------ | -| 200 | Success | CalendarEventsResponse | -| 400 | Bad request | None | +| Status | Description | Schema | +| ------ | ----------- | ------------------------------------------------- | +| 200 | Success | [CalendarEventsResponse](#CalendarEventsResponse) | +| 400 | Bad request | None | + +## Schemas + +### CalendarEventsResponse + + + +| Name | Type | Required | Description | +| ---- | -------- | -------- | ------------------------------------------------------------------------- | +| date | string | false | Response date | +| list | object[] | true | List of calendar date groups, see [CalendarDateGroup](#CalendarDateGroup) | + +### CalendarDateGroup + + + +| Name | Type | Required | Description | +| ----- | -------- | -------- | -------------------------------------------------------------------- | +| date | string | true | Date | +| count | integer | false | Number of events on this date | +| infos | object[] | true | List of calendar events, see [CalendarEventInfo](#CalendarEventInfo) | + +### CalendarEventInfo + + + +| Name | Type | Required | Description | +| --------------------- | -------- | -------- | ------------------------- | +| id | string | false | Event ID | +| symbol | string | false | Security symbol | +| market | string | false | Market | +| counter_name | string | false | Security name | +| event_type | string | false | Event type | +| activity_type | string | false | Activity type | +| date | string | false | Event date | +| datetime | string | false | Event datetime | +| date_type | string | false | Date type | +| content | string | false | Event content description | +| currency | string | false | Currency | +| star | integer | false | Importance rating (1-3) | +| icon | string | false | Icon URL | +| chart_uid | string | false | Chart identifier | +| financial_market_time | string | false | Financial market time | +| data_kv | object[] | false | Key-value data pairs | diff --git a/docs/en/docs/market/calendar/merge_calendar.md b/docs/en/docs/market/calendar/merge_calendar.md index 2d4a7b73..b75a8115 100644 --- a/docs/en/docs/market/calendar/merge_calendar.md +++ b/docs/en/docs/market/calendar/merge_calendar.md @@ -12,18 +12,22 @@ headingLevel: 2 Browse upcoming M&A and merger events. - + +longbridge finance-calendar merge +longbridge finance-calendar merge --market US + + ## Parameters > **SDK method parameters.** -| Name | Type | Required | Description | -| ---- | ---- | -------- | ----------- | -| start | string | YES | Start date, YYYY-MM-DD | -| end | string | YES | End date, YYYY-MM-DD | -| market | string | NO | Market filter: `US`, `HK`, `SH`, `SZ`. Omit for all. | +| Name | Type | Required | Description | +| ------ | ------ | -------- | ---------------------------------------------------- | +| start | string | YES | Start date, YYYY-MM-DD | +| end | string | YES | End date, YYYY-MM-DD | +| market | string | NO | Market filter: `US`, `HK`, `SH`, `SZ`. Omit for all. | ## Request Example @@ -31,14 +35,24 @@ Browse upcoming M&A and merger events. ```python -from longbridge.openapi import CalendarContext, CalendarCategory, Config, OAuthBuilder +from longbridge.openapi import ( + CalendarCategory, + CalendarContext, + Config, + OAuthBuilder, +) oauth = OAuthBuilder("your-client-id").build(lambda url: print("Visit:", url)) config = Config.from_oauth(oauth) ctx = CalendarContext(config) -resp = ctx.finance_calendar(CalendarCategory.Merge, "2024-01-01", "2024-03-31") -print(resp) +resp = ctx.finance_calendar( + CalendarCategory.Merge, "2026-06-30", "2026-06-30", "US" +) + +for group in resp.list: + for info in group.infos: + print(f" - {info.symbol:12} | {info.counter_name} | {info.date}") ``` @@ -46,14 +60,27 @@ print(resp) ```python import asyncio -from longbridge.openapi import AsyncCalendarContext, CalendarCategory, Config, OAuthBuilder +from longbridge.openapi import ( + AsyncCalendarContext, + CalendarCategory, + Config, + OAuthBuilder, +) async def main() -> None: - oauth = await OAuthBuilder("your-client-id").build_async(lambda url: print("Visit:", url)) + oauth = await OAuthBuilder("your-client-id").build_async( + lambda url: print("Visit:", url) + ) config = Config.from_oauth(oauth) ctx = AsyncCalendarContext.create(config) - resp = await ctx.finance_calendar(CalendarCategory.Merge, "2024-01-01", "2024-03-31") - print(resp) + + resp = await ctx.finance_calendar( + CalendarCategory.Merge, "2026-06-30", "2026-06-30", "US" + ) + + for group in resp.list: + for info in group.infos: + print(f" - {info.symbol:12} | {info.counter_name} | {info.date}") if __name__ == "__main__": asyncio.run(main()) @@ -63,13 +90,15 @@ if __name__ == "__main__": ```javascript -const { Config, CalendarContext, CalendarCategory, OAuth } = require('longbridge') +const { CalendarCategory, CalendarContext, Config, OAuth } = require('longbridge') async function main() { - const oauth = await OAuth.build('your-client-id', (_, url) => console.log('Open:', url)) + const oauth = await OAuth.build('your-client-id', (_, url) => { + console.log('Open this URL to authorize: ' + url) + }) const config = Config.fromOAuth(oauth) const ctx = CalendarContext.new(config) - const resp = await ctx.financeCalendar(CalendarCategory.Merge, '2024-01-01', '2024-03-31') + const resp = await ctx.financeCalendar(CalendarCategory.Merge, '2026-06-30', '2026-06-30', 'US') console.log(resp) } main().catch(console.error) @@ -84,10 +113,15 @@ import com.longbridge.calendar.*; class Main { public static void main(String[] args) throws Exception { - try (OAuth oauth = new OAuthBuilder("your-client-id").build(url -> System.out.println("Open: " + url)).get(); + try (OAuth oauth = new OAuthBuilder("your-client-id").build(url -> System.out.println("Open to authorize: " + url)).get(); Config config = Config.fromOAuth(oauth); CalendarContext ctx = CalendarContext.create(config)) { - var resp = ctx.financeCalendar(CalendarCategory.Merge, "2024-01-01", "2024-03-31", null).get(); + FinanceCalendarOptions opts = new FinanceCalendarOptions(); + opts.category = CalendarCategory.Merge; + opts.start = "2026-06-30"; + opts.end = "2026-06-30"; + opts.market = "US"; + var resp = ctx.getFinanceCalendar(opts).get(); System.out.println(resp); } } @@ -99,17 +133,42 @@ class Main { ```rust use std::sync::Arc; -use longbridge::{oauth::OAuthBuilder, calendar::{CalendarContext, CalendarCategory}, Config}; +use longbridge::{oauth::OAuthBuilder, calendar::{CalendarCategory, CalendarContext}, 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 = CalendarContext::new(config); - let resp = ctx.finance_calendar(CalendarCategory::Merge, "2024-01-01", "2024-03-31", None).await?; + let resp = ctx.finance_calendar(CalendarCategory::Merge, "2026-06-30", "2026-06-30", Some("US".to_string())).await?; println!("{:?}", resp); Ok(()) } +``` + + + + +```cpp +#include +#include + +using namespace longbridge; +using namespace longbridge::calendar; + +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); + CalendarContext ctx = CalendarContext::create(config); + ctx.finance_calendar(CalendarCategory::Merge, "2026-06-30", "2026-06-30", "US", [](auto resp) { + if (resp) std::cout << "OK" << std::endl; + }); + }); + std::cin.get(); +} ``` @@ -119,24 +178,36 @@ async fn main() -> Result<(), Box> { package main import ( - "context" - "fmt" - "log" + "context" + "fmt" + "log" - "github.com/longbridge/openapi-go/calendar" - "github.com/longbridge/openapi-go/config" - "github.com/longbridge/openapi-go/oauth" + "github.com/longbridge/openapi-go/calendar" + "github.com/longbridge/openapi-go/config" + "github.com/longbridge/openapi-go/oauth" ) func main() { - o := oauth.New("your-client-id").OnOpenURL(func(url string) { fmt.Println("Open:", url) }) - if err := o.Build(context.Background()); err != nil { log.Fatal(err) } - conf, _ := config.New(config.WithOAuthClient(o)) - c, _ := calendar.NewFromCfg(conf) - defer c.Close() - resp, err := c.FinanceCalendar(context.Background(), "Merge", "2024-01-01", "2024-03-31", nil) - if err != nil { log.Fatal(err) } - fmt.Printf("%+v\n", resp) + 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 := calendar.NewFromCfg(conf) + if err != nil { + log.Fatal(err) + } + defer c.Close() + market := "US" + resp, err := c.FinanceCalendar(context.Background(), calendar.CalendarCategoryMerge, "2026-06-30", "2026-06-30", &market) + if err != nil { + log.Fatal(err) + } + fmt.Printf("%+v\n", resp) } ``` @@ -145,10 +216,91 @@ func main() { ## Response +### Response Example + +```json +{ + "code": 0, + "message": "success", + "data": { + "date": "2026-06-30", + "list": [ + { + "date": "2026-06-30", + "count": 1, + "infos": [ + { + "id": "12345", + "symbol": "AAPL.US", + "market": "US", + "counter_name": "Apple Inc.", + "event_type": "", + "activity_type": "", + "date": "2026-06-30", + "datetime": "", + "content": "", + "star": 0, + "currency": "", + "icon": "", + "chart_uid": "", + "date_type": "", + "financial_market_time": "", + "data_kv": [] + } + ] + } + ] + } +} +``` ### Response Status -| Status | Description | Schema | -| ------ | ----------- | ------ | -| 200 | Success | CalendarEventsResponse | -| 400 | Bad request | None | +| Status | Description | Schema | +| ------ | ----------- | ------------------------------------------------- | +| 200 | Success | [CalendarEventsResponse](#CalendarEventsResponse) | +| 400 | Bad request | None | + +## Schemas + +### CalendarEventsResponse + + + +| Name | Type | Required | Description | +| ---- | -------- | -------- | ------------------------------------------------------------------------- | +| date | string | false | Response date | +| list | object[] | true | List of calendar date groups, see [CalendarDateGroup](#CalendarDateGroup) | + +### CalendarDateGroup + + + +| Name | Type | Required | Description | +| ----- | -------- | -------- | -------------------------------------------------------------------- | +| date | string | true | Date | +| count | integer | false | Number of events on this date | +| infos | object[] | true | List of calendar events, see [CalendarEventInfo](#CalendarEventInfo) | + +### CalendarEventInfo + + + +| Name | Type | Required | Description | +| --------------------- | -------- | -------- | ------------------------- | +| id | string | false | Event ID | +| symbol | string | false | Security symbol | +| market | string | false | Market | +| counter_name | string | false | Security name | +| event_type | string | false | Event type | +| activity_type | string | false | Activity type | +| date | string | false | Event date | +| datetime | string | false | Event datetime | +| date_type | string | false | Date type | +| content | string | false | Event content description | +| currency | string | false | Currency | +| star | integer | false | Importance rating (1-3) | +| icon | string | false | Icon URL | +| chart_uid | string | false | Chart identifier | +| financial_market_time | string | false | Financial market time | +| data_kv | object[] | false | Key-value data pairs | diff --git a/docs/en/docs/market/calendar/split_calendar.md b/docs/en/docs/market/calendar/split_calendar.md index 75772f9f..aa3bb6e1 100644 --- a/docs/en/docs/market/calendar/split_calendar.md +++ b/docs/en/docs/market/calendar/split_calendar.md @@ -19,16 +19,15 @@ longbridge finance-calendar split --market HK - ## Parameters > **SDK method parameters.** -| Name | Type | Required | Description | -| ---- | ---- | -------- | ----------- | -| start | string | YES | Start date, YYYY-MM-DD | -| end | string | YES | End date, YYYY-MM-DD | -| market | string | NO | Market filter: `US`, `HK`, `SH`, `SZ`. Omit for all. | +| Name | Type | Required | Description | +| ------ | ------ | -------- | ---------------------------------------------------- | +| start | string | YES | Start date, YYYY-MM-DD | +| end | string | YES | End date, YYYY-MM-DD | +| market | string | NO | Market filter: `US`, `HK`, `SH`, `SZ`. Omit for all. | ## Request Example @@ -36,14 +35,24 @@ longbridge finance-calendar split --market HK ```python -from longbridge.openapi import CalendarContext, Config, OAuthBuilder +from longbridge.openapi import ( + CalendarCategory, + CalendarContext, + Config, + OAuthBuilder, +) oauth = OAuthBuilder("your-client-id").build(lambda url: print("Visit:", url)) config = Config.from_oauth(oauth) ctx = CalendarContext(config) -resp = ctx.split_calendar("AAPL.US") -print(resp) +resp = ctx.finance_calendar( + CalendarCategory.Split, "2026-06-30", "2026-06-30", "HK" +) + +for group in resp.list: + for info in group.infos: + print(f" - {info.symbol:12} | {info.counter_name} | {info.date}") ``` @@ -51,15 +60,27 @@ print(resp) ```python import asyncio -from longbridge.openapi import AsyncCalendarContext, Config, OAuthBuilder +from longbridge.openapi import ( + AsyncCalendarContext, + CalendarCategory, + Config, + OAuthBuilder, +) async def main() -> None: - oauth = await OAuthBuilder("your-client-id").build_async(lambda url: print("Visit:", url)) + oauth = await OAuthBuilder("your-client-id").build_async( + lambda url: print("Visit:", url) + ) config = Config.from_oauth(oauth) ctx = AsyncCalendarContext.create(config) - resp = await ctx.split_calendar("AAPL.US") - print(resp) + resp = await ctx.finance_calendar( + CalendarCategory.Split, "2026-06-30", "2026-06-30", "HK" + ) + + for group in resp.list: + for info in group.infos: + print(f" - {info.symbol:12} | {info.counter_name} | {info.date}") if __name__ == "__main__": asyncio.run(main()) @@ -69,7 +90,7 @@ if __name__ == "__main__": ```javascript -const { Config, CalendarContext, OAuth } = require('longbridge') +const { CalendarCategory, CalendarContext, Config, OAuth } = require('longbridge') async function main() { const oauth = await OAuth.build('your-client-id', (_, url) => { @@ -77,7 +98,7 @@ async function main() { }) const config = Config.fromOAuth(oauth) const ctx = CalendarContext.new(config) - const resp = await ctx.split_calendar('AAPL.US') + const resp = await ctx.financeCalendar(CalendarCategory.Split, '2026-06-30', '2026-06-30', 'HK') console.log(resp) } main().catch(console.error) @@ -95,7 +116,12 @@ class Main { try (OAuth oauth = new OAuthBuilder("your-client-id").build(url -> System.out.println("Open to authorize: " + url)).get(); Config config = Config.fromOAuth(oauth); CalendarContext ctx = CalendarContext.create(config)) { - var resp = ctx.getSplitCalendar("AAPL.US").get(); + FinanceCalendarOptions opts = new FinanceCalendarOptions(); + opts.category = CalendarCategory.Split; + opts.start = "2026-06-30"; + opts.end = "2026-06-30"; + opts.market = "HK"; + var resp = ctx.getFinanceCalendar(opts).get(); System.out.println(resp); } } @@ -107,14 +133,14 @@ class Main { ```rust use std::sync::Arc; -use longbridge::{oauth::OAuthBuilder, calendar::CalendarContext, Config}; +use longbridge::{oauth::OAuthBuilder, calendar::{CalendarCategory, CalendarContext}, 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 = CalendarContext::new(config); - let resp = ctx.split_calendar("AAPL.US").await?; + let resp = ctx.finance_calendar(CalendarCategory::Split, "2026-06-30", "2026-06-30", Some("HK".to_string())).await?; println!("{:?}", resp); Ok(()) } @@ -137,7 +163,7 @@ int main() { if (!res) return; Config config = Config::from_oauth(*res); CalendarContext ctx = CalendarContext::create(config); - ctx.split_calendar("AAPL.US", [](auto resp) { + ctx.finance_calendar(CalendarCategory::Split, "2026-06-30", "2026-06-30", "HK", [](auto resp) { if (resp) std::cout << "OK" << std::endl; }); }); @@ -156,9 +182,9 @@ import ( "fmt" "log" + "github.com/longbridge/openapi-go/calendar" "github.com/longbridge/openapi-go/config" "github.com/longbridge/openapi-go/oauth" - "github.com/longbridge/openapi-go/calendar" ) func main() { @@ -176,7 +202,8 @@ func main() { log.Fatal(err) } defer c.Close() - resp, err := c.SplitCalendar(context.Background(), "AAPL.US") + market := "HK" + resp, err := c.FinanceCalendar(context.Background(), calendar.CalendarCategorySplit, "2026-06-30", "2026-06-30", &market) if err != nil { log.Fatal(err) } @@ -189,7 +216,6 @@ func main() { ## Response - ### Response Example ```json @@ -197,20 +223,20 @@ func main() { "code": 0, "message": "success", "data": { - "date": "2026-04-30", + "date": "2026-06-30", "list": [ { - "date": "2026-04-30", - "count": 2228, + "date": "2026-06-30", + "count": 1, "infos": [ { "id": "12345", - "symbol": "AAPL.US", - "market": "US", - "counter_name": "Apple Inc.", + "symbol": "0700.HK", + "market": "HK", + "counter_name": "Tencent Holdings", "event_type": "", "activity_type": "", - "date": "2026-05-14", + "date": "2026-06-30", "datetime": "", "content": "", "star": 0, @@ -230,10 +256,10 @@ func main() { ### Response Status -| Status | Description | Schema | -| ------ | ----------- | ------ | +| Status | Description | Schema | +| ------ | ----------- | ------------------------------------------------- | | 200 | Success | [CalendarEventsResponse](#CalendarEventsResponse) | -| 400 | Bad request | None | +| 400 | Bad request | None | ## Schemas @@ -241,40 +267,40 @@ func main() { -| Name | Type | Required | Description | -| ---- | ---- | -------- | ----------- | -| date | string | false | Response date | -| list | object[] | true | List of calendar date groups, see [CalendarDateGroup](#CalendarDateGroup) | +| Name | Type | Required | Description | +| ---- | -------- | -------- | ------------------------------------------------------------------------- | +| date | string | false | Response date | +| list | object[] | true | List of calendar date groups, see [CalendarDateGroup](#CalendarDateGroup) | ### CalendarDateGroup -| Name | Type | Required | Description | -| ---- | ---- | -------- | ----------- | -| date | string | true | Date | -| count | integer | false | Number of events on this date | -| infos | object[] | true | List of calendar events, see [CalendarEventInfo](#CalendarEventInfo) | +| Name | Type | Required | Description | +| ----- | -------- | -------- | -------------------------------------------------------------------- | +| date | string | true | Date | +| count | integer | false | Number of events on this date | +| infos | object[] | true | List of calendar events, see [CalendarEventInfo](#CalendarEventInfo) | ### CalendarEventInfo -| Name | Type | Required | Description | -| ---- | ---- | -------- | ----------- | -| id | string | false | Event ID | -| symbol | string | false | Security symbol | -| market | string | false | Market | -| counter_name | string | false | Security name | -| event_type | string | false | Event type | -| activity_type | string | false | Activity type | -| date | string | false | Event date | -| datetime | string | false | Event datetime | -| date_type | string | false | Date type | -| content | string | false | Event content description | -| currency | string | false | Currency | -| star | integer | false | Importance rating (1-3) | -| icon | string | false | Icon URL | -| chart_uid | string | false | Chart identifier | -| financial_market_time | string | false | Financial market time | -| data_kv | object[] | false | Key-value data pairs | +| Name | Type | Required | Description | +| --------------------- | -------- | -------- | ------------------------- | +| id | string | false | Event ID | +| symbol | string | false | Security symbol | +| market | string | false | Market | +| counter_name | string | false | Security name | +| event_type | string | false | Event type | +| activity_type | string | false | Activity type | +| date | string | false | Event date | +| datetime | string | false | Event datetime | +| date_type | string | false | Date type | +| content | string | false | Event content description | +| currency | string | false | Currency | +| star | integer | false | Importance rating (1-3) | +| icon | string | false | Icon URL | +| chart_uid | string | false | Chart identifier | +| financial_market_time | string | false | Financial market time | +| data_kv | object[] | false | Key-value data pairs | diff --git a/docs/zh-CN/docs/market/calendar/dividend_calendar.md b/docs/zh-CN/docs/market/calendar/dividend_calendar.md index e06d699b..92b6bbe3 100644 --- a/docs/zh-CN/docs/market/calendar/dividend_calendar.md +++ b/docs/zh-CN/docs/market/calendar/dividend_calendar.md @@ -19,16 +19,15 @@ longbridge finance-calendar dividend --filter positions - ## Parameters > **SDK 方法参数。** -| Name | Type | Required | Description | -| ---- | ---- | -------- | ----------- | -| start | string | YES | 开始日期,格式 YYYY-MM-DD | -| end | string | YES | 结束日期,格式 YYYY-MM-DD | -| market | string | NO | 市场筛选:US、HK、SH、SZ,不填则返回所有市场 | +| Name | Type | Required | Description | +| ------ | ------ | -------- | -------------------------------------------- | +| start | string | YES | 开始日期,格式 YYYY-MM-DD | +| end | string | YES | 结束日期,格式 YYYY-MM-DD | +| market | string | NO | 市场筛选:US、HK、SH、SZ,不填则返回所有市场 | ## Request Example @@ -36,14 +35,24 @@ longbridge finance-calendar dividend --filter positions ```python -from longbridge.openapi import CalendarContext, Config, OAuthBuilder +from longbridge.openapi import ( + CalendarCategory, + CalendarContext, + Config, + OAuthBuilder, +) oauth = OAuthBuilder("your-client-id").build(lambda url: print("Visit:", url)) config = Config.from_oauth(oauth) ctx = CalendarContext(config) -resp = ctx.dividend_calendar("AAPL.US") -print(resp) +resp = ctx.finance_calendar( + CalendarCategory.Dividend, "2026-06-30", "2026-06-30", "US" +) + +for group in resp.list: + for info in group.infos: + print(f" - {info.symbol:12} | {info.counter_name} | {info.date}") ``` @@ -51,15 +60,27 @@ print(resp) ```python import asyncio -from longbridge.openapi import AsyncCalendarContext, Config, OAuthBuilder +from longbridge.openapi import ( + AsyncCalendarContext, + CalendarCategory, + Config, + OAuthBuilder, +) async def main() -> None: - oauth = await OAuthBuilder("your-client-id").build_async(lambda url: print("Visit:", url)) + oauth = await OAuthBuilder("your-client-id").build_async( + lambda url: print("Visit:", url) + ) config = Config.from_oauth(oauth) ctx = AsyncCalendarContext.create(config) - resp = await ctx.dividend_calendar("AAPL.US") - print(resp) + resp = await ctx.finance_calendar( + CalendarCategory.Dividend, "2026-06-30", "2026-06-30", "US" + ) + + for group in resp.list: + for info in group.infos: + print(f" - {info.symbol:12} | {info.counter_name} | {info.date}") if __name__ == "__main__": asyncio.run(main()) @@ -69,7 +90,7 @@ if __name__ == "__main__": ```javascript -const { Config, CalendarContext, OAuth } = require('longbridge') +const { CalendarCategory, CalendarContext, Config, OAuth } = require('longbridge') async function main() { const oauth = await OAuth.build('your-client-id', (_, url) => { @@ -77,7 +98,7 @@ async function main() { }) const config = Config.fromOAuth(oauth) const ctx = CalendarContext.new(config) - const resp = await ctx.dividend_calendar('AAPL.US') + const resp = await ctx.financeCalendar(CalendarCategory.Dividend, '2026-06-30', '2026-06-30', 'US') console.log(resp) } main().catch(console.error) @@ -95,7 +116,12 @@ class Main { try (OAuth oauth = new OAuthBuilder("your-client-id").build(url -> System.out.println("Open to authorize: " + url)).get(); Config config = Config.fromOAuth(oauth); CalendarContext ctx = CalendarContext.create(config)) { - var resp = ctx.getDividendCalendar("AAPL.US").get(); + FinanceCalendarOptions opts = new FinanceCalendarOptions(); + opts.category = CalendarCategory.Dividend; + opts.start = "2026-06-30"; + opts.end = "2026-06-30"; + opts.market = "US"; + var resp = ctx.getFinanceCalendar(opts).get(); System.out.println(resp); } } @@ -107,14 +133,14 @@ class Main { ```rust use std::sync::Arc; -use longbridge::{oauth::OAuthBuilder, calendar::CalendarContext, Config}; +use longbridge::{oauth::OAuthBuilder, calendar::{CalendarCategory, CalendarContext}, 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 = CalendarContext::new(config); - let resp = ctx.dividend_calendar("AAPL.US").await?; + let resp = ctx.finance_calendar(CalendarCategory::Dividend, "2026-06-30", "2026-06-30", Some("US".to_string())).await?; println!("{:?}", resp); Ok(()) } @@ -137,7 +163,7 @@ int main() { if (!res) return; Config config = Config::from_oauth(*res); CalendarContext ctx = CalendarContext::create(config); - ctx.dividend_calendar("AAPL.US", [](auto resp) { + ctx.finance_calendar(CalendarCategory::Dividend, "2026-06-30", "2026-06-30", "US", [](auto resp) { if (resp) std::cout << "OK" << std::endl; }); }); @@ -156,9 +182,9 @@ import ( "fmt" "log" + "github.com/longbridge/openapi-go/calendar" "github.com/longbridge/openapi-go/config" "github.com/longbridge/openapi-go/oauth" - "github.com/longbridge/openapi-go/calendar" ) func main() { @@ -176,7 +202,8 @@ func main() { log.Fatal(err) } defer c.Close() - resp, err := c.DividendCalendar(context.Background(), "AAPL.US") + market := "US" + resp, err := c.FinanceCalendar(context.Background(), calendar.CalendarCategoryDividend, "2026-06-30", "2026-06-30", &market) if err != nil { log.Fatal(err) } @@ -189,7 +216,6 @@ func main() { ## Response - ### Response Example ```json @@ -197,10 +223,10 @@ func main() { "code": 0, "message": "success", "data": { - "date": "2026-04-30", + "date": "2026-06-30", "list": [ { - "date": "2026-04-30", + "date": "2026-06-30", "count": 275, "infos": [ { @@ -210,7 +236,7 @@ func main() { "counter_name": "Apple Inc.", "event_type": "", "activity_type": "", - "date": "2026-05-14", + "date": "2026-06-30", "datetime": "", "content": "", "star": 0, @@ -230,10 +256,10 @@ func main() { ### Response Status -| Status | Description | Schema | -| ------ | ----------- | ------ | -| 200 | 成功 | [CalendarEventsResponse](#CalendarEventsResponse) | -| 400 | 请求错误 | None | +| Status | Description | Schema | +| ------ | ----------- | ------------------------------------------------- | +| 200 | 成功 | [CalendarEventsResponse](#CalendarEventsResponse) | +| 400 | 请求错误 | None | ## Schemas @@ -241,40 +267,40 @@ func main() { -| Name | Type | Required | Description | -| ---- | ---- | -------- | ----------- | -| date | string | 否 | 响应日期 | -| list | object[] | 是 | 日历日期分组列表,见 [CalendarDateGroup](#CalendarDateGroup) | +| Name | Type | Required | Description | +| ---- | -------- | -------- | ------------------------------------------------------------ | +| date | string | 否 | 响应日期 | +| list | object[] | 是 | 日历日期分组列表,见 [CalendarDateGroup](#CalendarDateGroup) | ### CalendarDateGroup -| Name | Type | Required | Description | -| ---- | ---- | -------- | ----------- | -| date | string | 是 | 日期 | -| count | integer | 否 | 该日期的事件数量 | -| infos | object[] | 是 | 日历事件列表,见 [CalendarEventInfo](#CalendarEventInfo) | +| Name | Type | Required | Description | +| ----- | -------- | -------- | -------------------------------------------------------- | +| date | string | 是 | 日期 | +| count | integer | 否 | 该日期的事件数量 | +| infos | object[] | 是 | 日历事件列表,见 [CalendarEventInfo](#CalendarEventInfo) | ### CalendarEventInfo -| Name | Type | Required | Description | -| ---- | ---- | -------- | ----------- | -| id | string | 否 | 事件 ID | -| symbol | string | 否 | 证券代码 | -| market | string | 否 | 市场 | -| counter_name | string | 否 | 证券名称 | -| event_type | string | 否 | 事件类型 | -| activity_type | string | 否 | 活动类型 | -| date | string | 否 | 事件日期 | -| datetime | string | 否 | 事件时间 | -| date_type | string | 否 | 日期类型 | -| content | string | 否 | 事件内容描述 | -| currency | string | 否 | 货币 | -| star | integer | 否 | 重要性(1-3 星) | -| icon | string | 否 | 图标链接 | -| chart_uid | string | 否 | 图表标识符 | -| financial_market_time | string | 否 | 金融市场时间 | -| data_kv | object[] | 否 | 键值数据对 | +| Name | Type | Required | Description | +| --------------------- | -------- | -------- | ---------------- | +| id | string | 否 | 事件 ID | +| symbol | string | 否 | 证券代码 | +| market | string | 否 | 市场 | +| counter_name | string | 否 | 证券名称 | +| event_type | string | 否 | 事件类型 | +| activity_type | string | 否 | 活动类型 | +| date | string | 否 | 事件日期 | +| datetime | string | 否 | 事件时间 | +| date_type | string | 否 | 日期类型 | +| content | string | 否 | 事件内容描述 | +| currency | string | 否 | 货币 | +| star | integer | 否 | 重要性(1-3 星) | +| icon | string | 否 | 图标链接 | +| chart_uid | string | 否 | 图表标识符 | +| financial_market_time | string | 否 | 金融市场时间 | +| data_kv | object[] | 否 | 键值数据对 | diff --git a/docs/zh-CN/docs/market/calendar/earnings_calendar.md b/docs/zh-CN/docs/market/calendar/earnings_calendar.md index 91fa0291..d265369b 100644 --- a/docs/zh-CN/docs/market/calendar/earnings_calendar.md +++ b/docs/zh-CN/docs/market/calendar/earnings_calendar.md @@ -19,16 +19,15 @@ longbridge finance-calendar report --market US - ## Parameters > **SDK 方法参数。** -| Name | Type | Required | Description | -| ---- | ---- | -------- | ----------- | -| start | string | YES | 开始日期,格式 YYYY-MM-DD | -| end | string | YES | 结束日期,格式 YYYY-MM-DD | -| market | string | NO | 市场筛选:US、HK、SH、SZ,不填则返回所有市场 | +| Name | Type | Required | Description | +| ------ | ------ | -------- | -------------------------------------------- | +| start | string | YES | 开始日期,格式 YYYY-MM-DD | +| end | string | YES | 结束日期,格式 YYYY-MM-DD | +| market | string | NO | 市场筛选:US、HK、SH、SZ,不填则返回所有市场 | ## Request Example @@ -36,14 +35,24 @@ longbridge finance-calendar report --market US ```python -from longbridge.openapi import CalendarContext, Config, OAuthBuilder +from longbridge.openapi import ( + CalendarCategory, + CalendarContext, + Config, + OAuthBuilder, +) oauth = OAuthBuilder("your-client-id").build(lambda url: print("Visit:", url)) config = Config.from_oauth(oauth) ctx = CalendarContext(config) -resp = ctx.earnings_calendar("AAPL.US") -print(resp) +resp = ctx.finance_calendar( + CalendarCategory.Report, "2026-06-30", "2026-06-30", "US" +) + +for group in resp.list: + for info in group.infos: + print(f" - {info.symbol:12} | {info.counter_name} | {info.date}") ``` @@ -51,15 +60,27 @@ print(resp) ```python import asyncio -from longbridge.openapi import AsyncCalendarContext, Config, OAuthBuilder +from longbridge.openapi import ( + AsyncCalendarContext, + CalendarCategory, + Config, + OAuthBuilder, +) async def main() -> None: - oauth = await OAuthBuilder("your-client-id").build_async(lambda url: print("Visit:", url)) + oauth = await OAuthBuilder("your-client-id").build_async( + lambda url: print("Visit:", url) + ) config = Config.from_oauth(oauth) ctx = AsyncCalendarContext.create(config) - resp = await ctx.earnings_calendar("AAPL.US") - print(resp) + resp = await ctx.finance_calendar( + CalendarCategory.Report, "2026-06-30", "2026-06-30", "US" + ) + + for group in resp.list: + for info in group.infos: + print(f" - {info.symbol:12} | {info.counter_name} | {info.date}") if __name__ == "__main__": asyncio.run(main()) @@ -69,7 +90,7 @@ if __name__ == "__main__": ```javascript -const { Config, CalendarContext, OAuth } = require('longbridge') +const { CalendarCategory, CalendarContext, Config, OAuth } = require('longbridge') async function main() { const oauth = await OAuth.build('your-client-id', (_, url) => { @@ -77,7 +98,7 @@ async function main() { }) const config = Config.fromOAuth(oauth) const ctx = CalendarContext.new(config) - const resp = await ctx.earnings_calendar('AAPL.US') + const resp = await ctx.financeCalendar(CalendarCategory.Report, '2026-06-30', '2026-06-30', 'US') console.log(resp) } main().catch(console.error) @@ -95,7 +116,12 @@ class Main { try (OAuth oauth = new OAuthBuilder("your-client-id").build(url -> System.out.println("Open to authorize: " + url)).get(); Config config = Config.fromOAuth(oauth); CalendarContext ctx = CalendarContext.create(config)) { - var resp = ctx.getEarningsCalendar("AAPL.US").get(); + FinanceCalendarOptions opts = new FinanceCalendarOptions(); + opts.category = CalendarCategory.Report; + opts.start = "2026-06-30"; + opts.end = "2026-06-30"; + opts.market = "US"; + var resp = ctx.getFinanceCalendar(opts).get(); System.out.println(resp); } } @@ -107,14 +133,14 @@ class Main { ```rust use std::sync::Arc; -use longbridge::{oauth::OAuthBuilder, calendar::CalendarContext, Config}; +use longbridge::{oauth::OAuthBuilder, calendar::{CalendarCategory, CalendarContext}, 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 = CalendarContext::new(config); - let resp = ctx.earnings_calendar("AAPL.US").await?; + let resp = ctx.finance_calendar(CalendarCategory::Report, "2026-06-30", "2026-06-30", Some("US".to_string())).await?; println!("{:?}", resp); Ok(()) } @@ -137,7 +163,7 @@ int main() { if (!res) return; Config config = Config::from_oauth(*res); CalendarContext ctx = CalendarContext::create(config); - ctx.earnings_calendar("AAPL.US", [](auto resp) { + ctx.finance_calendar(CalendarCategory::Report, "2026-06-30", "2026-06-30", "US", [](auto resp) { if (resp) std::cout << "OK" << std::endl; }); }); @@ -156,9 +182,9 @@ import ( "fmt" "log" + "github.com/longbridge/openapi-go/calendar" "github.com/longbridge/openapi-go/config" "github.com/longbridge/openapi-go/oauth" - "github.com/longbridge/openapi-go/calendar" ) func main() { @@ -176,7 +202,8 @@ func main() { log.Fatal(err) } defer c.Close() - resp, err := c.EarningsCalendar(context.Background(), "AAPL.US") + market := "US" + resp, err := c.FinanceCalendar(context.Background(), calendar.CalendarCategoryReport, "2026-06-30", "2026-06-30", &market) if err != nil { log.Fatal(err) } @@ -189,7 +216,6 @@ func main() { ## Response - ### Response Example ```json @@ -197,11 +223,11 @@ func main() { "code": 0, "message": "success", "data": { - "date": "2026-04-30", + "date": "2026-06-30", "list": [ { - "date": "2026-04-30", - "count": 2228, + "date": "2026-06-30", + "count": 1, "infos": [ { "id": "12345", @@ -210,7 +236,7 @@ func main() { "counter_name": "Apple Inc.", "event_type": "", "activity_type": "", - "date": "2026-05-14", + "date": "2026-06-30", "datetime": "", "content": "", "star": 0, @@ -230,10 +256,10 @@ func main() { ### Response Status -| Status | Description | Schema | -| ------ | ----------- | ------ | -| 200 | 成功 | [CalendarEventsResponse](#CalendarEventsResponse) | -| 400 | 请求错误 | None | +| Status | Description | Schema | +| ------ | ----------- | ------------------------------------------------- | +| 200 | 成功 | [CalendarEventsResponse](#CalendarEventsResponse) | +| 400 | 请求错误 | None | ## Schemas @@ -241,40 +267,40 @@ func main() { -| Name | Type | Required | Description | -| ---- | ---- | -------- | ----------- | -| date | string | 否 | 响应日期 | -| list | object[] | 是 | 日历日期分组列表,见 [CalendarDateGroup](#CalendarDateGroup) | +| Name | Type | Required | Description | +| ---- | -------- | -------- | ------------------------------------------------------------ | +| date | string | 否 | 响应日期 | +| list | object[] | 是 | 日历日期分组列表,见 [CalendarDateGroup](#CalendarDateGroup) | ### CalendarDateGroup -| Name | Type | Required | Description | -| ---- | ---- | -------- | ----------- | -| date | string | 是 | 日期 | -| count | integer | 否 | 该日期的事件数量 | -| infos | object[] | 是 | 日历事件列表,见 [CalendarEventInfo](#CalendarEventInfo) | +| Name | Type | Required | Description | +| ----- | -------- | -------- | -------------------------------------------------------- | +| date | string | 是 | 日期 | +| count | integer | 否 | 该日期的事件数量 | +| infos | object[] | 是 | 日历事件列表,见 [CalendarEventInfo](#CalendarEventInfo) | ### CalendarEventInfo -| Name | Type | Required | Description | -| ---- | ---- | -------- | ----------- | -| id | string | 否 | 事件 ID | -| symbol | string | 否 | 证券代码 | -| market | string | 否 | 市场 | -| counter_name | string | 否 | 证券名称 | -| event_type | string | 否 | 事件类型 | -| activity_type | string | 否 | 活动类型 | -| date | string | 否 | 事件日期 | -| datetime | string | 否 | 事件时间 | -| date_type | string | 否 | 日期类型 | -| content | string | 否 | 事件内容描述 | -| currency | string | 否 | 货币 | -| star | integer | 否 | 重要性(1-3 星) | -| icon | string | 否 | 图标链接 | -| chart_uid | string | 否 | 图表标识符 | -| financial_market_time | string | 否 | 金融市场时间 | -| data_kv | object[] | 否 | 键值数据对 | +| Name | Type | Required | Description | +| --------------------- | -------- | -------- | ---------------- | +| id | string | 否 | 事件 ID | +| symbol | string | 否 | 证券代码 | +| market | string | 否 | 市场 | +| counter_name | string | 否 | 证券名称 | +| event_type | string | 否 | 事件类型 | +| activity_type | string | 否 | 活动类型 | +| date | string | 否 | 事件日期 | +| datetime | string | 否 | 事件时间 | +| date_type | string | 否 | 日期类型 | +| content | string | 否 | 事件内容描述 | +| currency | string | 否 | 货币 | +| star | integer | 否 | 重要性(1-3 星) | +| icon | string | 否 | 图标链接 | +| chart_uid | string | 否 | 图表标识符 | +| financial_market_time | string | 否 | 金融市场时间 | +| data_kv | object[] | 否 | 键值数据对 | diff --git a/docs/zh-CN/docs/market/calendar/ipo_calendar.md b/docs/zh-CN/docs/market/calendar/ipo_calendar.md index 6fdcf0eb..db9c800e 100644 --- a/docs/zh-CN/docs/market/calendar/ipo_calendar.md +++ b/docs/zh-CN/docs/market/calendar/ipo_calendar.md @@ -19,16 +19,15 @@ longbridge finance-calendar ipo --market US - ## Parameters > **SDK 方法参数。** -| Name | Type | Required | Description | -| ---- | ---- | -------- | ----------- | -| start | string | YES | 开始日期,格式 YYYY-MM-DD | -| end | string | YES | 结束日期,格式 YYYY-MM-DD | -| market | string | NO | 市场筛选:US、HK、SH、SZ,不填则返回所有市场 | +| Name | Type | Required | Description | +| ------ | ------ | -------- | -------------------------------------------- | +| start | string | YES | 开始日期,格式 YYYY-MM-DD | +| end | string | YES | 结束日期,格式 YYYY-MM-DD | +| market | string | NO | 市场筛选:US、HK、SH、SZ,不填则返回所有市场 | ## Request Example @@ -36,14 +35,24 @@ longbridge finance-calendar ipo --market US ```python -from longbridge.openapi import CalendarContext, Config, OAuthBuilder +from longbridge.openapi import ( + CalendarCategory, + CalendarContext, + Config, + OAuthBuilder, +) oauth = OAuthBuilder("your-client-id").build(lambda url: print("Visit:", url)) config = Config.from_oauth(oauth) ctx = CalendarContext(config) -resp = ctx.ipo_calendar("AAPL.US") -print(resp) +resp = ctx.finance_calendar( + CalendarCategory.Ipo, "2026-06-30", "2026-06-30", "US" +) + +for group in resp.list: + for info in group.infos: + print(f" - {info.symbol:12} | {info.counter_name} | {info.date}") ``` @@ -51,15 +60,27 @@ print(resp) ```python import asyncio -from longbridge.openapi import AsyncCalendarContext, Config, OAuthBuilder +from longbridge.openapi import ( + AsyncCalendarContext, + CalendarCategory, + Config, + OAuthBuilder, +) async def main() -> None: - oauth = await OAuthBuilder("your-client-id").build_async(lambda url: print("Visit:", url)) + oauth = await OAuthBuilder("your-client-id").build_async( + lambda url: print("Visit:", url) + ) config = Config.from_oauth(oauth) ctx = AsyncCalendarContext.create(config) - resp = await ctx.ipo_calendar("AAPL.US") - print(resp) + resp = await ctx.finance_calendar( + CalendarCategory.Ipo, "2026-06-30", "2026-06-30", "US" + ) + + for group in resp.list: + for info in group.infos: + print(f" - {info.symbol:12} | {info.counter_name} | {info.date}") if __name__ == "__main__": asyncio.run(main()) @@ -69,7 +90,7 @@ if __name__ == "__main__": ```javascript -const { Config, CalendarContext, OAuth } = require('longbridge') +const { CalendarCategory, CalendarContext, Config, OAuth } = require('longbridge') async function main() { const oauth = await OAuth.build('your-client-id', (_, url) => { @@ -77,7 +98,7 @@ async function main() { }) const config = Config.fromOAuth(oauth) const ctx = CalendarContext.new(config) - const resp = await ctx.ipo_calendar('AAPL.US') + const resp = await ctx.financeCalendar(CalendarCategory.Ipo, '2026-06-30', '2026-06-30', 'US') console.log(resp) } main().catch(console.error) @@ -95,7 +116,12 @@ class Main { try (OAuth oauth = new OAuthBuilder("your-client-id").build(url -> System.out.println("Open to authorize: " + url)).get(); Config config = Config.fromOAuth(oauth); CalendarContext ctx = CalendarContext.create(config)) { - var resp = ctx.getIpoCalendar("AAPL.US").get(); + FinanceCalendarOptions opts = new FinanceCalendarOptions(); + opts.category = CalendarCategory.Ipo; + opts.start = "2026-06-30"; + opts.end = "2026-06-30"; + opts.market = "US"; + var resp = ctx.getFinanceCalendar(opts).get(); System.out.println(resp); } } @@ -107,14 +133,14 @@ class Main { ```rust use std::sync::Arc; -use longbridge::{oauth::OAuthBuilder, calendar::CalendarContext, Config}; +use longbridge::{oauth::OAuthBuilder, calendar::{CalendarCategory, CalendarContext}, 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 = CalendarContext::new(config); - let resp = ctx.ipo_calendar("AAPL.US").await?; + let resp = ctx.finance_calendar(CalendarCategory::Ipo, "2026-06-30", "2026-06-30", Some("US".to_string())).await?; println!("{:?}", resp); Ok(()) } @@ -137,7 +163,7 @@ int main() { if (!res) return; Config config = Config::from_oauth(*res); CalendarContext ctx = CalendarContext::create(config); - ctx.ipo_calendar("AAPL.US", [](auto resp) { + ctx.finance_calendar(CalendarCategory::Ipo, "2026-06-30", "2026-06-30", "US", [](auto resp) { if (resp) std::cout << "OK" << std::endl; }); }); @@ -156,9 +182,9 @@ import ( "fmt" "log" + "github.com/longbridge/openapi-go/calendar" "github.com/longbridge/openapi-go/config" "github.com/longbridge/openapi-go/oauth" - "github.com/longbridge/openapi-go/calendar" ) func main() { @@ -176,7 +202,8 @@ func main() { log.Fatal(err) } defer c.Close() - resp, err := c.IpoCalendar(context.Background(), "AAPL.US") + market := "US" + resp, err := c.FinanceCalendar(context.Background(), calendar.CalendarCategoryIpo, "2026-06-30", "2026-06-30", &market) if err != nil { log.Fatal(err) } @@ -189,7 +216,6 @@ func main() { ## Response - ### Response Example ```json @@ -197,10 +223,10 @@ func main() { "code": 0, "message": "success", "data": { - "date": "2026-04-30", + "date": "2026-06-30", "list": [ { - "date": "2026-05-05", + "date": "2026-06-30", "count": 1, "infos": [ { @@ -210,7 +236,7 @@ func main() { "counter_name": "Apple Inc.", "event_type": "", "activity_type": "", - "date": "2026-05-14", + "date": "2026-06-30", "datetime": "", "content": "", "star": 0, @@ -230,10 +256,10 @@ func main() { ### Response Status -| Status | Description | Schema | -| ------ | ----------- | ------ | -| 200 | 成功 | [CalendarEventsResponse](#CalendarEventsResponse) | -| 400 | 请求错误 | None | +| Status | Description | Schema | +| ------ | ----------- | ------------------------------------------------- | +| 200 | 成功 | [CalendarEventsResponse](#CalendarEventsResponse) | +| 400 | 请求错误 | None | ## Schemas @@ -241,40 +267,40 @@ func main() { -| Name | Type | Required | Description | -| ---- | ---- | -------- | ----------- | -| date | string | 否 | 响应日期 | -| list | object[] | 是 | 日历日期分组列表,见 [CalendarDateGroup](#CalendarDateGroup) | +| Name | Type | Required | Description | +| ---- | -------- | -------- | ------------------------------------------------------------ | +| date | string | 否 | 响应日期 | +| list | object[] | 是 | 日历日期分组列表,见 [CalendarDateGroup](#CalendarDateGroup) | ### CalendarDateGroup -| Name | Type | Required | Description | -| ---- | ---- | -------- | ----------- | -| date | string | 是 | 日期 | -| count | integer | 否 | 该日期的事件数量 | -| infos | object[] | 是 | 日历事件列表,见 [CalendarEventInfo](#CalendarEventInfo) | +| Name | Type | Required | Description | +| ----- | -------- | -------- | -------------------------------------------------------- | +| date | string | 是 | 日期 | +| count | integer | 否 | 该日期的事件数量 | +| infos | object[] | 是 | 日历事件列表,见 [CalendarEventInfo](#CalendarEventInfo) | ### CalendarEventInfo -| Name | Type | Required | Description | -| ---- | ---- | -------- | ----------- | -| id | string | 否 | 事件 ID | -| symbol | string | 否 | 证券代码 | -| market | string | 否 | 市场 | -| counter_name | string | 否 | 证券名称 | -| event_type | string | 否 | 事件类型 | -| activity_type | string | 否 | 活动类型 | -| date | string | 否 | 事件日期 | -| datetime | string | 否 | 事件时间 | -| date_type | string | 否 | 日期类型 | -| content | string | 否 | 事件内容描述 | -| currency | string | 否 | 货币 | -| star | integer | 否 | 重要性(1-3 星) | -| icon | string | 否 | 图标链接 | -| chart_uid | string | 否 | 图表标识符 | -| financial_market_time | string | 否 | 金融市场时间 | -| data_kv | object[] | 否 | 键值数据对 | +| Name | Type | Required | Description | +| --------------------- | -------- | -------- | ---------------- | +| id | string | 否 | 事件 ID | +| symbol | string | 否 | 证券代码 | +| market | string | 否 | 市场 | +| counter_name | string | 否 | 证券名称 | +| event_type | string | 否 | 事件类型 | +| activity_type | string | 否 | 活动类型 | +| date | string | 否 | 事件日期 | +| datetime | string | 否 | 事件时间 | +| date_type | string | 否 | 日期类型 | +| content | string | 否 | 事件内容描述 | +| currency | string | 否 | 货币 | +| star | integer | 否 | 重要性(1-3 星) | +| icon | string | 否 | 图标链接 | +| chart_uid | string | 否 | 图表标识符 | +| financial_market_time | string | 否 | 金融市场时间 | +| data_kv | object[] | 否 | 键值数据对 | diff --git a/docs/zh-CN/docs/market/calendar/macro_calendar.md b/docs/zh-CN/docs/market/calendar/macro_calendar.md index f81079c3..e3348ffb 100644 --- a/docs/zh-CN/docs/market/calendar/macro_calendar.md +++ b/docs/zh-CN/docs/market/calendar/macro_calendar.md @@ -19,16 +19,15 @@ longbridge finance-calendar macrodata --market US - ## Parameters > **SDK 方法参数。** -| Name | Type | Required | Description | -| ---- | ---- | -------- | ----------- | -| start | string | YES | 开始日期,格式 YYYY-MM-DD | -| end | string | YES | 结束日期,格式 YYYY-MM-DD | -| market | string | NO | 市场筛选:US、HK、SH、SZ,不填则返回所有市场 | +| Name | Type | Required | Description | +| ------ | ------ | -------- | -------------------------------------------- | +| start | string | YES | 开始日期,格式 YYYY-MM-DD | +| end | string | YES | 结束日期,格式 YYYY-MM-DD | +| market | string | NO | 市场筛选:US、HK、SH、SZ,不填则返回所有市场 | ## Request Example @@ -36,14 +35,24 @@ longbridge finance-calendar macrodata --market US ```python -from longbridge.openapi import CalendarContext, Config, OAuthBuilder +from longbridge.openapi import ( + CalendarCategory, + CalendarContext, + Config, + OAuthBuilder, +) oauth = OAuthBuilder("your-client-id").build(lambda url: print("Visit:", url)) config = Config.from_oauth(oauth) ctx = CalendarContext(config) -resp = ctx.macro_calendar("AAPL.US") -print(resp) +resp = ctx.finance_calendar( + CalendarCategory.MacroData, "2026-06-30", "2026-06-30", "US" +) + +for group in resp.list: + for info in group.infos: + print(f" - {info.content} | {info.date}") ``` @@ -51,15 +60,27 @@ print(resp) ```python import asyncio -from longbridge.openapi import AsyncCalendarContext, Config, OAuthBuilder +from longbridge.openapi import ( + AsyncCalendarContext, + CalendarCategory, + Config, + OAuthBuilder, +) async def main() -> None: - oauth = await OAuthBuilder("your-client-id").build_async(lambda url: print("Visit:", url)) + oauth = await OAuthBuilder("your-client-id").build_async( + lambda url: print("Visit:", url) + ) config = Config.from_oauth(oauth) ctx = AsyncCalendarContext.create(config) - resp = await ctx.macro_calendar("AAPL.US") - print(resp) + resp = await ctx.finance_calendar( + CalendarCategory.MacroData, "2026-06-30", "2026-06-30", "US" + ) + + for group in resp.list: + for info in group.infos: + print(f" - {info.content} | {info.date}") if __name__ == "__main__": asyncio.run(main()) @@ -69,7 +90,7 @@ if __name__ == "__main__": ```javascript -const { Config, CalendarContext, OAuth } = require('longbridge') +const { CalendarCategory, CalendarContext, Config, OAuth } = require('longbridge') async function main() { const oauth = await OAuth.build('your-client-id', (_, url) => { @@ -77,7 +98,7 @@ async function main() { }) const config = Config.fromOAuth(oauth) const ctx = CalendarContext.new(config) - const resp = await ctx.macro_calendar('AAPL.US') + const resp = await ctx.financeCalendar(CalendarCategory.MacroData, '2026-06-30', '2026-06-30', 'US') console.log(resp) } main().catch(console.error) @@ -95,7 +116,12 @@ class Main { try (OAuth oauth = new OAuthBuilder("your-client-id").build(url -> System.out.println("Open to authorize: " + url)).get(); Config config = Config.fromOAuth(oauth); CalendarContext ctx = CalendarContext.create(config)) { - var resp = ctx.getMacroCalendar("AAPL.US").get(); + FinanceCalendarOptions opts = new FinanceCalendarOptions(); + opts.category = CalendarCategory.MacroData; + opts.start = "2026-06-30"; + opts.end = "2026-06-30"; + opts.market = "US"; + var resp = ctx.getFinanceCalendar(opts).get(); System.out.println(resp); } } @@ -107,14 +133,14 @@ class Main { ```rust use std::sync::Arc; -use longbridge::{oauth::OAuthBuilder, calendar::CalendarContext, Config}; +use longbridge::{oauth::OAuthBuilder, calendar::{CalendarCategory, CalendarContext}, 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 = CalendarContext::new(config); - let resp = ctx.macro_calendar("AAPL.US").await?; + let resp = ctx.finance_calendar(CalendarCategory::MacroData, "2026-06-30", "2026-06-30", Some("US".to_string())).await?; println!("{:?}", resp); Ok(()) } @@ -137,7 +163,7 @@ int main() { if (!res) return; Config config = Config::from_oauth(*res); CalendarContext ctx = CalendarContext::create(config); - ctx.macro_calendar("AAPL.US", [](auto resp) { + ctx.finance_calendar(CalendarCategory::MacroData, "2026-06-30", "2026-06-30", "US", [](auto resp) { if (resp) std::cout << "OK" << std::endl; }); }); @@ -156,9 +182,9 @@ import ( "fmt" "log" + "github.com/longbridge/openapi-go/calendar" "github.com/longbridge/openapi-go/config" "github.com/longbridge/openapi-go/oauth" - "github.com/longbridge/openapi-go/calendar" ) func main() { @@ -176,7 +202,8 @@ func main() { log.Fatal(err) } defer c.Close() - resp, err := c.MacroCalendar(context.Background(), "AAPL.US") + market := "US" + resp, err := c.FinanceCalendar(context.Background(), calendar.CalendarCategoryMacroData, "2026-06-30", "2026-06-30", &market) if err != nil { log.Fatal(err) } @@ -189,7 +216,6 @@ func main() { ## Response - ### Response Example ```json @@ -197,22 +223,22 @@ func main() { "code": 0, "message": "success", "data": { - "date": "2026-04-30", + "date": "2026-06-30", "list": [ { - "date": "2026-05-02", + "date": "2026-06-30", "count": 0, "infos": [ { "id": "12345", - "symbol": "AAPL.US", + "symbol": "", "market": "US", - "counter_name": "Apple Inc.", + "counter_name": "", "event_type": "", "activity_type": "", - "date": "2026-05-14", + "date": "2026-06-30", "datetime": "", - "content": "", + "content": "US Core PPI MoM", "star": 0, "currency": "", "icon": "", @@ -230,10 +256,10 @@ func main() { ### Response Status -| Status | Description | Schema | -| ------ | ----------- | ------ | -| 200 | 成功 | [CalendarEventsResponse](#CalendarEventsResponse) | -| 400 | 请求错误 | None | +| Status | Description | Schema | +| ------ | ----------- | ------------------------------------------------- | +| 200 | 成功 | [CalendarEventsResponse](#CalendarEventsResponse) | +| 400 | 请求错误 | None | ## Schemas @@ -241,40 +267,40 @@ func main() { -| Name | Type | Required | Description | -| ---- | ---- | -------- | ----------- | -| date | string | 否 | 响应日期 | -| list | object[] | 是 | 日历日期分组列表,见 [CalendarDateGroup](#CalendarDateGroup) | +| Name | Type | Required | Description | +| ---- | -------- | -------- | ------------------------------------------------------------ | +| date | string | 否 | 响应日期 | +| list | object[] | 是 | 日历日期分组列表,见 [CalendarDateGroup](#CalendarDateGroup) | ### CalendarDateGroup -| Name | Type | Required | Description | -| ---- | ---- | -------- | ----------- | -| date | string | 是 | 日期 | -| count | integer | 否 | 该日期的事件数量 | -| infos | object[] | 是 | 日历事件列表,见 [CalendarEventInfo](#CalendarEventInfo) | +| Name | Type | Required | Description | +| ----- | -------- | -------- | -------------------------------------------------------- | +| date | string | 是 | 日期 | +| count | integer | 否 | 该日期的事件数量 | +| infos | object[] | 是 | 日历事件列表,见 [CalendarEventInfo](#CalendarEventInfo) | ### CalendarEventInfo -| Name | Type | Required | Description | -| ---- | ---- | -------- | ----------- | -| id | string | 否 | 事件 ID | -| symbol | string | 否 | 证券代码 | -| market | string | 否 | 市场 | -| counter_name | string | 否 | 证券名称 | -| event_type | string | 否 | 事件类型 | -| activity_type | string | 否 | 活动类型 | -| date | string | 否 | 事件日期 | -| datetime | string | 否 | 事件时间 | -| date_type | string | 否 | 日期类型 | -| content | string | 否 | 事件内容描述 | -| currency | string | 否 | 货币 | -| star | integer | 否 | 重要性(1-3 星) | -| icon | string | 否 | 图标链接 | -| chart_uid | string | 否 | 图表标识符 | -| financial_market_time | string | 否 | 金融市场时间 | -| data_kv | object[] | 否 | 键值数据对 | +| Name | Type | Required | Description | +| --------------------- | -------- | -------- | ---------------- | +| id | string | 否 | 事件 ID | +| symbol | string | 否 | 证券代码 | +| market | string | 否 | 市场 | +| counter_name | string | 否 | 证券名称 | +| event_type | string | 否 | 事件类型 | +| activity_type | string | 否 | 活动类型 | +| date | string | 否 | 事件日期 | +| datetime | string | 否 | 事件时间 | +| date_type | string | 否 | 日期类型 | +| content | string | 否 | 事件内容描述 | +| currency | string | 否 | 货币 | +| star | integer | 否 | 重要性(1-3 星) | +| icon | string | 否 | 图标链接 | +| chart_uid | string | 否 | 图表标识符 | +| financial_market_time | string | 否 | 金融市场时间 | +| data_kv | object[] | 否 | 键值数据对 | diff --git a/docs/zh-CN/docs/market/calendar/meeting_calendar.md b/docs/zh-CN/docs/market/calendar/meeting_calendar.md new file mode 100644 index 00000000..0c5b7f1f --- /dev/null +++ b/docs/zh-CN/docs/market/calendar/meeting_calendar.md @@ -0,0 +1,306 @@ +--- +slug: /market/calendar/meeting-calendar +title: 股东大会日历 +sidebar_position: 6 +language_tabs: false +toc_footers: [] +includes: [] +search: true +highlight_theme: '' +headingLevel: 2 +--- + +浏览即将举行的股东大会及公司事件。 + + +longbridge finance-calendar meeting +longbridge finance-calendar meeting --market US + + + + +## Parameters + +> **SDK 方法参数。** + +| Name | Type | Required | Description | +| ------ | ------ | -------- | -------------------------------------------- | +| start | string | YES | 开始日期,格式 YYYY-MM-DD | +| end | string | YES | 结束日期,格式 YYYY-MM-DD | +| market | string | NO | 市场筛选:US、HK、SH、SZ,不填则返回所有市场 | + +## Request Example + + + + +```python +from longbridge.openapi import ( + CalendarCategory, + CalendarContext, + Config, + OAuthBuilder, +) + +oauth = OAuthBuilder("your-client-id").build(lambda url: print("Visit:", url)) +config = Config.from_oauth(oauth) +ctx = CalendarContext(config) + +resp = ctx.finance_calendar( + CalendarCategory.Meeting, "2026-06-30", "2026-06-30", "US" +) + +for group in resp.list: + for info in group.infos: + print(f" - {info.symbol:12} | {info.counter_name} | {info.date}") +``` + + + + +```python +import asyncio +from longbridge.openapi import ( + AsyncCalendarContext, + CalendarCategory, + 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 = AsyncCalendarContext.create(config) + + resp = await ctx.finance_calendar( + CalendarCategory.Meeting, "2026-06-30", "2026-06-30", "US" + ) + + for group in resp.list: + for info in group.infos: + print(f" - {info.symbol:12} | {info.counter_name} | {info.date}") + +if __name__ == "__main__": + asyncio.run(main()) +``` + + + + +```javascript +const { CalendarCategory, CalendarContext, Config, 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 = CalendarContext.new(config) + const resp = await ctx.financeCalendar(CalendarCategory.Meeting, '2026-06-30', '2026-06-30', 'US') + console.log(resp) +} +main().catch(console.error) +``` + + + + +```java +import com.longbridge.*; +import com.longbridge.calendar.*; + +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); + CalendarContext ctx = CalendarContext.create(config)) { + FinanceCalendarOptions opts = new FinanceCalendarOptions(); + opts.category = CalendarCategory.Meeting; + opts.start = "2026-06-30"; + opts.end = "2026-06-30"; + opts.market = "US"; + var resp = ctx.getFinanceCalendar(opts).get(); + System.out.println(resp); + } + } +} +``` + + + + +```rust +use std::sync::Arc; +use longbridge::{oauth::OAuthBuilder, calendar::{CalendarCategory, CalendarContext}, 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 = CalendarContext::new(config); + let resp = ctx.finance_calendar(CalendarCategory::Meeting, "2026-06-30", "2026-06-30", Some("US".to_string())).await?; + println!("{:?}", resp); + Ok(()) +} +``` + + + + +```cpp +#include +#include + +using namespace longbridge; +using namespace longbridge::calendar; + +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); + CalendarContext ctx = CalendarContext::create(config); + ctx.finance_calendar(CalendarCategory::Meeting, "2026-06-30", "2026-06-30", "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/calendar" + "github.com/longbridge/openapi-go/config" + "github.com/longbridge/openapi-go/oauth" +) + +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 := calendar.NewFromCfg(conf) + if err != nil { + log.Fatal(err) + } + defer c.Close() + market := "US" + resp, err := c.FinanceCalendar(context.Background(), calendar.CalendarCategoryMeeting, "2026-06-30", "2026-06-30", &market) + if err != nil { + log.Fatal(err) + } + fmt.Printf("%+v\n", resp) +} +``` + + + + +## Response + +### Response Example + +```json +{ + "code": 0, + "message": "success", + "data": { + "date": "2026-06-30", + "list": [ + { + "date": "2026-06-30", + "count": 1, + "infos": [ + { + "id": "12345", + "symbol": "AAPL.US", + "market": "US", + "counter_name": "Apple Inc.", + "event_type": "", + "activity_type": "", + "date": "2026-06-30", + "datetime": "", + "content": "", + "star": 0, + "currency": "", + "icon": "", + "chart_uid": "", + "date_type": "", + "financial_market_time": "", + "data_kv": [] + } + ] + } + ] + } +} +``` + +### Response Status + +| Status | Description | Schema | +| ------ | ----------- | ------------------------------------------------- | +| 200 | 成功 | [CalendarEventsResponse](#CalendarEventsResponse) | +| 400 | 请求错误 | None | + +## Schemas + +### CalendarEventsResponse + + + +| Name | Type | Required | Description | +| ---- | -------- | -------- | ------------------------------------------------------------ | +| date | string | 否 | 响应日期 | +| list | object[] | 是 | 日历日期分组列表,见 [CalendarDateGroup](#CalendarDateGroup) | + +### CalendarDateGroup + + + +| Name | Type | Required | Description | +| ----- | -------- | -------- | -------------------------------------------------------- | +| date | string | 是 | 日期 | +| count | integer | 否 | 该日期的事件数量 | +| infos | object[] | 是 | 日历事件列表,见 [CalendarEventInfo](#CalendarEventInfo) | + +### CalendarEventInfo + + + +| Name | Type | Required | Description | +| --------------------- | -------- | -------- | ---------------- | +| id | string | 否 | 事件 ID | +| symbol | string | 否 | 证券代码 | +| market | string | 否 | 市场 | +| counter_name | string | 否 | 证券名称 | +| event_type | string | 否 | 事件类型 | +| activity_type | string | 否 | 活动类型 | +| date | string | 否 | 事件日期 | +| datetime | string | 否 | 事件时间 | +| date_type | string | 否 | 日期类型 | +| content | string | 否 | 事件内容描述 | +| currency | string | 否 | 货币 | +| star | integer | 否 | 重要性(1-3 星) | +| icon | string | 否 | 图标链接 | +| chart_uid | string | 否 | 图表标识符 | +| financial_market_time | string | 否 | 金融市场时间 | +| data_kv | object[] | 否 | 键值数据对 | diff --git a/docs/zh-CN/docs/market/calendar/merge_calendar.md b/docs/zh-CN/docs/market/calendar/merge_calendar.md new file mode 100644 index 00000000..b4205861 --- /dev/null +++ b/docs/zh-CN/docs/market/calendar/merge_calendar.md @@ -0,0 +1,306 @@ +--- +slug: /market/calendar/merge-calendar +title: 合并日历 +sidebar_position: 7 +language_tabs: false +toc_footers: [] +includes: [] +search: true +highlight_theme: '' +headingLevel: 2 +--- + +浏览即将发生的合并与并购事件。 + + +longbridge finance-calendar merge +longbridge finance-calendar merge --market US + + + + +## Parameters + +> **SDK 方法参数。** + +| Name | Type | Required | Description | +| ------ | ------ | -------- | -------------------------------------------- | +| start | string | YES | 开始日期,格式 YYYY-MM-DD | +| end | string | YES | 结束日期,格式 YYYY-MM-DD | +| market | string | NO | 市场筛选:US、HK、SH、SZ,不填则返回所有市场 | + +## Request Example + + + + +```python +from longbridge.openapi import ( + CalendarCategory, + CalendarContext, + Config, + OAuthBuilder, +) + +oauth = OAuthBuilder("your-client-id").build(lambda url: print("Visit:", url)) +config = Config.from_oauth(oauth) +ctx = CalendarContext(config) + +resp = ctx.finance_calendar( + CalendarCategory.Merge, "2026-06-30", "2026-06-30", "US" +) + +for group in resp.list: + for info in group.infos: + print(f" - {info.symbol:12} | {info.counter_name} | {info.date}") +``` + + + + +```python +import asyncio +from longbridge.openapi import ( + AsyncCalendarContext, + CalendarCategory, + 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 = AsyncCalendarContext.create(config) + + resp = await ctx.finance_calendar( + CalendarCategory.Merge, "2026-06-30", "2026-06-30", "US" + ) + + for group in resp.list: + for info in group.infos: + print(f" - {info.symbol:12} | {info.counter_name} | {info.date}") + +if __name__ == "__main__": + asyncio.run(main()) +``` + + + + +```javascript +const { CalendarCategory, CalendarContext, Config, 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 = CalendarContext.new(config) + const resp = await ctx.financeCalendar(CalendarCategory.Merge, '2026-06-30', '2026-06-30', 'US') + console.log(resp) +} +main().catch(console.error) +``` + + + + +```java +import com.longbridge.*; +import com.longbridge.calendar.*; + +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); + CalendarContext ctx = CalendarContext.create(config)) { + FinanceCalendarOptions opts = new FinanceCalendarOptions(); + opts.category = CalendarCategory.Merge; + opts.start = "2026-06-30"; + opts.end = "2026-06-30"; + opts.market = "US"; + var resp = ctx.getFinanceCalendar(opts).get(); + System.out.println(resp); + } + } +} +``` + + + + +```rust +use std::sync::Arc; +use longbridge::{oauth::OAuthBuilder, calendar::{CalendarCategory, CalendarContext}, 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 = CalendarContext::new(config); + let resp = ctx.finance_calendar(CalendarCategory::Merge, "2026-06-30", "2026-06-30", Some("US".to_string())).await?; + println!("{:?}", resp); + Ok(()) +} +``` + + + + +```cpp +#include +#include + +using namespace longbridge; +using namespace longbridge::calendar; + +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); + CalendarContext ctx = CalendarContext::create(config); + ctx.finance_calendar(CalendarCategory::Merge, "2026-06-30", "2026-06-30", "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/calendar" + "github.com/longbridge/openapi-go/config" + "github.com/longbridge/openapi-go/oauth" +) + +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 := calendar.NewFromCfg(conf) + if err != nil { + log.Fatal(err) + } + defer c.Close() + market := "US" + resp, err := c.FinanceCalendar(context.Background(), calendar.CalendarCategoryMerge, "2026-06-30", "2026-06-30", &market) + if err != nil { + log.Fatal(err) + } + fmt.Printf("%+v\n", resp) +} +``` + + + + +## Response + +### Response Example + +```json +{ + "code": 0, + "message": "success", + "data": { + "date": "2026-06-30", + "list": [ + { + "date": "2026-06-30", + "count": 1, + "infos": [ + { + "id": "12345", + "symbol": "AAPL.US", + "market": "US", + "counter_name": "Apple Inc.", + "event_type": "", + "activity_type": "", + "date": "2026-06-30", + "datetime": "", + "content": "", + "star": 0, + "currency": "", + "icon": "", + "chart_uid": "", + "date_type": "", + "financial_market_time": "", + "data_kv": [] + } + ] + } + ] + } +} +``` + +### Response Status + +| Status | Description | Schema | +| ------ | ----------- | ------------------------------------------------- | +| 200 | 成功 | [CalendarEventsResponse](#CalendarEventsResponse) | +| 400 | 请求错误 | None | + +## Schemas + +### CalendarEventsResponse + + + +| Name | Type | Required | Description | +| ---- | -------- | -------- | ------------------------------------------------------------ | +| date | string | 否 | 响应日期 | +| list | object[] | 是 | 日历日期分组列表,见 [CalendarDateGroup](#CalendarDateGroup) | + +### CalendarDateGroup + + + +| Name | Type | Required | Description | +| ----- | -------- | -------- | -------------------------------------------------------- | +| date | string | 是 | 日期 | +| count | integer | 否 | 该日期的事件数量 | +| infos | object[] | 是 | 日历事件列表,见 [CalendarEventInfo](#CalendarEventInfo) | + +### CalendarEventInfo + + + +| Name | Type | Required | Description | +| --------------------- | -------- | -------- | ---------------- | +| id | string | 否 | 事件 ID | +| symbol | string | 否 | 证券代码 | +| market | string | 否 | 市场 | +| counter_name | string | 否 | 证券名称 | +| event_type | string | 否 | 事件类型 | +| activity_type | string | 否 | 活动类型 | +| date | string | 否 | 事件日期 | +| datetime | string | 否 | 事件时间 | +| date_type | string | 否 | 日期类型 | +| content | string | 否 | 事件内容描述 | +| currency | string | 否 | 货币 | +| star | integer | 否 | 重要性(1-3 星) | +| icon | string | 否 | 图标链接 | +| chart_uid | string | 否 | 图表标识符 | +| financial_market_time | string | 否 | 金融市场时间 | +| data_kv | object[] | 否 | 键值数据对 | diff --git a/docs/zh-CN/docs/market/calendar/split_calendar.md b/docs/zh-CN/docs/market/calendar/split_calendar.md index 9917c85b..d2122a73 100644 --- a/docs/zh-CN/docs/market/calendar/split_calendar.md +++ b/docs/zh-CN/docs/market/calendar/split_calendar.md @@ -19,16 +19,15 @@ longbridge finance-calendar split --market HK - ## Parameters > **SDK 方法参数。** -| Name | Type | Required | Description | -| ---- | ---- | -------- | ----------- | -| start | string | YES | 开始日期,格式 YYYY-MM-DD | -| end | string | YES | 结束日期,格式 YYYY-MM-DD | -| market | string | NO | 市场筛选:US、HK、SH、SZ,不填则返回所有市场 | +| Name | Type | Required | Description | +| ------ | ------ | -------- | -------------------------------------------- | +| start | string | YES | 开始日期,格式 YYYY-MM-DD | +| end | string | YES | 结束日期,格式 YYYY-MM-DD | +| market | string | NO | 市场筛选:US、HK、SH、SZ,不填则返回所有市场 | ## Request Example @@ -36,14 +35,24 @@ longbridge finance-calendar split --market HK ```python -from longbridge.openapi import CalendarContext, Config, OAuthBuilder +from longbridge.openapi import ( + CalendarCategory, + CalendarContext, + Config, + OAuthBuilder, +) oauth = OAuthBuilder("your-client-id").build(lambda url: print("Visit:", url)) config = Config.from_oauth(oauth) ctx = CalendarContext(config) -resp = ctx.split_calendar("AAPL.US") -print(resp) +resp = ctx.finance_calendar( + CalendarCategory.Split, "2026-06-30", "2026-06-30", "HK" +) + +for group in resp.list: + for info in group.infos: + print(f" - {info.symbol:12} | {info.counter_name} | {info.date}") ``` @@ -51,15 +60,27 @@ print(resp) ```python import asyncio -from longbridge.openapi import AsyncCalendarContext, Config, OAuthBuilder +from longbridge.openapi import ( + AsyncCalendarContext, + CalendarCategory, + Config, + OAuthBuilder, +) async def main() -> None: - oauth = await OAuthBuilder("your-client-id").build_async(lambda url: print("Visit:", url)) + oauth = await OAuthBuilder("your-client-id").build_async( + lambda url: print("Visit:", url) + ) config = Config.from_oauth(oauth) ctx = AsyncCalendarContext.create(config) - resp = await ctx.split_calendar("AAPL.US") - print(resp) + resp = await ctx.finance_calendar( + CalendarCategory.Split, "2026-06-30", "2026-06-30", "HK" + ) + + for group in resp.list: + for info in group.infos: + print(f" - {info.symbol:12} | {info.counter_name} | {info.date}") if __name__ == "__main__": asyncio.run(main()) @@ -69,7 +90,7 @@ if __name__ == "__main__": ```javascript -const { Config, CalendarContext, OAuth } = require('longbridge') +const { CalendarCategory, CalendarContext, Config, OAuth } = require('longbridge') async function main() { const oauth = await OAuth.build('your-client-id', (_, url) => { @@ -77,7 +98,7 @@ async function main() { }) const config = Config.fromOAuth(oauth) const ctx = CalendarContext.new(config) - const resp = await ctx.split_calendar('AAPL.US') + const resp = await ctx.financeCalendar(CalendarCategory.Split, '2026-06-30', '2026-06-30', 'HK') console.log(resp) } main().catch(console.error) @@ -95,7 +116,12 @@ class Main { try (OAuth oauth = new OAuthBuilder("your-client-id").build(url -> System.out.println("Open to authorize: " + url)).get(); Config config = Config.fromOAuth(oauth); CalendarContext ctx = CalendarContext.create(config)) { - var resp = ctx.getSplitCalendar("AAPL.US").get(); + FinanceCalendarOptions opts = new FinanceCalendarOptions(); + opts.category = CalendarCategory.Split; + opts.start = "2026-06-30"; + opts.end = "2026-06-30"; + opts.market = "HK"; + var resp = ctx.getFinanceCalendar(opts).get(); System.out.println(resp); } } @@ -107,14 +133,14 @@ class Main { ```rust use std::sync::Arc; -use longbridge::{oauth::OAuthBuilder, calendar::CalendarContext, Config}; +use longbridge::{oauth::OAuthBuilder, calendar::{CalendarCategory, CalendarContext}, 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 = CalendarContext::new(config); - let resp = ctx.split_calendar("AAPL.US").await?; + let resp = ctx.finance_calendar(CalendarCategory::Split, "2026-06-30", "2026-06-30", Some("HK".to_string())).await?; println!("{:?}", resp); Ok(()) } @@ -137,7 +163,7 @@ int main() { if (!res) return; Config config = Config::from_oauth(*res); CalendarContext ctx = CalendarContext::create(config); - ctx.split_calendar("AAPL.US", [](auto resp) { + ctx.finance_calendar(CalendarCategory::Split, "2026-06-30", "2026-06-30", "HK", [](auto resp) { if (resp) std::cout << "OK" << std::endl; }); }); @@ -156,9 +182,9 @@ import ( "fmt" "log" + "github.com/longbridge/openapi-go/calendar" "github.com/longbridge/openapi-go/config" "github.com/longbridge/openapi-go/oauth" - "github.com/longbridge/openapi-go/calendar" ) func main() { @@ -176,7 +202,8 @@ func main() { log.Fatal(err) } defer c.Close() - resp, err := c.SplitCalendar(context.Background(), "AAPL.US") + market := "HK" + resp, err := c.FinanceCalendar(context.Background(), calendar.CalendarCategorySplit, "2026-06-30", "2026-06-30", &market) if err != nil { log.Fatal(err) } @@ -189,7 +216,6 @@ func main() { ## Response - ### Response Example ```json @@ -197,20 +223,20 @@ func main() { "code": 0, "message": "success", "data": { - "date": "2026-04-30", + "date": "2026-06-30", "list": [ { - "date": "2026-04-30", - "count": 2228, + "date": "2026-06-30", + "count": 1, "infos": [ { "id": "12345", - "symbol": "AAPL.US", - "market": "US", - "counter_name": "Apple Inc.", + "symbol": "0700.HK", + "market": "HK", + "counter_name": "Tencent Holdings", "event_type": "", "activity_type": "", - "date": "2026-05-14", + "date": "2026-06-30", "datetime": "", "content": "", "star": 0, @@ -230,10 +256,10 @@ func main() { ### Response Status -| Status | Description | Schema | -| ------ | ----------- | ------ | -| 200 | 成功 | [CalendarEventsResponse](#CalendarEventsResponse) | -| 400 | 请求错误 | None | +| Status | Description | Schema | +| ------ | ----------- | ------------------------------------------------- | +| 200 | 成功 | [CalendarEventsResponse](#CalendarEventsResponse) | +| 400 | 请求错误 | None | ## Schemas @@ -241,40 +267,40 @@ func main() { -| Name | Type | Required | Description | -| ---- | ---- | -------- | ----------- | -| date | string | 否 | 响应日期 | -| list | object[] | 是 | 日历日期分组列表,见 [CalendarDateGroup](#CalendarDateGroup) | +| Name | Type | Required | Description | +| ---- | -------- | -------- | ------------------------------------------------------------ | +| date | string | 否 | 响应日期 | +| list | object[] | 是 | 日历日期分组列表,见 [CalendarDateGroup](#CalendarDateGroup) | ### CalendarDateGroup -| Name | Type | Required | Description | -| ---- | ---- | -------- | ----------- | -| date | string | 是 | 日期 | -| count | integer | 否 | 该日期的事件数量 | -| infos | object[] | 是 | 日历事件列表,见 [CalendarEventInfo](#CalendarEventInfo) | +| Name | Type | Required | Description | +| ----- | -------- | -------- | -------------------------------------------------------- | +| date | string | 是 | 日期 | +| count | integer | 否 | 该日期的事件数量 | +| infos | object[] | 是 | 日历事件列表,见 [CalendarEventInfo](#CalendarEventInfo) | ### CalendarEventInfo -| Name | Type | Required | Description | -| ---- | ---- | -------- | ----------- | -| id | string | 否 | 事件 ID | -| symbol | string | 否 | 证券代码 | -| market | string | 否 | 市场 | -| counter_name | string | 否 | 证券名称 | -| event_type | string | 否 | 事件类型 | -| activity_type | string | 否 | 活动类型 | -| date | string | 否 | 事件日期 | -| datetime | string | 否 | 事件时间 | -| date_type | string | 否 | 日期类型 | -| content | string | 否 | 事件内容描述 | -| currency | string | 否 | 货币 | -| star | integer | 否 | 重要性(1-3 星) | -| icon | string | 否 | 图标链接 | -| chart_uid | string | 否 | 图表标识符 | -| financial_market_time | string | 否 | 金融市场时间 | -| data_kv | object[] | 否 | 键值数据对 | +| Name | Type | Required | Description | +| --------------------- | -------- | -------- | ---------------- | +| id | string | 否 | 事件 ID | +| symbol | string | 否 | 证券代码 | +| market | string | 否 | 市场 | +| counter_name | string | 否 | 证券名称 | +| event_type | string | 否 | 事件类型 | +| activity_type | string | 否 | 活动类型 | +| date | string | 否 | 事件日期 | +| datetime | string | 否 | 事件时间 | +| date_type | string | 否 | 日期类型 | +| content | string | 否 | 事件内容描述 | +| currency | string | 否 | 货币 | +| star | integer | 否 | 重要性(1-3 星) | +| icon | string | 否 | 图标链接 | +| chart_uid | string | 否 | 图表标识符 | +| financial_market_time | string | 否 | 金融市场时间 | +| data_kv | object[] | 否 | 键值数据对 | diff --git a/docs/zh-HK/docs/market/calendar/dividend_calendar.md b/docs/zh-HK/docs/market/calendar/dividend_calendar.md index f9e6380a..6ba10145 100644 --- a/docs/zh-HK/docs/market/calendar/dividend_calendar.md +++ b/docs/zh-HK/docs/market/calendar/dividend_calendar.md @@ -19,16 +19,15 @@ longbridge finance-calendar dividend --filter positions - ## Parameters > **SDK 方法參數。** -| Name | Type | Required | Description | -| ---- | ---- | -------- | ----------- | -| start | string | YES | 開始日期,格式 YYYY-MM-DD | -| end | string | YES | 結束日期,格式 YYYY-MM-DD | -| market | string | NO | 市場篩選:US、HK、SH、SZ,不填則返回所有市場 | +| Name | Type | Required | Description | +| ------ | ------ | -------- | -------------------------------------------- | +| start | string | YES | 開始日期,格式 YYYY-MM-DD | +| end | string | YES | 結束日期,格式 YYYY-MM-DD | +| market | string | NO | 市場篩選:US、HK、SH、SZ,不填則返回所有市場 | ## Request Example @@ -36,14 +35,24 @@ longbridge finance-calendar dividend --filter positions ```python -from longbridge.openapi import CalendarContext, Config, OAuthBuilder +from longbridge.openapi import ( + CalendarCategory, + CalendarContext, + Config, + OAuthBuilder, +) oauth = OAuthBuilder("your-client-id").build(lambda url: print("Visit:", url)) config = Config.from_oauth(oauth) ctx = CalendarContext(config) -resp = ctx.dividend_calendar("AAPL.US") -print(resp) +resp = ctx.finance_calendar( + CalendarCategory.Dividend, "2026-06-30", "2026-06-30", "US" +) + +for group in resp.list: + for info in group.infos: + print(f" - {info.symbol:12} | {info.counter_name} | {info.date}") ``` @@ -51,15 +60,27 @@ print(resp) ```python import asyncio -from longbridge.openapi import AsyncCalendarContext, Config, OAuthBuilder +from longbridge.openapi import ( + AsyncCalendarContext, + CalendarCategory, + Config, + OAuthBuilder, +) async def main() -> None: - oauth = await OAuthBuilder("your-client-id").build_async(lambda url: print("Visit:", url)) + oauth = await OAuthBuilder("your-client-id").build_async( + lambda url: print("Visit:", url) + ) config = Config.from_oauth(oauth) ctx = AsyncCalendarContext.create(config) - resp = await ctx.dividend_calendar("AAPL.US") - print(resp) + resp = await ctx.finance_calendar( + CalendarCategory.Dividend, "2026-06-30", "2026-06-30", "US" + ) + + for group in resp.list: + for info in group.infos: + print(f" - {info.symbol:12} | {info.counter_name} | {info.date}") if __name__ == "__main__": asyncio.run(main()) @@ -69,7 +90,7 @@ if __name__ == "__main__": ```javascript -const { Config, CalendarContext, OAuth } = require('longbridge') +const { CalendarCategory, CalendarContext, Config, OAuth } = require('longbridge') async function main() { const oauth = await OAuth.build('your-client-id', (_, url) => { @@ -77,7 +98,7 @@ async function main() { }) const config = Config.fromOAuth(oauth) const ctx = CalendarContext.new(config) - const resp = await ctx.dividend_calendar('AAPL.US') + const resp = await ctx.financeCalendar(CalendarCategory.Dividend, '2026-06-30', '2026-06-30', 'US') console.log(resp) } main().catch(console.error) @@ -95,7 +116,12 @@ class Main { try (OAuth oauth = new OAuthBuilder("your-client-id").build(url -> System.out.println("Open to authorize: " + url)).get(); Config config = Config.fromOAuth(oauth); CalendarContext ctx = CalendarContext.create(config)) { - var resp = ctx.getDividendCalendar("AAPL.US").get(); + FinanceCalendarOptions opts = new FinanceCalendarOptions(); + opts.category = CalendarCategory.Dividend; + opts.start = "2026-06-30"; + opts.end = "2026-06-30"; + opts.market = "US"; + var resp = ctx.getFinanceCalendar(opts).get(); System.out.println(resp); } } @@ -107,14 +133,14 @@ class Main { ```rust use std::sync::Arc; -use longbridge::{oauth::OAuthBuilder, calendar::CalendarContext, Config}; +use longbridge::{oauth::OAuthBuilder, calendar::{CalendarCategory, CalendarContext}, 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 = CalendarContext::new(config); - let resp = ctx.dividend_calendar("AAPL.US").await?; + let resp = ctx.finance_calendar(CalendarCategory::Dividend, "2026-06-30", "2026-06-30", Some("US".to_string())).await?; println!("{:?}", resp); Ok(()) } @@ -137,7 +163,7 @@ int main() { if (!res) return; Config config = Config::from_oauth(*res); CalendarContext ctx = CalendarContext::create(config); - ctx.dividend_calendar("AAPL.US", [](auto resp) { + ctx.finance_calendar(CalendarCategory::Dividend, "2026-06-30", "2026-06-30", "US", [](auto resp) { if (resp) std::cout << "OK" << std::endl; }); }); @@ -156,9 +182,9 @@ import ( "fmt" "log" + "github.com/longbridge/openapi-go/calendar" "github.com/longbridge/openapi-go/config" "github.com/longbridge/openapi-go/oauth" - "github.com/longbridge/openapi-go/calendar" ) func main() { @@ -176,7 +202,8 @@ func main() { log.Fatal(err) } defer c.Close() - resp, err := c.DividendCalendar(context.Background(), "AAPL.US") + market := "US" + resp, err := c.FinanceCalendar(context.Background(), calendar.CalendarCategoryDividend, "2026-06-30", "2026-06-30", &market) if err != nil { log.Fatal(err) } @@ -189,7 +216,6 @@ func main() { ## Response - ### Response Example ```json @@ -197,10 +223,10 @@ func main() { "code": 0, "message": "success", "data": { - "date": "2026-04-30", + "date": "2026-06-30", "list": [ { - "date": "2026-04-30", + "date": "2026-06-30", "count": 275, "infos": [ { @@ -210,7 +236,7 @@ func main() { "counter_name": "Apple Inc.", "event_type": "", "activity_type": "", - "date": "2026-05-14", + "date": "2026-06-30", "datetime": "", "content": "", "star": 0, @@ -230,10 +256,10 @@ func main() { ### Response Status -| Status | Description | Schema | -| ------ | ----------- | ------ | -| 200 | 成功 | [CalendarEventsResponse](#CalendarEventsResponse) | -| 400 | 請求錯誤 | None | +| Status | Description | Schema | +| ------ | ----------- | ------------------------------------------------- | +| 200 | 成功 | [CalendarEventsResponse](#CalendarEventsResponse) | +| 400 | 請求錯誤 | None | ## Schemas @@ -241,40 +267,40 @@ func main() { -| Name | Type | Required | Description | -| ---- | ---- | -------- | ----------- | -| date | string | 否 | 響應日期 | -| list | object[] | 是 | 日曆日期分組列表,見 [CalendarDateGroup](#CalendarDateGroup) | +| Name | Type | Required | Description | +| ---- | -------- | -------- | ------------------------------------------------------------ | +| date | string | 否 | 響應日期 | +| list | object[] | 是 | 日曆日期分組列表,見 [CalendarDateGroup](#CalendarDateGroup) | ### CalendarDateGroup -| Name | Type | Required | Description | -| ---- | ---- | -------- | ----------- | -| date | string | 是 | 日期 | -| count | integer | 否 | 該日期的事件數量 | -| infos | object[] | 是 | 日曆事件列表,見 [CalendarEventInfo](#CalendarEventInfo) | +| Name | Type | Required | Description | +| ----- | -------- | -------- | -------------------------------------------------------- | +| date | string | 是 | 日期 | +| count | integer | 否 | 該日期的事件數量 | +| infos | object[] | 是 | 日曆事件列表,見 [CalendarEventInfo](#CalendarEventInfo) | ### CalendarEventInfo -| Name | Type | Required | Description | -| ---- | ---- | -------- | ----------- | -| id | string | 否 | 事件 ID | -| symbol | string | 否 | 證券代碼 | -| market | string | 否 | 市場 | -| counter_name | string | 否 | 證券名稱 | -| event_type | string | 否 | 事件類型 | -| activity_type | string | 否 | 活動類型 | -| date | string | 否 | 事件日期 | -| datetime | string | 否 | 事件時間 | -| date_type | string | 否 | 日期類型 | -| content | string | 否 | 事件內容描述 | -| currency | string | 否 | 貨幣 | -| star | integer | 否 | 重要性(1-3 星) | -| icon | string | 否 | 圖標鏈接 | -| chart_uid | string | 否 | 圖表標識符 | -| financial_market_time | string | 否 | 金融市場時間 | -| data_kv | object[] | 否 | 鍵值數據對 | +| Name | Type | Required | Description | +| --------------------- | -------- | -------- | ---------------- | +| id | string | 否 | 事件 ID | +| symbol | string | 否 | 證券代碼 | +| market | string | 否 | 市場 | +| counter_name | string | 否 | 證券名稱 | +| event_type | string | 否 | 事件類型 | +| activity_type | string | 否 | 活動類型 | +| date | string | 否 | 事件日期 | +| datetime | string | 否 | 事件時間 | +| date_type | string | 否 | 日期類型 | +| content | string | 否 | 事件內容描述 | +| currency | string | 否 | 貨幣 | +| star | integer | 否 | 重要性(1-3 星) | +| icon | string | 否 | 圖標鏈接 | +| chart_uid | string | 否 | 圖表標識符 | +| financial_market_time | string | 否 | 金融市場時間 | +| data_kv | object[] | 否 | 鍵值數據對 | diff --git a/docs/zh-HK/docs/market/calendar/earnings_calendar.md b/docs/zh-HK/docs/market/calendar/earnings_calendar.md index 44d0338a..492e46da 100644 --- a/docs/zh-HK/docs/market/calendar/earnings_calendar.md +++ b/docs/zh-HK/docs/market/calendar/earnings_calendar.md @@ -19,16 +19,15 @@ longbridge finance-calendar report --market US - ## Parameters > **SDK 方法參數。** -| Name | Type | Required | Description | -| ---- | ---- | -------- | ----------- | -| start | string | YES | 開始日期,格式 YYYY-MM-DD | -| end | string | YES | 結束日期,格式 YYYY-MM-DD | -| market | string | NO | 市場篩選:US、HK、SH、SZ,不填則返回所有市場 | +| Name | Type | Required | Description | +| ------ | ------ | -------- | -------------------------------------------- | +| start | string | YES | 開始日期,格式 YYYY-MM-DD | +| end | string | YES | 結束日期,格式 YYYY-MM-DD | +| market | string | NO | 市場篩選:US、HK、SH、SZ,不填則返回所有市場 | ## Request Example @@ -36,14 +35,24 @@ longbridge finance-calendar report --market US ```python -from longbridge.openapi import CalendarContext, Config, OAuthBuilder +from longbridge.openapi import ( + CalendarCategory, + CalendarContext, + Config, + OAuthBuilder, +) oauth = OAuthBuilder("your-client-id").build(lambda url: print("Visit:", url)) config = Config.from_oauth(oauth) ctx = CalendarContext(config) -resp = ctx.earnings_calendar("AAPL.US") -print(resp) +resp = ctx.finance_calendar( + CalendarCategory.Report, "2026-06-30", "2026-06-30", "US" +) + +for group in resp.list: + for info in group.infos: + print(f" - {info.symbol:12} | {info.counter_name} | {info.date}") ``` @@ -51,15 +60,27 @@ print(resp) ```python import asyncio -from longbridge.openapi import AsyncCalendarContext, Config, OAuthBuilder +from longbridge.openapi import ( + AsyncCalendarContext, + CalendarCategory, + Config, + OAuthBuilder, +) async def main() -> None: - oauth = await OAuthBuilder("your-client-id").build_async(lambda url: print("Visit:", url)) + oauth = await OAuthBuilder("your-client-id").build_async( + lambda url: print("Visit:", url) + ) config = Config.from_oauth(oauth) ctx = AsyncCalendarContext.create(config) - resp = await ctx.earnings_calendar("AAPL.US") - print(resp) + resp = await ctx.finance_calendar( + CalendarCategory.Report, "2026-06-30", "2026-06-30", "US" + ) + + for group in resp.list: + for info in group.infos: + print(f" - {info.symbol:12} | {info.counter_name} | {info.date}") if __name__ == "__main__": asyncio.run(main()) @@ -69,7 +90,7 @@ if __name__ == "__main__": ```javascript -const { Config, CalendarContext, OAuth } = require('longbridge') +const { CalendarCategory, CalendarContext, Config, OAuth } = require('longbridge') async function main() { const oauth = await OAuth.build('your-client-id', (_, url) => { @@ -77,7 +98,7 @@ async function main() { }) const config = Config.fromOAuth(oauth) const ctx = CalendarContext.new(config) - const resp = await ctx.earnings_calendar('AAPL.US') + const resp = await ctx.financeCalendar(CalendarCategory.Report, '2026-06-30', '2026-06-30', 'US') console.log(resp) } main().catch(console.error) @@ -95,7 +116,12 @@ class Main { try (OAuth oauth = new OAuthBuilder("your-client-id").build(url -> System.out.println("Open to authorize: " + url)).get(); Config config = Config.fromOAuth(oauth); CalendarContext ctx = CalendarContext.create(config)) { - var resp = ctx.getEarningsCalendar("AAPL.US").get(); + FinanceCalendarOptions opts = new FinanceCalendarOptions(); + opts.category = CalendarCategory.Report; + opts.start = "2026-06-30"; + opts.end = "2026-06-30"; + opts.market = "US"; + var resp = ctx.getFinanceCalendar(opts).get(); System.out.println(resp); } } @@ -107,14 +133,14 @@ class Main { ```rust use std::sync::Arc; -use longbridge::{oauth::OAuthBuilder, calendar::CalendarContext, Config}; +use longbridge::{oauth::OAuthBuilder, calendar::{CalendarCategory, CalendarContext}, 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 = CalendarContext::new(config); - let resp = ctx.earnings_calendar("AAPL.US").await?; + let resp = ctx.finance_calendar(CalendarCategory::Report, "2026-06-30", "2026-06-30", Some("US".to_string())).await?; println!("{:?}", resp); Ok(()) } @@ -137,7 +163,7 @@ int main() { if (!res) return; Config config = Config::from_oauth(*res); CalendarContext ctx = CalendarContext::create(config); - ctx.earnings_calendar("AAPL.US", [](auto resp) { + ctx.finance_calendar(CalendarCategory::Report, "2026-06-30", "2026-06-30", "US", [](auto resp) { if (resp) std::cout << "OK" << std::endl; }); }); @@ -156,9 +182,9 @@ import ( "fmt" "log" + "github.com/longbridge/openapi-go/calendar" "github.com/longbridge/openapi-go/config" "github.com/longbridge/openapi-go/oauth" - "github.com/longbridge/openapi-go/calendar" ) func main() { @@ -176,7 +202,8 @@ func main() { log.Fatal(err) } defer c.Close() - resp, err := c.EarningsCalendar(context.Background(), "AAPL.US") + market := "US" + resp, err := c.FinanceCalendar(context.Background(), calendar.CalendarCategoryReport, "2026-06-30", "2026-06-30", &market) if err != nil { log.Fatal(err) } @@ -189,7 +216,6 @@ func main() { ## Response - ### Response Example ```json @@ -197,11 +223,11 @@ func main() { "code": 0, "message": "success", "data": { - "date": "2026-04-30", + "date": "2026-06-30", "list": [ { - "date": "2026-04-30", - "count": 2228, + "date": "2026-06-30", + "count": 1, "infos": [ { "id": "12345", @@ -210,7 +236,7 @@ func main() { "counter_name": "Apple Inc.", "event_type": "", "activity_type": "", - "date": "2026-05-14", + "date": "2026-06-30", "datetime": "", "content": "", "star": 0, @@ -230,10 +256,10 @@ func main() { ### Response Status -| Status | Description | Schema | -| ------ | ----------- | ------ | -| 200 | 成功 | [CalendarEventsResponse](#CalendarEventsResponse) | -| 400 | 請求錯誤 | None | +| Status | Description | Schema | +| ------ | ----------- | ------------------------------------------------- | +| 200 | 成功 | [CalendarEventsResponse](#CalendarEventsResponse) | +| 400 | 請求錯誤 | None | ## Schemas @@ -241,40 +267,40 @@ func main() { -| Name | Type | Required | Description | -| ---- | ---- | -------- | ----------- | -| date | string | 否 | 響應日期 | -| list | object[] | 是 | 日曆日期分組列表,見 [CalendarDateGroup](#CalendarDateGroup) | +| Name | Type | Required | Description | +| ---- | -------- | -------- | ------------------------------------------------------------ | +| date | string | 否 | 響應日期 | +| list | object[] | 是 | 日曆日期分組列表,見 [CalendarDateGroup](#CalendarDateGroup) | ### CalendarDateGroup -| Name | Type | Required | Description | -| ---- | ---- | -------- | ----------- | -| date | string | 是 | 日期 | -| count | integer | 否 | 該日期的事件數量 | -| infos | object[] | 是 | 日曆事件列表,見 [CalendarEventInfo](#CalendarEventInfo) | +| Name | Type | Required | Description | +| ----- | -------- | -------- | -------------------------------------------------------- | +| date | string | 是 | 日期 | +| count | integer | 否 | 該日期的事件數量 | +| infos | object[] | 是 | 日曆事件列表,見 [CalendarEventInfo](#CalendarEventInfo) | ### CalendarEventInfo -| Name | Type | Required | Description | -| ---- | ---- | -------- | ----------- | -| id | string | 否 | 事件 ID | -| symbol | string | 否 | 證券代碼 | -| market | string | 否 | 市場 | -| counter_name | string | 否 | 證券名稱 | -| event_type | string | 否 | 事件類型 | -| activity_type | string | 否 | 活動類型 | -| date | string | 否 | 事件日期 | -| datetime | string | 否 | 事件時間 | -| date_type | string | 否 | 日期類型 | -| content | string | 否 | 事件內容描述 | -| currency | string | 否 | 貨幣 | -| star | integer | 否 | 重要性(1-3 星) | -| icon | string | 否 | 圖標鏈接 | -| chart_uid | string | 否 | 圖表標識符 | -| financial_market_time | string | 否 | 金融市場時間 | -| data_kv | object[] | 否 | 鍵值數據對 | +| Name | Type | Required | Description | +| --------------------- | -------- | -------- | ---------------- | +| id | string | 否 | 事件 ID | +| symbol | string | 否 | 證券代碼 | +| market | string | 否 | 市場 | +| counter_name | string | 否 | 證券名稱 | +| event_type | string | 否 | 事件類型 | +| activity_type | string | 否 | 活動類型 | +| date | string | 否 | 事件日期 | +| datetime | string | 否 | 事件時間 | +| date_type | string | 否 | 日期類型 | +| content | string | 否 | 事件內容描述 | +| currency | string | 否 | 貨幣 | +| star | integer | 否 | 重要性(1-3 星) | +| icon | string | 否 | 圖標鏈接 | +| chart_uid | string | 否 | 圖表標識符 | +| financial_market_time | string | 否 | 金融市場時間 | +| data_kv | object[] | 否 | 鍵值數據對 | diff --git a/docs/zh-HK/docs/market/calendar/ipo_calendar.md b/docs/zh-HK/docs/market/calendar/ipo_calendar.md index bd7bb7c9..b90f7e8f 100644 --- a/docs/zh-HK/docs/market/calendar/ipo_calendar.md +++ b/docs/zh-HK/docs/market/calendar/ipo_calendar.md @@ -19,16 +19,15 @@ longbridge finance-calendar ipo --market US - ## Parameters > **SDK 方法參數。** -| Name | Type | Required | Description | -| ---- | ---- | -------- | ----------- | -| start | string | YES | 開始日期,格式 YYYY-MM-DD | -| end | string | YES | 結束日期,格式 YYYY-MM-DD | -| market | string | NO | 市場篩選:US、HK、SH、SZ,不填則返回所有市場 | +| Name | Type | Required | Description | +| ------ | ------ | -------- | -------------------------------------------- | +| start | string | YES | 開始日期,格式 YYYY-MM-DD | +| end | string | YES | 結束日期,格式 YYYY-MM-DD | +| market | string | NO | 市場篩選:US、HK、SH、SZ,不填則返回所有市場 | ## Request Example @@ -36,14 +35,24 @@ longbridge finance-calendar ipo --market US ```python -from longbridge.openapi import CalendarContext, Config, OAuthBuilder +from longbridge.openapi import ( + CalendarCategory, + CalendarContext, + Config, + OAuthBuilder, +) oauth = OAuthBuilder("your-client-id").build(lambda url: print("Visit:", url)) config = Config.from_oauth(oauth) ctx = CalendarContext(config) -resp = ctx.ipo_calendar("AAPL.US") -print(resp) +resp = ctx.finance_calendar( + CalendarCategory.Ipo, "2026-06-30", "2026-06-30", "US" +) + +for group in resp.list: + for info in group.infos: + print(f" - {info.symbol:12} | {info.counter_name} | {info.date}") ``` @@ -51,15 +60,27 @@ print(resp) ```python import asyncio -from longbridge.openapi import AsyncCalendarContext, Config, OAuthBuilder +from longbridge.openapi import ( + AsyncCalendarContext, + CalendarCategory, + Config, + OAuthBuilder, +) async def main() -> None: - oauth = await OAuthBuilder("your-client-id").build_async(lambda url: print("Visit:", url)) + oauth = await OAuthBuilder("your-client-id").build_async( + lambda url: print("Visit:", url) + ) config = Config.from_oauth(oauth) ctx = AsyncCalendarContext.create(config) - resp = await ctx.ipo_calendar("AAPL.US") - print(resp) + resp = await ctx.finance_calendar( + CalendarCategory.Ipo, "2026-06-30", "2026-06-30", "US" + ) + + for group in resp.list: + for info in group.infos: + print(f" - {info.symbol:12} | {info.counter_name} | {info.date}") if __name__ == "__main__": asyncio.run(main()) @@ -69,7 +90,7 @@ if __name__ == "__main__": ```javascript -const { Config, CalendarContext, OAuth } = require('longbridge') +const { CalendarCategory, CalendarContext, Config, OAuth } = require('longbridge') async function main() { const oauth = await OAuth.build('your-client-id', (_, url) => { @@ -77,7 +98,7 @@ async function main() { }) const config = Config.fromOAuth(oauth) const ctx = CalendarContext.new(config) - const resp = await ctx.ipo_calendar('AAPL.US') + const resp = await ctx.financeCalendar(CalendarCategory.Ipo, '2026-06-30', '2026-06-30', 'US') console.log(resp) } main().catch(console.error) @@ -95,7 +116,12 @@ class Main { try (OAuth oauth = new OAuthBuilder("your-client-id").build(url -> System.out.println("Open to authorize: " + url)).get(); Config config = Config.fromOAuth(oauth); CalendarContext ctx = CalendarContext.create(config)) { - var resp = ctx.getIpoCalendar("AAPL.US").get(); + FinanceCalendarOptions opts = new FinanceCalendarOptions(); + opts.category = CalendarCategory.Ipo; + opts.start = "2026-06-30"; + opts.end = "2026-06-30"; + opts.market = "US"; + var resp = ctx.getFinanceCalendar(opts).get(); System.out.println(resp); } } @@ -107,14 +133,14 @@ class Main { ```rust use std::sync::Arc; -use longbridge::{oauth::OAuthBuilder, calendar::CalendarContext, Config}; +use longbridge::{oauth::OAuthBuilder, calendar::{CalendarCategory, CalendarContext}, 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 = CalendarContext::new(config); - let resp = ctx.ipo_calendar("AAPL.US").await?; + let resp = ctx.finance_calendar(CalendarCategory::Ipo, "2026-06-30", "2026-06-30", Some("US".to_string())).await?; println!("{:?}", resp); Ok(()) } @@ -137,7 +163,7 @@ int main() { if (!res) return; Config config = Config::from_oauth(*res); CalendarContext ctx = CalendarContext::create(config); - ctx.ipo_calendar("AAPL.US", [](auto resp) { + ctx.finance_calendar(CalendarCategory::Ipo, "2026-06-30", "2026-06-30", "US", [](auto resp) { if (resp) std::cout << "OK" << std::endl; }); }); @@ -156,9 +182,9 @@ import ( "fmt" "log" + "github.com/longbridge/openapi-go/calendar" "github.com/longbridge/openapi-go/config" "github.com/longbridge/openapi-go/oauth" - "github.com/longbridge/openapi-go/calendar" ) func main() { @@ -176,7 +202,8 @@ func main() { log.Fatal(err) } defer c.Close() - resp, err := c.IpoCalendar(context.Background(), "AAPL.US") + market := "US" + resp, err := c.FinanceCalendar(context.Background(), calendar.CalendarCategoryIpo, "2026-06-30", "2026-06-30", &market) if err != nil { log.Fatal(err) } @@ -189,7 +216,6 @@ func main() { ## Response - ### Response Example ```json @@ -197,10 +223,10 @@ func main() { "code": 0, "message": "success", "data": { - "date": "2026-04-30", + "date": "2026-06-30", "list": [ { - "date": "2026-05-05", + "date": "2026-06-30", "count": 1, "infos": [ { @@ -210,7 +236,7 @@ func main() { "counter_name": "Apple Inc.", "event_type": "", "activity_type": "", - "date": "2026-05-14", + "date": "2026-06-30", "datetime": "", "content": "", "star": 0, @@ -230,10 +256,10 @@ func main() { ### Response Status -| Status | Description | Schema | -| ------ | ----------- | ------ | -| 200 | 成功 | [CalendarEventsResponse](#CalendarEventsResponse) | -| 400 | 請求錯誤 | None | +| Status | Description | Schema | +| ------ | ----------- | ------------------------------------------------- | +| 200 | 成功 | [CalendarEventsResponse](#CalendarEventsResponse) | +| 400 | 請求錯誤 | None | ## Schemas @@ -241,40 +267,40 @@ func main() { -| Name | Type | Required | Description | -| ---- | ---- | -------- | ----------- | -| date | string | 否 | 響應日期 | -| list | object[] | 是 | 日曆日期分組列表,見 [CalendarDateGroup](#CalendarDateGroup) | +| Name | Type | Required | Description | +| ---- | -------- | -------- | ------------------------------------------------------------ | +| date | string | 否 | 響應日期 | +| list | object[] | 是 | 日曆日期分組列表,見 [CalendarDateGroup](#CalendarDateGroup) | ### CalendarDateGroup -| Name | Type | Required | Description | -| ---- | ---- | -------- | ----------- | -| date | string | 是 | 日期 | -| count | integer | 否 | 該日期的事件數量 | -| infos | object[] | 是 | 日曆事件列表,見 [CalendarEventInfo](#CalendarEventInfo) | +| Name | Type | Required | Description | +| ----- | -------- | -------- | -------------------------------------------------------- | +| date | string | 是 | 日期 | +| count | integer | 否 | 該日期的事件數量 | +| infos | object[] | 是 | 日曆事件列表,見 [CalendarEventInfo](#CalendarEventInfo) | ### CalendarEventInfo -| Name | Type | Required | Description | -| ---- | ---- | -------- | ----------- | -| id | string | 否 | 事件 ID | -| symbol | string | 否 | 證券代碼 | -| market | string | 否 | 市場 | -| counter_name | string | 否 | 證券名稱 | -| event_type | string | 否 | 事件類型 | -| activity_type | string | 否 | 活動類型 | -| date | string | 否 | 事件日期 | -| datetime | string | 否 | 事件時間 | -| date_type | string | 否 | 日期類型 | -| content | string | 否 | 事件內容描述 | -| currency | string | 否 | 貨幣 | -| star | integer | 否 | 重要性(1-3 星) | -| icon | string | 否 | 圖標鏈接 | -| chart_uid | string | 否 | 圖表標識符 | -| financial_market_time | string | 否 | 金融市場時間 | -| data_kv | object[] | 否 | 鍵值數據對 | +| Name | Type | Required | Description | +| --------------------- | -------- | -------- | ---------------- | +| id | string | 否 | 事件 ID | +| symbol | string | 否 | 證券代碼 | +| market | string | 否 | 市場 | +| counter_name | string | 否 | 證券名稱 | +| event_type | string | 否 | 事件類型 | +| activity_type | string | 否 | 活動類型 | +| date | string | 否 | 事件日期 | +| datetime | string | 否 | 事件時間 | +| date_type | string | 否 | 日期類型 | +| content | string | 否 | 事件內容描述 | +| currency | string | 否 | 貨幣 | +| star | integer | 否 | 重要性(1-3 星) | +| icon | string | 否 | 圖標鏈接 | +| chart_uid | string | 否 | 圖表標識符 | +| financial_market_time | string | 否 | 金融市場時間 | +| data_kv | object[] | 否 | 鍵值數據對 | diff --git a/docs/zh-HK/docs/market/calendar/macro_calendar.md b/docs/zh-HK/docs/market/calendar/macro_calendar.md index 148cecd1..c097b99c 100644 --- a/docs/zh-HK/docs/market/calendar/macro_calendar.md +++ b/docs/zh-HK/docs/market/calendar/macro_calendar.md @@ -19,16 +19,15 @@ longbridge finance-calendar macrodata --market US - ## Parameters > **SDK 方法參數。** -| Name | Type | Required | Description | -| ---- | ---- | -------- | ----------- | -| start | string | YES | 開始日期,格式 YYYY-MM-DD | -| end | string | YES | 結束日期,格式 YYYY-MM-DD | -| market | string | NO | 市場篩選:US、HK、SH、SZ,不填則返回所有市場 | +| Name | Type | Required | Description | +| ------ | ------ | -------- | -------------------------------------------- | +| start | string | YES | 開始日期,格式 YYYY-MM-DD | +| end | string | YES | 結束日期,格式 YYYY-MM-DD | +| market | string | NO | 市場篩選:US、HK、SH、SZ,不填則返回所有市場 | ## Request Example @@ -36,14 +35,24 @@ longbridge finance-calendar macrodata --market US ```python -from longbridge.openapi import CalendarContext, Config, OAuthBuilder +from longbridge.openapi import ( + CalendarCategory, + CalendarContext, + Config, + OAuthBuilder, +) oauth = OAuthBuilder("your-client-id").build(lambda url: print("Visit:", url)) config = Config.from_oauth(oauth) ctx = CalendarContext(config) -resp = ctx.macro_calendar("AAPL.US") -print(resp) +resp = ctx.finance_calendar( + CalendarCategory.MacroData, "2026-06-30", "2026-06-30", "US" +) + +for group in resp.list: + for info in group.infos: + print(f" - {info.content} | {info.date}") ``` @@ -51,15 +60,27 @@ print(resp) ```python import asyncio -from longbridge.openapi import AsyncCalendarContext, Config, OAuthBuilder +from longbridge.openapi import ( + AsyncCalendarContext, + CalendarCategory, + Config, + OAuthBuilder, +) async def main() -> None: - oauth = await OAuthBuilder("your-client-id").build_async(lambda url: print("Visit:", url)) + oauth = await OAuthBuilder("your-client-id").build_async( + lambda url: print("Visit:", url) + ) config = Config.from_oauth(oauth) ctx = AsyncCalendarContext.create(config) - resp = await ctx.macro_calendar("AAPL.US") - print(resp) + resp = await ctx.finance_calendar( + CalendarCategory.MacroData, "2026-06-30", "2026-06-30", "US" + ) + + for group in resp.list: + for info in group.infos: + print(f" - {info.content} | {info.date}") if __name__ == "__main__": asyncio.run(main()) @@ -69,7 +90,7 @@ if __name__ == "__main__": ```javascript -const { Config, CalendarContext, OAuth } = require('longbridge') +const { CalendarCategory, CalendarContext, Config, OAuth } = require('longbridge') async function main() { const oauth = await OAuth.build('your-client-id', (_, url) => { @@ -77,7 +98,7 @@ async function main() { }) const config = Config.fromOAuth(oauth) const ctx = CalendarContext.new(config) - const resp = await ctx.macro_calendar('AAPL.US') + const resp = await ctx.financeCalendar(CalendarCategory.MacroData, '2026-06-30', '2026-06-30', 'US') console.log(resp) } main().catch(console.error) @@ -95,7 +116,12 @@ class Main { try (OAuth oauth = new OAuthBuilder("your-client-id").build(url -> System.out.println("Open to authorize: " + url)).get(); Config config = Config.fromOAuth(oauth); CalendarContext ctx = CalendarContext.create(config)) { - var resp = ctx.getMacroCalendar("AAPL.US").get(); + FinanceCalendarOptions opts = new FinanceCalendarOptions(); + opts.category = CalendarCategory.MacroData; + opts.start = "2026-06-30"; + opts.end = "2026-06-30"; + opts.market = "US"; + var resp = ctx.getFinanceCalendar(opts).get(); System.out.println(resp); } } @@ -107,14 +133,14 @@ class Main { ```rust use std::sync::Arc; -use longbridge::{oauth::OAuthBuilder, calendar::CalendarContext, Config}; +use longbridge::{oauth::OAuthBuilder, calendar::{CalendarCategory, CalendarContext}, 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 = CalendarContext::new(config); - let resp = ctx.macro_calendar("AAPL.US").await?; + let resp = ctx.finance_calendar(CalendarCategory::MacroData, "2026-06-30", "2026-06-30", Some("US".to_string())).await?; println!("{:?}", resp); Ok(()) } @@ -137,7 +163,7 @@ int main() { if (!res) return; Config config = Config::from_oauth(*res); CalendarContext ctx = CalendarContext::create(config); - ctx.macro_calendar("AAPL.US", [](auto resp) { + ctx.finance_calendar(CalendarCategory::MacroData, "2026-06-30", "2026-06-30", "US", [](auto resp) { if (resp) std::cout << "OK" << std::endl; }); }); @@ -156,9 +182,9 @@ import ( "fmt" "log" + "github.com/longbridge/openapi-go/calendar" "github.com/longbridge/openapi-go/config" "github.com/longbridge/openapi-go/oauth" - "github.com/longbridge/openapi-go/calendar" ) func main() { @@ -176,7 +202,8 @@ func main() { log.Fatal(err) } defer c.Close() - resp, err := c.MacroCalendar(context.Background(), "AAPL.US") + market := "US" + resp, err := c.FinanceCalendar(context.Background(), calendar.CalendarCategoryMacroData, "2026-06-30", "2026-06-30", &market) if err != nil { log.Fatal(err) } @@ -189,7 +216,6 @@ func main() { ## Response - ### Response Example ```json @@ -197,22 +223,22 @@ func main() { "code": 0, "message": "success", "data": { - "date": "2026-04-30", + "date": "2026-06-30", "list": [ { - "date": "2026-05-02", + "date": "2026-06-30", "count": 0, "infos": [ { "id": "12345", - "symbol": "AAPL.US", + "symbol": "", "market": "US", - "counter_name": "Apple Inc.", + "counter_name": "", "event_type": "", "activity_type": "", - "date": "2026-05-14", + "date": "2026-06-30", "datetime": "", - "content": "", + "content": "US Core PPI MoM", "star": 0, "currency": "", "icon": "", @@ -230,10 +256,10 @@ func main() { ### Response Status -| Status | Description | Schema | -| ------ | ----------- | ------ | -| 200 | 成功 | [CalendarEventsResponse](#CalendarEventsResponse) | -| 400 | 請求錯誤 | None | +| Status | Description | Schema | +| ------ | ----------- | ------------------------------------------------- | +| 200 | 成功 | [CalendarEventsResponse](#CalendarEventsResponse) | +| 400 | 請求錯誤 | None | ## Schemas @@ -241,40 +267,40 @@ func main() { -| Name | Type | Required | Description | -| ---- | ---- | -------- | ----------- | -| date | string | 否 | 響應日期 | -| list | object[] | 是 | 日曆日期分組列表,見 [CalendarDateGroup](#CalendarDateGroup) | +| Name | Type | Required | Description | +| ---- | -------- | -------- | ------------------------------------------------------------ | +| date | string | 否 | 響應日期 | +| list | object[] | 是 | 日曆日期分組列表,見 [CalendarDateGroup](#CalendarDateGroup) | ### CalendarDateGroup -| Name | Type | Required | Description | -| ---- | ---- | -------- | ----------- | -| date | string | 是 | 日期 | -| count | integer | 否 | 該日期的事件數量 | -| infos | object[] | 是 | 日曆事件列表,見 [CalendarEventInfo](#CalendarEventInfo) | +| Name | Type | Required | Description | +| ----- | -------- | -------- | -------------------------------------------------------- | +| date | string | 是 | 日期 | +| count | integer | 否 | 該日期的事件數量 | +| infos | object[] | 是 | 日曆事件列表,見 [CalendarEventInfo](#CalendarEventInfo) | ### CalendarEventInfo -| Name | Type | Required | Description | -| ---- | ---- | -------- | ----------- | -| id | string | 否 | 事件 ID | -| symbol | string | 否 | 證券代碼 | -| market | string | 否 | 市場 | -| counter_name | string | 否 | 證券名稱 | -| event_type | string | 否 | 事件類型 | -| activity_type | string | 否 | 活動類型 | -| date | string | 否 | 事件日期 | -| datetime | string | 否 | 事件時間 | -| date_type | string | 否 | 日期類型 | -| content | string | 否 | 事件內容描述 | -| currency | string | 否 | 貨幣 | -| star | integer | 否 | 重要性(1-3 星) | -| icon | string | 否 | 圖標鏈接 | -| chart_uid | string | 否 | 圖表標識符 | -| financial_market_time | string | 否 | 金融市場時間 | -| data_kv | object[] | 否 | 鍵值數據對 | +| Name | Type | Required | Description | +| --------------------- | -------- | -------- | ---------------- | +| id | string | 否 | 事件 ID | +| symbol | string | 否 | 證券代碼 | +| market | string | 否 | 市場 | +| counter_name | string | 否 | 證券名稱 | +| event_type | string | 否 | 事件類型 | +| activity_type | string | 否 | 活動類型 | +| date | string | 否 | 事件日期 | +| datetime | string | 否 | 事件時間 | +| date_type | string | 否 | 日期類型 | +| content | string | 否 | 事件內容描述 | +| currency | string | 否 | 貨幣 | +| star | integer | 否 | 重要性(1-3 星) | +| icon | string | 否 | 圖標鏈接 | +| chart_uid | string | 否 | 圖表標識符 | +| financial_market_time | string | 否 | 金融市場時間 | +| data_kv | object[] | 否 | 鍵值數據對 | diff --git a/docs/zh-HK/docs/market/calendar/meeting_calendar.md b/docs/zh-HK/docs/market/calendar/meeting_calendar.md new file mode 100644 index 00000000..b87324e3 --- /dev/null +++ b/docs/zh-HK/docs/market/calendar/meeting_calendar.md @@ -0,0 +1,306 @@ +--- +slug: /market/calendar/meeting-calendar +title: 股東大會日曆 +sidebar_position: 6 +language_tabs: false +toc_footers: [] +includes: [] +search: true +highlight_theme: '' +headingLevel: 2 +--- + +瀏覽即將舉行的股東大會及公司事件。 + + +longbridge finance-calendar meeting +longbridge finance-calendar meeting --market US + + + + +## Parameters + +> **SDK 方法參數。** + +| Name | Type | Required | Description | +| ------ | ------ | -------- | -------------------------------------------- | +| start | string | YES | 開始日期,格式 YYYY-MM-DD | +| end | string | YES | 結束日期,格式 YYYY-MM-DD | +| market | string | NO | 市場篩選:US、HK、SH、SZ,不填則返回所有市場 | + +## Request Example + + + + +```python +from longbridge.openapi import ( + CalendarCategory, + CalendarContext, + Config, + OAuthBuilder, +) + +oauth = OAuthBuilder("your-client-id").build(lambda url: print("Visit:", url)) +config = Config.from_oauth(oauth) +ctx = CalendarContext(config) + +resp = ctx.finance_calendar( + CalendarCategory.Meeting, "2026-06-30", "2026-06-30", "US" +) + +for group in resp.list: + for info in group.infos: + print(f" - {info.symbol:12} | {info.counter_name} | {info.date}") +``` + + + + +```python +import asyncio +from longbridge.openapi import ( + AsyncCalendarContext, + CalendarCategory, + 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 = AsyncCalendarContext.create(config) + + resp = await ctx.finance_calendar( + CalendarCategory.Meeting, "2026-06-30", "2026-06-30", "US" + ) + + for group in resp.list: + for info in group.infos: + print(f" - {info.symbol:12} | {info.counter_name} | {info.date}") + +if __name__ == "__main__": + asyncio.run(main()) +``` + + + + +```javascript +const { CalendarCategory, CalendarContext, Config, 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 = CalendarContext.new(config) + const resp = await ctx.financeCalendar(CalendarCategory.Meeting, '2026-06-30', '2026-06-30', 'US') + console.log(resp) +} +main().catch(console.error) +``` + + + + +```java +import com.longbridge.*; +import com.longbridge.calendar.*; + +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); + CalendarContext ctx = CalendarContext.create(config)) { + FinanceCalendarOptions opts = new FinanceCalendarOptions(); + opts.category = CalendarCategory.Meeting; + opts.start = "2026-06-30"; + opts.end = "2026-06-30"; + opts.market = "US"; + var resp = ctx.getFinanceCalendar(opts).get(); + System.out.println(resp); + } + } +} +``` + + + + +```rust +use std::sync::Arc; +use longbridge::{oauth::OAuthBuilder, calendar::{CalendarCategory, CalendarContext}, 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 = CalendarContext::new(config); + let resp = ctx.finance_calendar(CalendarCategory::Meeting, "2026-06-30", "2026-06-30", Some("US".to_string())).await?; + println!("{:?}", resp); + Ok(()) +} +``` + + + + +```cpp +#include +#include + +using namespace longbridge; +using namespace longbridge::calendar; + +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); + CalendarContext ctx = CalendarContext::create(config); + ctx.finance_calendar(CalendarCategory::Meeting, "2026-06-30", "2026-06-30", "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/calendar" + "github.com/longbridge/openapi-go/config" + "github.com/longbridge/openapi-go/oauth" +) + +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 := calendar.NewFromCfg(conf) + if err != nil { + log.Fatal(err) + } + defer c.Close() + market := "US" + resp, err := c.FinanceCalendar(context.Background(), calendar.CalendarCategoryMeeting, "2026-06-30", "2026-06-30", &market) + if err != nil { + log.Fatal(err) + } + fmt.Printf("%+v\n", resp) +} +``` + + + + +## Response + +### Response Example + +```json +{ + "code": 0, + "message": "success", + "data": { + "date": "2026-06-30", + "list": [ + { + "date": "2026-06-30", + "count": 1, + "infos": [ + { + "id": "12345", + "symbol": "AAPL.US", + "market": "US", + "counter_name": "Apple Inc.", + "event_type": "", + "activity_type": "", + "date": "2026-06-30", + "datetime": "", + "content": "", + "star": 0, + "currency": "", + "icon": "", + "chart_uid": "", + "date_type": "", + "financial_market_time": "", + "data_kv": [] + } + ] + } + ] + } +} +``` + +### Response Status + +| Status | Description | Schema | +| ------ | ----------- | ------------------------------------------------- | +| 200 | 成功 | [CalendarEventsResponse](#CalendarEventsResponse) | +| 400 | 請求錯誤 | None | + +## Schemas + +### CalendarEventsResponse + + + +| Name | Type | Required | Description | +| ---- | -------- | -------- | ------------------------------------------------------------ | +| date | string | 否 | 響應日期 | +| list | object[] | 是 | 日曆日期分組列表,見 [CalendarDateGroup](#CalendarDateGroup) | + +### CalendarDateGroup + + + +| Name | Type | Required | Description | +| ----- | -------- | -------- | -------------------------------------------------------- | +| date | string | 是 | 日期 | +| count | integer | 否 | 該日期的事件數量 | +| infos | object[] | 是 | 日曆事件列表,見 [CalendarEventInfo](#CalendarEventInfo) | + +### CalendarEventInfo + + + +| Name | Type | Required | Description | +| --------------------- | -------- | -------- | ---------------- | +| id | string | 否 | 事件 ID | +| symbol | string | 否 | 證券代碼 | +| market | string | 否 | 市場 | +| counter_name | string | 否 | 證券名稱 | +| event_type | string | 否 | 事件類型 | +| activity_type | string | 否 | 活動類型 | +| date | string | 否 | 事件日期 | +| datetime | string | 否 | 事件時間 | +| date_type | string | 否 | 日期類型 | +| content | string | 否 | 事件內容描述 | +| currency | string | 否 | 貨幣 | +| star | integer | 否 | 重要性(1-3 星) | +| icon | string | 否 | 圖標鏈接 | +| chart_uid | string | 否 | 圖表標識符 | +| financial_market_time | string | 否 | 金融市場時間 | +| data_kv | object[] | 否 | 鍵值數據對 | diff --git a/docs/zh-HK/docs/market/calendar/merge_calendar.md b/docs/zh-HK/docs/market/calendar/merge_calendar.md new file mode 100644 index 00000000..1b7a4bfc --- /dev/null +++ b/docs/zh-HK/docs/market/calendar/merge_calendar.md @@ -0,0 +1,306 @@ +--- +slug: /market/calendar/merge-calendar +title: 合併日曆 +sidebar_position: 7 +language_tabs: false +toc_footers: [] +includes: [] +search: true +highlight_theme: '' +headingLevel: 2 +--- + +瀏覽即將發生的合併與併購事件。 + + +longbridge finance-calendar merge +longbridge finance-calendar merge --market US + + + + +## Parameters + +> **SDK 方法參數。** + +| Name | Type | Required | Description | +| ------ | ------ | -------- | -------------------------------------------- | +| start | string | YES | 開始日期,格式 YYYY-MM-DD | +| end | string | YES | 結束日期,格式 YYYY-MM-DD | +| market | string | NO | 市場篩選:US、HK、SH、SZ,不填則返回所有市場 | + +## Request Example + + + + +```python +from longbridge.openapi import ( + CalendarCategory, + CalendarContext, + Config, + OAuthBuilder, +) + +oauth = OAuthBuilder("your-client-id").build(lambda url: print("Visit:", url)) +config = Config.from_oauth(oauth) +ctx = CalendarContext(config) + +resp = ctx.finance_calendar( + CalendarCategory.Merge, "2026-06-30", "2026-06-30", "US" +) + +for group in resp.list: + for info in group.infos: + print(f" - {info.symbol:12} | {info.counter_name} | {info.date}") +``` + + + + +```python +import asyncio +from longbridge.openapi import ( + AsyncCalendarContext, + CalendarCategory, + 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 = AsyncCalendarContext.create(config) + + resp = await ctx.finance_calendar( + CalendarCategory.Merge, "2026-06-30", "2026-06-30", "US" + ) + + for group in resp.list: + for info in group.infos: + print(f" - {info.symbol:12} | {info.counter_name} | {info.date}") + +if __name__ == "__main__": + asyncio.run(main()) +``` + + + + +```javascript +const { CalendarCategory, CalendarContext, Config, 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 = CalendarContext.new(config) + const resp = await ctx.financeCalendar(CalendarCategory.Merge, '2026-06-30', '2026-06-30', 'US') + console.log(resp) +} +main().catch(console.error) +``` + + + + +```java +import com.longbridge.*; +import com.longbridge.calendar.*; + +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); + CalendarContext ctx = CalendarContext.create(config)) { + FinanceCalendarOptions opts = new FinanceCalendarOptions(); + opts.category = CalendarCategory.Merge; + opts.start = "2026-06-30"; + opts.end = "2026-06-30"; + opts.market = "US"; + var resp = ctx.getFinanceCalendar(opts).get(); + System.out.println(resp); + } + } +} +``` + + + + +```rust +use std::sync::Arc; +use longbridge::{oauth::OAuthBuilder, calendar::{CalendarCategory, CalendarContext}, 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 = CalendarContext::new(config); + let resp = ctx.finance_calendar(CalendarCategory::Merge, "2026-06-30", "2026-06-30", Some("US".to_string())).await?; + println!("{:?}", resp); + Ok(()) +} +``` + + + + +```cpp +#include +#include + +using namespace longbridge; +using namespace longbridge::calendar; + +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); + CalendarContext ctx = CalendarContext::create(config); + ctx.finance_calendar(CalendarCategory::Merge, "2026-06-30", "2026-06-30", "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/calendar" + "github.com/longbridge/openapi-go/config" + "github.com/longbridge/openapi-go/oauth" +) + +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 := calendar.NewFromCfg(conf) + if err != nil { + log.Fatal(err) + } + defer c.Close() + market := "US" + resp, err := c.FinanceCalendar(context.Background(), calendar.CalendarCategoryMerge, "2026-06-30", "2026-06-30", &market) + if err != nil { + log.Fatal(err) + } + fmt.Printf("%+v\n", resp) +} +``` + + + + +## Response + +### Response Example + +```json +{ + "code": 0, + "message": "success", + "data": { + "date": "2026-06-30", + "list": [ + { + "date": "2026-06-30", + "count": 1, + "infos": [ + { + "id": "12345", + "symbol": "AAPL.US", + "market": "US", + "counter_name": "Apple Inc.", + "event_type": "", + "activity_type": "", + "date": "2026-06-30", + "datetime": "", + "content": "", + "star": 0, + "currency": "", + "icon": "", + "chart_uid": "", + "date_type": "", + "financial_market_time": "", + "data_kv": [] + } + ] + } + ] + } +} +``` + +### Response Status + +| Status | Description | Schema | +| ------ | ----------- | ------------------------------------------------- | +| 200 | 成功 | [CalendarEventsResponse](#CalendarEventsResponse) | +| 400 | 請求錯誤 | None | + +## Schemas + +### CalendarEventsResponse + + + +| Name | Type | Required | Description | +| ---- | -------- | -------- | ------------------------------------------------------------ | +| date | string | 否 | 響應日期 | +| list | object[] | 是 | 日曆日期分組列表,見 [CalendarDateGroup](#CalendarDateGroup) | + +### CalendarDateGroup + + + +| Name | Type | Required | Description | +| ----- | -------- | -------- | -------------------------------------------------------- | +| date | string | 是 | 日期 | +| count | integer | 否 | 該日期的事件數量 | +| infos | object[] | 是 | 日曆事件列表,見 [CalendarEventInfo](#CalendarEventInfo) | + +### CalendarEventInfo + + + +| Name | Type | Required | Description | +| --------------------- | -------- | -------- | ---------------- | +| id | string | 否 | 事件 ID | +| symbol | string | 否 | 證券代碼 | +| market | string | 否 | 市場 | +| counter_name | string | 否 | 證券名稱 | +| event_type | string | 否 | 事件類型 | +| activity_type | string | 否 | 活動類型 | +| date | string | 否 | 事件日期 | +| datetime | string | 否 | 事件時間 | +| date_type | string | 否 | 日期類型 | +| content | string | 否 | 事件內容描述 | +| currency | string | 否 | 貨幣 | +| star | integer | 否 | 重要性(1-3 星) | +| icon | string | 否 | 圖標鏈接 | +| chart_uid | string | 否 | 圖表標識符 | +| financial_market_time | string | 否 | 金融市場時間 | +| data_kv | object[] | 否 | 鍵值數據對 | diff --git a/docs/zh-HK/docs/market/calendar/split_calendar.md b/docs/zh-HK/docs/market/calendar/split_calendar.md index a162ef53..670527f5 100644 --- a/docs/zh-HK/docs/market/calendar/split_calendar.md +++ b/docs/zh-HK/docs/market/calendar/split_calendar.md @@ -19,16 +19,15 @@ longbridge finance-calendar split --market HK - ## Parameters > **SDK 方法參數。** -| Name | Type | Required | Description | -| ---- | ---- | -------- | ----------- | -| start | string | YES | 開始日期,格式 YYYY-MM-DD | -| end | string | YES | 結束日期,格式 YYYY-MM-DD | -| market | string | NO | 市場篩選:US、HK、SH、SZ,不填則返回所有市場 | +| Name | Type | Required | Description | +| ------ | ------ | -------- | -------------------------------------------- | +| start | string | YES | 開始日期,格式 YYYY-MM-DD | +| end | string | YES | 結束日期,格式 YYYY-MM-DD | +| market | string | NO | 市場篩選:US、HK、SH、SZ,不填則返回所有市場 | ## Request Example @@ -36,14 +35,24 @@ longbridge finance-calendar split --market HK ```python -from longbridge.openapi import CalendarContext, Config, OAuthBuilder +from longbridge.openapi import ( + CalendarCategory, + CalendarContext, + Config, + OAuthBuilder, +) oauth = OAuthBuilder("your-client-id").build(lambda url: print("Visit:", url)) config = Config.from_oauth(oauth) ctx = CalendarContext(config) -resp = ctx.split_calendar("AAPL.US") -print(resp) +resp = ctx.finance_calendar( + CalendarCategory.Split, "2026-06-30", "2026-06-30", "HK" +) + +for group in resp.list: + for info in group.infos: + print(f" - {info.symbol:12} | {info.counter_name} | {info.date}") ``` @@ -51,15 +60,27 @@ print(resp) ```python import asyncio -from longbridge.openapi import AsyncCalendarContext, Config, OAuthBuilder +from longbridge.openapi import ( + AsyncCalendarContext, + CalendarCategory, + Config, + OAuthBuilder, +) async def main() -> None: - oauth = await OAuthBuilder("your-client-id").build_async(lambda url: print("Visit:", url)) + oauth = await OAuthBuilder("your-client-id").build_async( + lambda url: print("Visit:", url) + ) config = Config.from_oauth(oauth) ctx = AsyncCalendarContext.create(config) - resp = await ctx.split_calendar("AAPL.US") - print(resp) + resp = await ctx.finance_calendar( + CalendarCategory.Split, "2026-06-30", "2026-06-30", "HK" + ) + + for group in resp.list: + for info in group.infos: + print(f" - {info.symbol:12} | {info.counter_name} | {info.date}") if __name__ == "__main__": asyncio.run(main()) @@ -69,7 +90,7 @@ if __name__ == "__main__": ```javascript -const { Config, CalendarContext, OAuth } = require('longbridge') +const { CalendarCategory, CalendarContext, Config, OAuth } = require('longbridge') async function main() { const oauth = await OAuth.build('your-client-id', (_, url) => { @@ -77,7 +98,7 @@ async function main() { }) const config = Config.fromOAuth(oauth) const ctx = CalendarContext.new(config) - const resp = await ctx.split_calendar('AAPL.US') + const resp = await ctx.financeCalendar(CalendarCategory.Split, '2026-06-30', '2026-06-30', 'HK') console.log(resp) } main().catch(console.error) @@ -95,7 +116,12 @@ class Main { try (OAuth oauth = new OAuthBuilder("your-client-id").build(url -> System.out.println("Open to authorize: " + url)).get(); Config config = Config.fromOAuth(oauth); CalendarContext ctx = CalendarContext.create(config)) { - var resp = ctx.getSplitCalendar("AAPL.US").get(); + FinanceCalendarOptions opts = new FinanceCalendarOptions(); + opts.category = CalendarCategory.Split; + opts.start = "2026-06-30"; + opts.end = "2026-06-30"; + opts.market = "HK"; + var resp = ctx.getFinanceCalendar(opts).get(); System.out.println(resp); } } @@ -107,14 +133,14 @@ class Main { ```rust use std::sync::Arc; -use longbridge::{oauth::OAuthBuilder, calendar::CalendarContext, Config}; +use longbridge::{oauth::OAuthBuilder, calendar::{CalendarCategory, CalendarContext}, 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 = CalendarContext::new(config); - let resp = ctx.split_calendar("AAPL.US").await?; + let resp = ctx.finance_calendar(CalendarCategory::Split, "2026-06-30", "2026-06-30", Some("HK".to_string())).await?; println!("{:?}", resp); Ok(()) } @@ -137,7 +163,7 @@ int main() { if (!res) return; Config config = Config::from_oauth(*res); CalendarContext ctx = CalendarContext::create(config); - ctx.split_calendar("AAPL.US", [](auto resp) { + ctx.finance_calendar(CalendarCategory::Split, "2026-06-30", "2026-06-30", "HK", [](auto resp) { if (resp) std::cout << "OK" << std::endl; }); }); @@ -156,9 +182,9 @@ import ( "fmt" "log" + "github.com/longbridge/openapi-go/calendar" "github.com/longbridge/openapi-go/config" "github.com/longbridge/openapi-go/oauth" - "github.com/longbridge/openapi-go/calendar" ) func main() { @@ -176,7 +202,8 @@ func main() { log.Fatal(err) } defer c.Close() - resp, err := c.SplitCalendar(context.Background(), "AAPL.US") + market := "HK" + resp, err := c.FinanceCalendar(context.Background(), calendar.CalendarCategorySplit, "2026-06-30", "2026-06-30", &market) if err != nil { log.Fatal(err) } @@ -189,7 +216,6 @@ func main() { ## Response - ### Response Example ```json @@ -197,20 +223,20 @@ func main() { "code": 0, "message": "success", "data": { - "date": "2026-04-30", + "date": "2026-06-30", "list": [ { - "date": "2026-04-30", - "count": 2228, + "date": "2026-06-30", + "count": 1, "infos": [ { "id": "12345", - "symbol": "AAPL.US", - "market": "US", - "counter_name": "Apple Inc.", + "symbol": "0700.HK", + "market": "HK", + "counter_name": "Tencent Holdings", "event_type": "", "activity_type": "", - "date": "2026-05-14", + "date": "2026-06-30", "datetime": "", "content": "", "star": 0, @@ -230,10 +256,10 @@ func main() { ### Response Status -| Status | Description | Schema | -| ------ | ----------- | ------ | -| 200 | 成功 | [CalendarEventsResponse](#CalendarEventsResponse) | -| 400 | 請求錯誤 | None | +| Status | Description | Schema | +| ------ | ----------- | ------------------------------------------------- | +| 200 | 成功 | [CalendarEventsResponse](#CalendarEventsResponse) | +| 400 | 請求錯誤 | None | ## Schemas @@ -241,40 +267,40 @@ func main() { -| Name | Type | Required | Description | -| ---- | ---- | -------- | ----------- | -| date | string | 否 | 響應日期 | -| list | object[] | 是 | 日曆日期分組列表,見 [CalendarDateGroup](#CalendarDateGroup) | +| Name | Type | Required | Description | +| ---- | -------- | -------- | ------------------------------------------------------------ | +| date | string | 否 | 響應日期 | +| list | object[] | 是 | 日曆日期分組列表,見 [CalendarDateGroup](#CalendarDateGroup) | ### CalendarDateGroup -| Name | Type | Required | Description | -| ---- | ---- | -------- | ----------- | -| date | string | 是 | 日期 | -| count | integer | 否 | 該日期的事件數量 | -| infos | object[] | 是 | 日曆事件列表,見 [CalendarEventInfo](#CalendarEventInfo) | +| Name | Type | Required | Description | +| ----- | -------- | -------- | -------------------------------------------------------- | +| date | string | 是 | 日期 | +| count | integer | 否 | 該日期的事件數量 | +| infos | object[] | 是 | 日曆事件列表,見 [CalendarEventInfo](#CalendarEventInfo) | ### CalendarEventInfo -| Name | Type | Required | Description | -| ---- | ---- | -------- | ----------- | -| id | string | 否 | 事件 ID | -| symbol | string | 否 | 證券代碼 | -| market | string | 否 | 市場 | -| counter_name | string | 否 | 證券名稱 | -| event_type | string | 否 | 事件類型 | -| activity_type | string | 否 | 活動類型 | -| date | string | 否 | 事件日期 | -| datetime | string | 否 | 事件時間 | -| date_type | string | 否 | 日期類型 | -| content | string | 否 | 事件內容描述 | -| currency | string | 否 | 貨幣 | -| star | integer | 否 | 重要性(1-3 星) | -| icon | string | 否 | 圖標鏈接 | -| chart_uid | string | 否 | 圖表標識符 | -| financial_market_time | string | 否 | 金融市場時間 | -| data_kv | object[] | 否 | 鍵值數據對 | +| Name | Type | Required | Description | +| --------------------- | -------- | -------- | ---------------- | +| id | string | 否 | 事件 ID | +| symbol | string | 否 | 證券代碼 | +| market | string | 否 | 市場 | +| counter_name | string | 否 | 證券名稱 | +| event_type | string | 否 | 事件類型 | +| activity_type | string | 否 | 活動類型 | +| date | string | 否 | 事件日期 | +| datetime | string | 否 | 事件時間 | +| date_type | string | 否 | 日期類型 | +| content | string | 否 | 事件內容描述 | +| currency | string | 否 | 貨幣 | +| star | integer | 否 | 重要性(1-3 星) | +| icon | string | 否 | 圖標鏈接 | +| chart_uid | string | 否 | 圖表標識符 | +| financial_market_time | string | 否 | 金融市場時間 | +| data_kv | object[] | 否 | 鍵值數據對 | From 7d9590950fedad2c7175648ec8be99640408a137 Mon Sep 17 00:00:00 2001 From: Tian Deng Date: Tue, 30 Jun 2026 16:37:11 +0800 Subject: [PATCH 2/2] fix(docs): update longbridge cli finance calendar exmpale --- docs/en/docs/market/calendar/dividend_calendar.md | 2 +- docs/zh-CN/docs/market/calendar/dividend_calendar.md | 2 +- docs/zh-HK/docs/market/calendar/dividend_calendar.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/en/docs/market/calendar/dividend_calendar.md b/docs/en/docs/market/calendar/dividend_calendar.md index c383baae..e864a33e 100644 --- a/docs/en/docs/market/calendar/dividend_calendar.md +++ b/docs/en/docs/market/calendar/dividend_calendar.md @@ -14,7 +14,7 @@ Get upcoming and past dividend events including ex-date, pay date, and dividend longbridge finance-calendar dividend -longbridge finance-calendar dividend --filter positions +longbridge finance-calendar dividend --market US diff --git a/docs/zh-CN/docs/market/calendar/dividend_calendar.md b/docs/zh-CN/docs/market/calendar/dividend_calendar.md index 92b6bbe3..a3549909 100644 --- a/docs/zh-CN/docs/market/calendar/dividend_calendar.md +++ b/docs/zh-CN/docs/market/calendar/dividend_calendar.md @@ -14,7 +14,7 @@ headingLevel: 2 longbridge finance-calendar dividend -longbridge finance-calendar dividend --filter positions +longbridge finance-calendar dividend --market US diff --git a/docs/zh-HK/docs/market/calendar/dividend_calendar.md b/docs/zh-HK/docs/market/calendar/dividend_calendar.md index 6ba10145..3b146388 100644 --- a/docs/zh-HK/docs/market/calendar/dividend_calendar.md +++ b/docs/zh-HK/docs/market/calendar/dividend_calendar.md @@ -14,7 +14,7 @@ headingLevel: 2 longbridge finance-calendar dividend -longbridge finance-calendar dividend --filter positions +longbridge finance-calendar dividend --market US