From d23fdfd903abe073018417841e70d7bb94f24218 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=A2=81=E7=AB=A0=E6=B4=AA?= Date: Wed, 23 Sep 2026 09:57:24 +0800 Subject: [PATCH 1/2] docs(market): document finance_calendar pagination and fix examples Add the count/offset/next pagination parameters to the calendar reference pages (split/dividend/earnings/ipo/macro/meeting/merge across en, zh-CN, zh-HK), matching the SDK change in longbridge/openapi#597. Also fix the request examples on the split/dividend/earnings/ipo/macro pages, which called non-existent per-category methods such as `split_calendar("AAPL.US")`; every language tab now calls `finance_calendar(CalendarCategory.X, start, end)`, consistent with the already-correct meeting/merge pages. Related: longbridge/developers#1265 --- .../market/calendar/dividend_calendar.mdx | 25 +++++++++++-------- .../market/calendar/earnings_calendar.mdx | 25 +++++++++++-------- docs/en/docs/market/calendar/ipo_calendar.mdx | 25 +++++++++++-------- .../docs/market/calendar/macro_calendar.mdx | 25 +++++++++++-------- .../docs/market/calendar/meeting_calendar.mdx | 5 +++- .../docs/market/calendar/merge_calendar.mdx | 5 +++- .../docs/market/calendar/split_calendar.mdx | 25 +++++++++++-------- .../market/calendar/dividend_calendar.mdx | 25 +++++++++++-------- .../market/calendar/earnings_calendar.mdx | 25 +++++++++++-------- .../docs/market/calendar/ipo_calendar.mdx | 25 +++++++++++-------- .../docs/market/calendar/macro_calendar.mdx | 25 +++++++++++-------- .../docs/market/calendar/split_calendar.mdx | 25 +++++++++++-------- .../market/calendar/dividend_calendar.mdx | 25 +++++++++++-------- .../market/calendar/earnings_calendar.mdx | 25 +++++++++++-------- .../docs/market/calendar/ipo_calendar.mdx | 25 +++++++++++-------- .../docs/market/calendar/macro_calendar.mdx | 25 +++++++++++-------- .../docs/market/calendar/split_calendar.mdx | 25 +++++++++++-------- 17 files changed, 218 insertions(+), 167 deletions(-) diff --git a/docs/en/docs/market/calendar/dividend_calendar.mdx b/docs/en/docs/market/calendar/dividend_calendar.mdx index e82654ec0..f418d914e 100644 --- a/docs/en/docs/market/calendar/dividend_calendar.mdx +++ b/docs/en/docs/market/calendar/dividend_calendar.mdx @@ -29,6 +29,9 @@ longbridge finance-calendar dividend --filter positions | 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. | +| count | integer | NO | Max events per page; server default when omitted | +| offset | integer | NO | Number of events to skip from the start of the window | +| next | CalendarPageDirection | NO | Page direction from the `next_date` cursor: `Later` or `Earlier` | ## Request Example @@ -36,13 +39,13 @@ longbridge finance-calendar dividend --filter positions ```python -from longbridge.openapi import CalendarContext, Config, OAuthBuilder +from longbridge.openapi import CalendarContext, CalendarCategory, 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") +resp = ctx.finance_calendar(CalendarCategory.Dividend, "2024-01-01", "2024-03-31") print(resp) ``` @@ -51,14 +54,14 @@ 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)) config = Config.from_oauth(oauth) ctx = AsyncCalendarContext.create(config) - resp = await ctx.dividend_calendar("AAPL.US") + resp = await ctx.finance_calendar(CalendarCategory.Dividend, "2024-01-01", "2024-03-31") print(resp) if __name__ == "__main__": @@ -69,7 +72,7 @@ if __name__ == "__main__": ```javascript -const { Config, CalendarContext, OAuth } = require('longbridge') +const { Config, CalendarContext, CalendarCategory, OAuth } = require('longbridge') async function main() { const oauth = await OAuth.build('your-client-id', (_, url) => { @@ -77,7 +80,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, '2024-01-01', '2024-03-31') console.log(resp) } main().catch(console.error) @@ -95,7 +98,7 @@ 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(); + var resp = ctx.financeCalendar(CalendarCategory.Dividend, "2024-01-01", "2024-03-31", null).get(); System.out.println(resp); } } @@ -107,14 +110,14 @@ class Main { ```rust use std::sync::Arc; -use longbridge::{oauth::OAuthBuilder, calendar::CalendarContext, Config}; +use longbridge::{oauth::OAuthBuilder, calendar::{CalendarContext, CalendarCategory}, 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, "2024-01-01", "2024-03-31", None, None, None, None).await?; println!("{:?}", resp); Ok(()) } @@ -137,7 +140,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, "2024-01-01", "2024-03-31", "", std::nullopt, std::nullopt, std::nullopt, [](auto resp) { if (resp) std::cout << "OK" << std::endl; }); }); @@ -176,7 +179,7 @@ func main() { log.Fatal(err) } defer c.Close() - resp, err := c.DividendCalendar(context.Background(), "AAPL.US") + resp, err := c.FinanceCalendar(context.Background(), "Dividend", "2024-01-01", "2024-03-31", nil) if err != nil { log.Fatal(err) } diff --git a/docs/en/docs/market/calendar/earnings_calendar.mdx b/docs/en/docs/market/calendar/earnings_calendar.mdx index 4e2cee972..1f8f9c4f6 100644 --- a/docs/en/docs/market/calendar/earnings_calendar.mdx +++ b/docs/en/docs/market/calendar/earnings_calendar.mdx @@ -29,6 +29,9 @@ longbridge finance-calendar report --market US | 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. | +| count | integer | NO | Max events per page; server default when omitted | +| offset | integer | NO | Number of events to skip from the start of the window | +| next | CalendarPageDirection | NO | Page direction from the `next_date` cursor: `Later` or `Earlier` | ## Request Example @@ -36,13 +39,13 @@ longbridge finance-calendar report --market US ```python -from longbridge.openapi import CalendarContext, Config, OAuthBuilder +from longbridge.openapi import CalendarContext, CalendarCategory, 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") +resp = ctx.finance_calendar(CalendarCategory.Report, "2024-01-01", "2024-03-31") print(resp) ``` @@ -51,14 +54,14 @@ 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)) config = Config.from_oauth(oauth) ctx = AsyncCalendarContext.create(config) - resp = await ctx.earnings_calendar("AAPL.US") + resp = await ctx.finance_calendar(CalendarCategory.Report, "2024-01-01", "2024-03-31") print(resp) if __name__ == "__main__": @@ -69,7 +72,7 @@ if __name__ == "__main__": ```javascript -const { Config, CalendarContext, OAuth } = require('longbridge') +const { Config, CalendarContext, CalendarCategory, OAuth } = require('longbridge') async function main() { const oauth = await OAuth.build('your-client-id', (_, url) => { @@ -77,7 +80,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, '2024-01-01', '2024-03-31') console.log(resp) } main().catch(console.error) @@ -95,7 +98,7 @@ 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(); + var resp = ctx.financeCalendar(CalendarCategory.Report, "2024-01-01", "2024-03-31", null).get(); System.out.println(resp); } } @@ -107,14 +110,14 @@ class Main { ```rust use std::sync::Arc; -use longbridge::{oauth::OAuthBuilder, calendar::CalendarContext, Config}; +use longbridge::{oauth::OAuthBuilder, calendar::{CalendarContext, CalendarCategory}, 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, "2024-01-01", "2024-03-31", None, None, None, None).await?; println!("{:?}", resp); Ok(()) } @@ -137,7 +140,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, "2024-01-01", "2024-03-31", "", std::nullopt, std::nullopt, std::nullopt, [](auto resp) { if (resp) std::cout << "OK" << std::endl; }); }); @@ -176,7 +179,7 @@ func main() { log.Fatal(err) } defer c.Close() - resp, err := c.EarningsCalendar(context.Background(), "AAPL.US") + resp, err := c.FinanceCalendar(context.Background(), "Report", "2024-01-01", "2024-03-31", nil) if err != nil { log.Fatal(err) } diff --git a/docs/en/docs/market/calendar/ipo_calendar.mdx b/docs/en/docs/market/calendar/ipo_calendar.mdx index 28d1a0369..24dfee046 100644 --- a/docs/en/docs/market/calendar/ipo_calendar.mdx +++ b/docs/en/docs/market/calendar/ipo_calendar.mdx @@ -29,6 +29,9 @@ longbridge finance-calendar ipo --market US | 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. | +| count | integer | NO | Max events per page; server default when omitted | +| offset | integer | NO | Number of events to skip from the start of the window | +| next | CalendarPageDirection | NO | Page direction from the `next_date` cursor: `Later` or `Earlier` | ## Request Example @@ -36,13 +39,13 @@ longbridge finance-calendar ipo --market US ```python -from longbridge.openapi import CalendarContext, Config, OAuthBuilder +from longbridge.openapi import CalendarContext, CalendarCategory, 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") +resp = ctx.finance_calendar(CalendarCategory.Ipo, "2024-01-01", "2024-03-31") print(resp) ``` @@ -51,14 +54,14 @@ 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)) config = Config.from_oauth(oauth) ctx = AsyncCalendarContext.create(config) - resp = await ctx.ipo_calendar("AAPL.US") + resp = await ctx.finance_calendar(CalendarCategory.Ipo, "2024-01-01", "2024-03-31") print(resp) if __name__ == "__main__": @@ -69,7 +72,7 @@ if __name__ == "__main__": ```javascript -const { Config, CalendarContext, OAuth } = require('longbridge') +const { Config, CalendarContext, CalendarCategory, OAuth } = require('longbridge') async function main() { const oauth = await OAuth.build('your-client-id', (_, url) => { @@ -77,7 +80,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, '2024-01-01', '2024-03-31') console.log(resp) } main().catch(console.error) @@ -95,7 +98,7 @@ 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(); + var resp = ctx.financeCalendar(CalendarCategory.Ipo, "2024-01-01", "2024-03-31", null).get(); System.out.println(resp); } } @@ -107,14 +110,14 @@ class Main { ```rust use std::sync::Arc; -use longbridge::{oauth::OAuthBuilder, calendar::CalendarContext, Config}; +use longbridge::{oauth::OAuthBuilder, calendar::{CalendarContext, CalendarCategory}, 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, "2024-01-01", "2024-03-31", None, None, None, None).await?; println!("{:?}", resp); Ok(()) } @@ -137,7 +140,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, "2024-01-01", "2024-03-31", "", std::nullopt, std::nullopt, std::nullopt, [](auto resp) { if (resp) std::cout << "OK" << std::endl; }); }); @@ -176,7 +179,7 @@ func main() { log.Fatal(err) } defer c.Close() - resp, err := c.IpoCalendar(context.Background(), "AAPL.US") + resp, err := c.FinanceCalendar(context.Background(), "Ipo", "2024-01-01", "2024-03-31", nil) if err != nil { log.Fatal(err) } diff --git a/docs/en/docs/market/calendar/macro_calendar.mdx b/docs/en/docs/market/calendar/macro_calendar.mdx index 34270434e..22e01869e 100644 --- a/docs/en/docs/market/calendar/macro_calendar.mdx +++ b/docs/en/docs/market/calendar/macro_calendar.mdx @@ -29,6 +29,9 @@ longbridge finance-calendar macrodata --market US | 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. | +| count | integer | NO | Max events per page; server default when omitted | +| offset | integer | NO | Number of events to skip from the start of the window | +| next | CalendarPageDirection | NO | Page direction from the `next_date` cursor: `Later` or `Earlier` | ## Request Example @@ -36,13 +39,13 @@ longbridge finance-calendar macrodata --market US ```python -from longbridge.openapi import CalendarContext, Config, OAuthBuilder +from longbridge.openapi import CalendarContext, CalendarCategory, 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") +resp = ctx.finance_calendar(CalendarCategory.MacroData, "2024-01-01", "2024-03-31") print(resp) ``` @@ -51,14 +54,14 @@ 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)) config = Config.from_oauth(oauth) ctx = AsyncCalendarContext.create(config) - resp = await ctx.macro_calendar("AAPL.US") + resp = await ctx.finance_calendar(CalendarCategory.MacroData, "2024-01-01", "2024-03-31") print(resp) if __name__ == "__main__": @@ -69,7 +72,7 @@ if __name__ == "__main__": ```javascript -const { Config, CalendarContext, OAuth } = require('longbridge') +const { Config, CalendarContext, CalendarCategory, OAuth } = require('longbridge') async function main() { const oauth = await OAuth.build('your-client-id', (_, url) => { @@ -77,7 +80,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, '2024-01-01', '2024-03-31') console.log(resp) } main().catch(console.error) @@ -95,7 +98,7 @@ 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(); + var resp = ctx.financeCalendar(CalendarCategory.MacroData, "2024-01-01", "2024-03-31", null).get(); System.out.println(resp); } } @@ -107,14 +110,14 @@ class Main { ```rust use std::sync::Arc; -use longbridge::{oauth::OAuthBuilder, calendar::CalendarContext, Config}; +use longbridge::{oauth::OAuthBuilder, calendar::{CalendarContext, CalendarCategory}, 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, "2024-01-01", "2024-03-31", None, None, None, None).await?; println!("{:?}", resp); Ok(()) } @@ -137,7 +140,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, "2024-01-01", "2024-03-31", "", std::nullopt, std::nullopt, std::nullopt, [](auto resp) { if (resp) std::cout << "OK" << std::endl; }); }); @@ -176,7 +179,7 @@ func main() { log.Fatal(err) } defer c.Close() - resp, err := c.MacroCalendar(context.Background(), "AAPL.US") + resp, err := c.FinanceCalendar(context.Background(), "MacroData", "2024-01-01", "2024-03-31", nil) if err != nil { log.Fatal(err) } diff --git a/docs/en/docs/market/calendar/meeting_calendar.mdx b/docs/en/docs/market/calendar/meeting_calendar.mdx index 9fa2319cc..29df2f762 100644 --- a/docs/en/docs/market/calendar/meeting_calendar.mdx +++ b/docs/en/docs/market/calendar/meeting_calendar.mdx @@ -24,6 +24,9 @@ Browse upcoming shareholder meetings and company events. | 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. | +| count | integer | NO | Max events per page; server default when omitted | +| offset | integer | NO | Number of events to skip from the start of the window | +| next | CalendarPageDirection | NO | Page direction from the `next_date` cursor: `Later` or `Earlier` | ## Request Example @@ -106,7 +109,7 @@ 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, "2024-01-01", "2024-03-31", None, None, None, None).await?; println!("{:?}", resp); Ok(()) } diff --git a/docs/en/docs/market/calendar/merge_calendar.mdx b/docs/en/docs/market/calendar/merge_calendar.mdx index 2d4a7b734..873236f7b 100644 --- a/docs/en/docs/market/calendar/merge_calendar.mdx +++ b/docs/en/docs/market/calendar/merge_calendar.mdx @@ -24,6 +24,9 @@ Browse upcoming M&A and merger events. | 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. | +| count | integer | NO | Max events per page; server default when omitted | +| offset | integer | NO | Number of events to skip from the start of the window | +| next | CalendarPageDirection | NO | Page direction from the `next_date` cursor: `Later` or `Earlier` | ## Request Example @@ -106,7 +109,7 @@ 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, "2024-01-01", "2024-03-31", None, None, None, None).await?; println!("{:?}", resp); Ok(()) } diff --git a/docs/en/docs/market/calendar/split_calendar.mdx b/docs/en/docs/market/calendar/split_calendar.mdx index 75772f9f8..f9e749e0a 100644 --- a/docs/en/docs/market/calendar/split_calendar.mdx +++ b/docs/en/docs/market/calendar/split_calendar.mdx @@ -29,6 +29,9 @@ longbridge finance-calendar split --market HK | 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. | +| count | integer | NO | Max events per page; server default when omitted | +| offset | integer | NO | Number of events to skip from the start of the window | +| next | CalendarPageDirection | NO | Page direction from the `next_date` cursor: `Later` or `Earlier` | ## Request Example @@ -36,13 +39,13 @@ longbridge finance-calendar split --market HK ```python -from longbridge.openapi import CalendarContext, Config, OAuthBuilder +from longbridge.openapi import CalendarContext, CalendarCategory, 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") +resp = ctx.finance_calendar(CalendarCategory.Split, "2024-01-01", "2024-03-31") print(resp) ``` @@ -51,14 +54,14 @@ 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)) config = Config.from_oauth(oauth) ctx = AsyncCalendarContext.create(config) - resp = await ctx.split_calendar("AAPL.US") + resp = await ctx.finance_calendar(CalendarCategory.Split, "2024-01-01", "2024-03-31") print(resp) if __name__ == "__main__": @@ -69,7 +72,7 @@ if __name__ == "__main__": ```javascript -const { Config, CalendarContext, OAuth } = require('longbridge') +const { Config, CalendarContext, CalendarCategory, OAuth } = require('longbridge') async function main() { const oauth = await OAuth.build('your-client-id', (_, url) => { @@ -77,7 +80,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, '2024-01-01', '2024-03-31') console.log(resp) } main().catch(console.error) @@ -95,7 +98,7 @@ 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(); + var resp = ctx.financeCalendar(CalendarCategory.Split, "2024-01-01", "2024-03-31", null).get(); System.out.println(resp); } } @@ -107,14 +110,14 @@ class Main { ```rust use std::sync::Arc; -use longbridge::{oauth::OAuthBuilder, calendar::CalendarContext, Config}; +use longbridge::{oauth::OAuthBuilder, calendar::{CalendarContext, CalendarCategory}, 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, "2024-01-01", "2024-03-31", None, None, None, None).await?; println!("{:?}", resp); Ok(()) } @@ -137,7 +140,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, "2024-01-01", "2024-03-31", "", std::nullopt, std::nullopt, std::nullopt, [](auto resp) { if (resp) std::cout << "OK" << std::endl; }); }); @@ -176,7 +179,7 @@ func main() { log.Fatal(err) } defer c.Close() - resp, err := c.SplitCalendar(context.Background(), "AAPL.US") + resp, err := c.FinanceCalendar(context.Background(), "Split", "2024-01-01", "2024-03-31", nil) if err != nil { log.Fatal(err) } diff --git a/docs/zh-CN/docs/market/calendar/dividend_calendar.mdx b/docs/zh-CN/docs/market/calendar/dividend_calendar.mdx index e06d699b9..0237349fc 100644 --- a/docs/zh-CN/docs/market/calendar/dividend_calendar.mdx +++ b/docs/zh-CN/docs/market/calendar/dividend_calendar.mdx @@ -29,6 +29,9 @@ longbridge finance-calendar dividend --filter positions | start | string | YES | 开始日期,格式 YYYY-MM-DD | | end | string | YES | 结束日期,格式 YYYY-MM-DD | | market | string | NO | 市场筛选:US、HK、SH、SZ,不填则返回所有市场 | +| count | integer | NO | 每页最大事件数,省略时使用服务端默认值 | +| offset | integer | NO | 从窗口起始跳过的事件数 | +| next | CalendarPageDirection | NO | 从 `next_date` 游标翻页的方向:`Later` 或 `Earlier` | ## Request Example @@ -36,13 +39,13 @@ longbridge finance-calendar dividend --filter positions ```python -from longbridge.openapi import CalendarContext, Config, OAuthBuilder +from longbridge.openapi import CalendarContext, CalendarCategory, 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") +resp = ctx.finance_calendar(CalendarCategory.Dividend, "2024-01-01", "2024-03-31") print(resp) ``` @@ -51,14 +54,14 @@ 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)) config = Config.from_oauth(oauth) ctx = AsyncCalendarContext.create(config) - resp = await ctx.dividend_calendar("AAPL.US") + resp = await ctx.finance_calendar(CalendarCategory.Dividend, "2024-01-01", "2024-03-31") print(resp) if __name__ == "__main__": @@ -69,7 +72,7 @@ if __name__ == "__main__": ```javascript -const { Config, CalendarContext, OAuth } = require('longbridge') +const { Config, CalendarContext, CalendarCategory, OAuth } = require('longbridge') async function main() { const oauth = await OAuth.build('your-client-id', (_, url) => { @@ -77,7 +80,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, '2024-01-01', '2024-03-31') console.log(resp) } main().catch(console.error) @@ -95,7 +98,7 @@ 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(); + var resp = ctx.financeCalendar(CalendarCategory.Dividend, "2024-01-01", "2024-03-31", null).get(); System.out.println(resp); } } @@ -107,14 +110,14 @@ class Main { ```rust use std::sync::Arc; -use longbridge::{oauth::OAuthBuilder, calendar::CalendarContext, Config}; +use longbridge::{oauth::OAuthBuilder, calendar::{CalendarContext, CalendarCategory}, 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, "2024-01-01", "2024-03-31", None, None, None, None).await?; println!("{:?}", resp); Ok(()) } @@ -137,7 +140,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, "2024-01-01", "2024-03-31", "", std::nullopt, std::nullopt, std::nullopt, [](auto resp) { if (resp) std::cout << "OK" << std::endl; }); }); @@ -176,7 +179,7 @@ func main() { log.Fatal(err) } defer c.Close() - resp, err := c.DividendCalendar(context.Background(), "AAPL.US") + resp, err := c.FinanceCalendar(context.Background(), "Dividend", "2024-01-01", "2024-03-31", nil) if err != nil { log.Fatal(err) } diff --git a/docs/zh-CN/docs/market/calendar/earnings_calendar.mdx b/docs/zh-CN/docs/market/calendar/earnings_calendar.mdx index 91fa02918..f6ba21cf2 100644 --- a/docs/zh-CN/docs/market/calendar/earnings_calendar.mdx +++ b/docs/zh-CN/docs/market/calendar/earnings_calendar.mdx @@ -29,6 +29,9 @@ longbridge finance-calendar report --market US | start | string | YES | 开始日期,格式 YYYY-MM-DD | | end | string | YES | 结束日期,格式 YYYY-MM-DD | | market | string | NO | 市场筛选:US、HK、SH、SZ,不填则返回所有市场 | +| count | integer | NO | 每页最大事件数,省略时使用服务端默认值 | +| offset | integer | NO | 从窗口起始跳过的事件数 | +| next | CalendarPageDirection | NO | 从 `next_date` 游标翻页的方向:`Later` 或 `Earlier` | ## Request Example @@ -36,13 +39,13 @@ longbridge finance-calendar report --market US ```python -from longbridge.openapi import CalendarContext, Config, OAuthBuilder +from longbridge.openapi import CalendarContext, CalendarCategory, 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") +resp = ctx.finance_calendar(CalendarCategory.Report, "2024-01-01", "2024-03-31") print(resp) ``` @@ -51,14 +54,14 @@ 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)) config = Config.from_oauth(oauth) ctx = AsyncCalendarContext.create(config) - resp = await ctx.earnings_calendar("AAPL.US") + resp = await ctx.finance_calendar(CalendarCategory.Report, "2024-01-01", "2024-03-31") print(resp) if __name__ == "__main__": @@ -69,7 +72,7 @@ if __name__ == "__main__": ```javascript -const { Config, CalendarContext, OAuth } = require('longbridge') +const { Config, CalendarContext, CalendarCategory, OAuth } = require('longbridge') async function main() { const oauth = await OAuth.build('your-client-id', (_, url) => { @@ -77,7 +80,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, '2024-01-01', '2024-03-31') console.log(resp) } main().catch(console.error) @@ -95,7 +98,7 @@ 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(); + var resp = ctx.financeCalendar(CalendarCategory.Report, "2024-01-01", "2024-03-31", null).get(); System.out.println(resp); } } @@ -107,14 +110,14 @@ class Main { ```rust use std::sync::Arc; -use longbridge::{oauth::OAuthBuilder, calendar::CalendarContext, Config}; +use longbridge::{oauth::OAuthBuilder, calendar::{CalendarContext, CalendarCategory}, 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, "2024-01-01", "2024-03-31", None, None, None, None).await?; println!("{:?}", resp); Ok(()) } @@ -137,7 +140,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, "2024-01-01", "2024-03-31", "", std::nullopt, std::nullopt, std::nullopt, [](auto resp) { if (resp) std::cout << "OK" << std::endl; }); }); @@ -176,7 +179,7 @@ func main() { log.Fatal(err) } defer c.Close() - resp, err := c.EarningsCalendar(context.Background(), "AAPL.US") + resp, err := c.FinanceCalendar(context.Background(), "Report", "2024-01-01", "2024-03-31", nil) if err != nil { log.Fatal(err) } diff --git a/docs/zh-CN/docs/market/calendar/ipo_calendar.mdx b/docs/zh-CN/docs/market/calendar/ipo_calendar.mdx index 6fdcf0eb0..bfb36d799 100644 --- a/docs/zh-CN/docs/market/calendar/ipo_calendar.mdx +++ b/docs/zh-CN/docs/market/calendar/ipo_calendar.mdx @@ -29,6 +29,9 @@ longbridge finance-calendar ipo --market US | start | string | YES | 开始日期,格式 YYYY-MM-DD | | end | string | YES | 结束日期,格式 YYYY-MM-DD | | market | string | NO | 市场筛选:US、HK、SH、SZ,不填则返回所有市场 | +| count | integer | NO | 每页最大事件数,省略时使用服务端默认值 | +| offset | integer | NO | 从窗口起始跳过的事件数 | +| next | CalendarPageDirection | NO | 从 `next_date` 游标翻页的方向:`Later` 或 `Earlier` | ## Request Example @@ -36,13 +39,13 @@ longbridge finance-calendar ipo --market US ```python -from longbridge.openapi import CalendarContext, Config, OAuthBuilder +from longbridge.openapi import CalendarContext, CalendarCategory, 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") +resp = ctx.finance_calendar(CalendarCategory.Ipo, "2024-01-01", "2024-03-31") print(resp) ``` @@ -51,14 +54,14 @@ 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)) config = Config.from_oauth(oauth) ctx = AsyncCalendarContext.create(config) - resp = await ctx.ipo_calendar("AAPL.US") + resp = await ctx.finance_calendar(CalendarCategory.Ipo, "2024-01-01", "2024-03-31") print(resp) if __name__ == "__main__": @@ -69,7 +72,7 @@ if __name__ == "__main__": ```javascript -const { Config, CalendarContext, OAuth } = require('longbridge') +const { Config, CalendarContext, CalendarCategory, OAuth } = require('longbridge') async function main() { const oauth = await OAuth.build('your-client-id', (_, url) => { @@ -77,7 +80,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, '2024-01-01', '2024-03-31') console.log(resp) } main().catch(console.error) @@ -95,7 +98,7 @@ 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(); + var resp = ctx.financeCalendar(CalendarCategory.Ipo, "2024-01-01", "2024-03-31", null).get(); System.out.println(resp); } } @@ -107,14 +110,14 @@ class Main { ```rust use std::sync::Arc; -use longbridge::{oauth::OAuthBuilder, calendar::CalendarContext, Config}; +use longbridge::{oauth::OAuthBuilder, calendar::{CalendarContext, CalendarCategory}, 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, "2024-01-01", "2024-03-31", None, None, None, None).await?; println!("{:?}", resp); Ok(()) } @@ -137,7 +140,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, "2024-01-01", "2024-03-31", "", std::nullopt, std::nullopt, std::nullopt, [](auto resp) { if (resp) std::cout << "OK" << std::endl; }); }); @@ -176,7 +179,7 @@ func main() { log.Fatal(err) } defer c.Close() - resp, err := c.IpoCalendar(context.Background(), "AAPL.US") + resp, err := c.FinanceCalendar(context.Background(), "Ipo", "2024-01-01", "2024-03-31", nil) if err != nil { log.Fatal(err) } diff --git a/docs/zh-CN/docs/market/calendar/macro_calendar.mdx b/docs/zh-CN/docs/market/calendar/macro_calendar.mdx index 979a3257b..c942a6c78 100644 --- a/docs/zh-CN/docs/market/calendar/macro_calendar.mdx +++ b/docs/zh-CN/docs/market/calendar/macro_calendar.mdx @@ -29,6 +29,9 @@ longbridge finance-calendar macrodata --market US | start | string | YES | 开始日期,格式 YYYY-MM-DD | | end | string | YES | 结束日期,格式 YYYY-MM-DD | | market | string | NO | 市场筛选:US、HK、SH、SZ,不填则返回所有市场 | +| count | integer | NO | 每页最大事件数,省略时使用服务端默认值 | +| offset | integer | NO | 从窗口起始跳过的事件数 | +| next | CalendarPageDirection | NO | 从 `next_date` 游标翻页的方向:`Later` 或 `Earlier` | ## Request Example @@ -36,13 +39,13 @@ longbridge finance-calendar macrodata --market US ```python -from longbridge.openapi import CalendarContext, Config, OAuthBuilder +from longbridge.openapi import CalendarContext, CalendarCategory, 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") +resp = ctx.finance_calendar(CalendarCategory.MacroData, "2024-01-01", "2024-03-31") print(resp) ``` @@ -51,14 +54,14 @@ 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)) config = Config.from_oauth(oauth) ctx = AsyncCalendarContext.create(config) - resp = await ctx.macro_calendar("AAPL.US") + resp = await ctx.finance_calendar(CalendarCategory.MacroData, "2024-01-01", "2024-03-31") print(resp) if __name__ == "__main__": @@ -69,7 +72,7 @@ if __name__ == "__main__": ```javascript -const { Config, CalendarContext, OAuth } = require('longbridge') +const { Config, CalendarContext, CalendarCategory, OAuth } = require('longbridge') async function main() { const oauth = await OAuth.build('your-client-id', (_, url) => { @@ -77,7 +80,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, '2024-01-01', '2024-03-31') console.log(resp) } main().catch(console.error) @@ -95,7 +98,7 @@ 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(); + var resp = ctx.financeCalendar(CalendarCategory.MacroData, "2024-01-01", "2024-03-31", null).get(); System.out.println(resp); } } @@ -107,14 +110,14 @@ class Main { ```rust use std::sync::Arc; -use longbridge::{oauth::OAuthBuilder, calendar::CalendarContext, Config}; +use longbridge::{oauth::OAuthBuilder, calendar::{CalendarContext, CalendarCategory}, 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, "2024-01-01", "2024-03-31", None, None, None, None).await?; println!("{:?}", resp); Ok(()) } @@ -137,7 +140,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, "2024-01-01", "2024-03-31", "", std::nullopt, std::nullopt, std::nullopt, [](auto resp) { if (resp) std::cout << "OK" << std::endl; }); }); @@ -176,7 +179,7 @@ func main() { log.Fatal(err) } defer c.Close() - resp, err := c.MacroCalendar(context.Background(), "AAPL.US") + resp, err := c.FinanceCalendar(context.Background(), "MacroData", "2024-01-01", "2024-03-31", nil) if err != nil { log.Fatal(err) } diff --git a/docs/zh-CN/docs/market/calendar/split_calendar.mdx b/docs/zh-CN/docs/market/calendar/split_calendar.mdx index 9917c85bb..88406c8c8 100644 --- a/docs/zh-CN/docs/market/calendar/split_calendar.mdx +++ b/docs/zh-CN/docs/market/calendar/split_calendar.mdx @@ -29,6 +29,9 @@ longbridge finance-calendar split --market HK | start | string | YES | 开始日期,格式 YYYY-MM-DD | | end | string | YES | 结束日期,格式 YYYY-MM-DD | | market | string | NO | 市场筛选:US、HK、SH、SZ,不填则返回所有市场 | +| count | integer | NO | 每页最大事件数,省略时使用服务端默认值 | +| offset | integer | NO | 从窗口起始跳过的事件数 | +| next | CalendarPageDirection | NO | 从 `next_date` 游标翻页的方向:`Later` 或 `Earlier` | ## Request Example @@ -36,13 +39,13 @@ longbridge finance-calendar split --market HK ```python -from longbridge.openapi import CalendarContext, Config, OAuthBuilder +from longbridge.openapi import CalendarContext, CalendarCategory, 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") +resp = ctx.finance_calendar(CalendarCategory.Split, "2024-01-01", "2024-03-31") print(resp) ``` @@ -51,14 +54,14 @@ 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)) config = Config.from_oauth(oauth) ctx = AsyncCalendarContext.create(config) - resp = await ctx.split_calendar("AAPL.US") + resp = await ctx.finance_calendar(CalendarCategory.Split, "2024-01-01", "2024-03-31") print(resp) if __name__ == "__main__": @@ -69,7 +72,7 @@ if __name__ == "__main__": ```javascript -const { Config, CalendarContext, OAuth } = require('longbridge') +const { Config, CalendarContext, CalendarCategory, OAuth } = require('longbridge') async function main() { const oauth = await OAuth.build('your-client-id', (_, url) => { @@ -77,7 +80,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, '2024-01-01', '2024-03-31') console.log(resp) } main().catch(console.error) @@ -95,7 +98,7 @@ 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(); + var resp = ctx.financeCalendar(CalendarCategory.Split, "2024-01-01", "2024-03-31", null).get(); System.out.println(resp); } } @@ -107,14 +110,14 @@ class Main { ```rust use std::sync::Arc; -use longbridge::{oauth::OAuthBuilder, calendar::CalendarContext, Config}; +use longbridge::{oauth::OAuthBuilder, calendar::{CalendarContext, CalendarCategory}, 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, "2024-01-01", "2024-03-31", None, None, None, None).await?; println!("{:?}", resp); Ok(()) } @@ -137,7 +140,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, "2024-01-01", "2024-03-31", "", std::nullopt, std::nullopt, std::nullopt, [](auto resp) { if (resp) std::cout << "OK" << std::endl; }); }); @@ -176,7 +179,7 @@ func main() { log.Fatal(err) } defer c.Close() - resp, err := c.SplitCalendar(context.Background(), "AAPL.US") + resp, err := c.FinanceCalendar(context.Background(), "Split", "2024-01-01", "2024-03-31", nil) if err != nil { log.Fatal(err) } diff --git a/docs/zh-HK/docs/market/calendar/dividend_calendar.mdx b/docs/zh-HK/docs/market/calendar/dividend_calendar.mdx index f9e6380a5..362f84e6d 100644 --- a/docs/zh-HK/docs/market/calendar/dividend_calendar.mdx +++ b/docs/zh-HK/docs/market/calendar/dividend_calendar.mdx @@ -29,6 +29,9 @@ longbridge finance-calendar dividend --filter positions | start | string | YES | 開始日期,格式 YYYY-MM-DD | | end | string | YES | 結束日期,格式 YYYY-MM-DD | | market | string | NO | 市場篩選:US、HK、SH、SZ,不填則返回所有市場 | +| count | integer | NO | 每頁最大事件數,省略時使用伺服器預設值 | +| offset | integer | NO | 從視窗起始跳過的事件數 | +| next | CalendarPageDirection | NO | 從 `next_date` 游標翻頁的方向:`Later` 或 `Earlier` | ## Request Example @@ -36,13 +39,13 @@ longbridge finance-calendar dividend --filter positions ```python -from longbridge.openapi import CalendarContext, Config, OAuthBuilder +from longbridge.openapi import CalendarContext, CalendarCategory, 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") +resp = ctx.finance_calendar(CalendarCategory.Dividend, "2024-01-01", "2024-03-31") print(resp) ``` @@ -51,14 +54,14 @@ 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)) config = Config.from_oauth(oauth) ctx = AsyncCalendarContext.create(config) - resp = await ctx.dividend_calendar("AAPL.US") + resp = await ctx.finance_calendar(CalendarCategory.Dividend, "2024-01-01", "2024-03-31") print(resp) if __name__ == "__main__": @@ -69,7 +72,7 @@ if __name__ == "__main__": ```javascript -const { Config, CalendarContext, OAuth } = require('longbridge') +const { Config, CalendarContext, CalendarCategory, OAuth } = require('longbridge') async function main() { const oauth = await OAuth.build('your-client-id', (_, url) => { @@ -77,7 +80,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, '2024-01-01', '2024-03-31') console.log(resp) } main().catch(console.error) @@ -95,7 +98,7 @@ 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(); + var resp = ctx.financeCalendar(CalendarCategory.Dividend, "2024-01-01", "2024-03-31", null).get(); System.out.println(resp); } } @@ -107,14 +110,14 @@ class Main { ```rust use std::sync::Arc; -use longbridge::{oauth::OAuthBuilder, calendar::CalendarContext, Config}; +use longbridge::{oauth::OAuthBuilder, calendar::{CalendarContext, CalendarCategory}, 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, "2024-01-01", "2024-03-31", None, None, None, None).await?; println!("{:?}", resp); Ok(()) } @@ -137,7 +140,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, "2024-01-01", "2024-03-31", "", std::nullopt, std::nullopt, std::nullopt, [](auto resp) { if (resp) std::cout << "OK" << std::endl; }); }); @@ -176,7 +179,7 @@ func main() { log.Fatal(err) } defer c.Close() - resp, err := c.DividendCalendar(context.Background(), "AAPL.US") + resp, err := c.FinanceCalendar(context.Background(), "Dividend", "2024-01-01", "2024-03-31", nil) if err != nil { log.Fatal(err) } diff --git a/docs/zh-HK/docs/market/calendar/earnings_calendar.mdx b/docs/zh-HK/docs/market/calendar/earnings_calendar.mdx index 44d0338a5..5cebf81c7 100644 --- a/docs/zh-HK/docs/market/calendar/earnings_calendar.mdx +++ b/docs/zh-HK/docs/market/calendar/earnings_calendar.mdx @@ -29,6 +29,9 @@ longbridge finance-calendar report --market US | start | string | YES | 開始日期,格式 YYYY-MM-DD | | end | string | YES | 結束日期,格式 YYYY-MM-DD | | market | string | NO | 市場篩選:US、HK、SH、SZ,不填則返回所有市場 | +| count | integer | NO | 每頁最大事件數,省略時使用伺服器預設值 | +| offset | integer | NO | 從視窗起始跳過的事件數 | +| next | CalendarPageDirection | NO | 從 `next_date` 游標翻頁的方向:`Later` 或 `Earlier` | ## Request Example @@ -36,13 +39,13 @@ longbridge finance-calendar report --market US ```python -from longbridge.openapi import CalendarContext, Config, OAuthBuilder +from longbridge.openapi import CalendarContext, CalendarCategory, 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") +resp = ctx.finance_calendar(CalendarCategory.Report, "2024-01-01", "2024-03-31") print(resp) ``` @@ -51,14 +54,14 @@ 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)) config = Config.from_oauth(oauth) ctx = AsyncCalendarContext.create(config) - resp = await ctx.earnings_calendar("AAPL.US") + resp = await ctx.finance_calendar(CalendarCategory.Report, "2024-01-01", "2024-03-31") print(resp) if __name__ == "__main__": @@ -69,7 +72,7 @@ if __name__ == "__main__": ```javascript -const { Config, CalendarContext, OAuth } = require('longbridge') +const { Config, CalendarContext, CalendarCategory, OAuth } = require('longbridge') async function main() { const oauth = await OAuth.build('your-client-id', (_, url) => { @@ -77,7 +80,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, '2024-01-01', '2024-03-31') console.log(resp) } main().catch(console.error) @@ -95,7 +98,7 @@ 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(); + var resp = ctx.financeCalendar(CalendarCategory.Report, "2024-01-01", "2024-03-31", null).get(); System.out.println(resp); } } @@ -107,14 +110,14 @@ class Main { ```rust use std::sync::Arc; -use longbridge::{oauth::OAuthBuilder, calendar::CalendarContext, Config}; +use longbridge::{oauth::OAuthBuilder, calendar::{CalendarContext, CalendarCategory}, 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, "2024-01-01", "2024-03-31", None, None, None, None).await?; println!("{:?}", resp); Ok(()) } @@ -137,7 +140,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, "2024-01-01", "2024-03-31", "", std::nullopt, std::nullopt, std::nullopt, [](auto resp) { if (resp) std::cout << "OK" << std::endl; }); }); @@ -176,7 +179,7 @@ func main() { log.Fatal(err) } defer c.Close() - resp, err := c.EarningsCalendar(context.Background(), "AAPL.US") + resp, err := c.FinanceCalendar(context.Background(), "Report", "2024-01-01", "2024-03-31", nil) if err != nil { log.Fatal(err) } diff --git a/docs/zh-HK/docs/market/calendar/ipo_calendar.mdx b/docs/zh-HK/docs/market/calendar/ipo_calendar.mdx index bd7bb7c9e..66e816121 100644 --- a/docs/zh-HK/docs/market/calendar/ipo_calendar.mdx +++ b/docs/zh-HK/docs/market/calendar/ipo_calendar.mdx @@ -29,6 +29,9 @@ longbridge finance-calendar ipo --market US | start | string | YES | 開始日期,格式 YYYY-MM-DD | | end | string | YES | 結束日期,格式 YYYY-MM-DD | | market | string | NO | 市場篩選:US、HK、SH、SZ,不填則返回所有市場 | +| count | integer | NO | 每頁最大事件數,省略時使用伺服器預設值 | +| offset | integer | NO | 從視窗起始跳過的事件數 | +| next | CalendarPageDirection | NO | 從 `next_date` 游標翻頁的方向:`Later` 或 `Earlier` | ## Request Example @@ -36,13 +39,13 @@ longbridge finance-calendar ipo --market US ```python -from longbridge.openapi import CalendarContext, Config, OAuthBuilder +from longbridge.openapi import CalendarContext, CalendarCategory, 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") +resp = ctx.finance_calendar(CalendarCategory.Ipo, "2024-01-01", "2024-03-31") print(resp) ``` @@ -51,14 +54,14 @@ 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)) config = Config.from_oauth(oauth) ctx = AsyncCalendarContext.create(config) - resp = await ctx.ipo_calendar("AAPL.US") + resp = await ctx.finance_calendar(CalendarCategory.Ipo, "2024-01-01", "2024-03-31") print(resp) if __name__ == "__main__": @@ -69,7 +72,7 @@ if __name__ == "__main__": ```javascript -const { Config, CalendarContext, OAuth } = require('longbridge') +const { Config, CalendarContext, CalendarCategory, OAuth } = require('longbridge') async function main() { const oauth = await OAuth.build('your-client-id', (_, url) => { @@ -77,7 +80,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, '2024-01-01', '2024-03-31') console.log(resp) } main().catch(console.error) @@ -95,7 +98,7 @@ 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(); + var resp = ctx.financeCalendar(CalendarCategory.Ipo, "2024-01-01", "2024-03-31", null).get(); System.out.println(resp); } } @@ -107,14 +110,14 @@ class Main { ```rust use std::sync::Arc; -use longbridge::{oauth::OAuthBuilder, calendar::CalendarContext, Config}; +use longbridge::{oauth::OAuthBuilder, calendar::{CalendarContext, CalendarCategory}, 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, "2024-01-01", "2024-03-31", None, None, None, None).await?; println!("{:?}", resp); Ok(()) } @@ -137,7 +140,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, "2024-01-01", "2024-03-31", "", std::nullopt, std::nullopt, std::nullopt, [](auto resp) { if (resp) std::cout << "OK" << std::endl; }); }); @@ -176,7 +179,7 @@ func main() { log.Fatal(err) } defer c.Close() - resp, err := c.IpoCalendar(context.Background(), "AAPL.US") + resp, err := c.FinanceCalendar(context.Background(), "Ipo", "2024-01-01", "2024-03-31", nil) if err != nil { log.Fatal(err) } diff --git a/docs/zh-HK/docs/market/calendar/macro_calendar.mdx b/docs/zh-HK/docs/market/calendar/macro_calendar.mdx index b935e59ba..306a305cd 100644 --- a/docs/zh-HK/docs/market/calendar/macro_calendar.mdx +++ b/docs/zh-HK/docs/market/calendar/macro_calendar.mdx @@ -29,6 +29,9 @@ longbridge finance-calendar macrodata --market US | start | string | YES | 開始日期,格式 YYYY-MM-DD | | end | string | YES | 結束日期,格式 YYYY-MM-DD | | market | string | NO | 市場篩選:US、HK、SH、SZ,不填則返回所有市場 | +| count | integer | NO | 每頁最大事件數,省略時使用伺服器預設值 | +| offset | integer | NO | 從視窗起始跳過的事件數 | +| next | CalendarPageDirection | NO | 從 `next_date` 游標翻頁的方向:`Later` 或 `Earlier` | ## Request Example @@ -36,13 +39,13 @@ longbridge finance-calendar macrodata --market US ```python -from longbridge.openapi import CalendarContext, Config, OAuthBuilder +from longbridge.openapi import CalendarContext, CalendarCategory, 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") +resp = ctx.finance_calendar(CalendarCategory.MacroData, "2024-01-01", "2024-03-31") print(resp) ``` @@ -51,14 +54,14 @@ 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)) config = Config.from_oauth(oauth) ctx = AsyncCalendarContext.create(config) - resp = await ctx.macro_calendar("AAPL.US") + resp = await ctx.finance_calendar(CalendarCategory.MacroData, "2024-01-01", "2024-03-31") print(resp) if __name__ == "__main__": @@ -69,7 +72,7 @@ if __name__ == "__main__": ```javascript -const { Config, CalendarContext, OAuth } = require('longbridge') +const { Config, CalendarContext, CalendarCategory, OAuth } = require('longbridge') async function main() { const oauth = await OAuth.build('your-client-id', (_, url) => { @@ -77,7 +80,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, '2024-01-01', '2024-03-31') console.log(resp) } main().catch(console.error) @@ -95,7 +98,7 @@ 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(); + var resp = ctx.financeCalendar(CalendarCategory.MacroData, "2024-01-01", "2024-03-31", null).get(); System.out.println(resp); } } @@ -107,14 +110,14 @@ class Main { ```rust use std::sync::Arc; -use longbridge::{oauth::OAuthBuilder, calendar::CalendarContext, Config}; +use longbridge::{oauth::OAuthBuilder, calendar::{CalendarContext, CalendarCategory}, 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, "2024-01-01", "2024-03-31", None, None, None, None).await?; println!("{:?}", resp); Ok(()) } @@ -137,7 +140,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, "2024-01-01", "2024-03-31", "", std::nullopt, std::nullopt, std::nullopt, [](auto resp) { if (resp) std::cout << "OK" << std::endl; }); }); @@ -176,7 +179,7 @@ func main() { log.Fatal(err) } defer c.Close() - resp, err := c.MacroCalendar(context.Background(), "AAPL.US") + resp, err := c.FinanceCalendar(context.Background(), "MacroData", "2024-01-01", "2024-03-31", nil) if err != nil { log.Fatal(err) } diff --git a/docs/zh-HK/docs/market/calendar/split_calendar.mdx b/docs/zh-HK/docs/market/calendar/split_calendar.mdx index a162ef539..f327e4a1b 100644 --- a/docs/zh-HK/docs/market/calendar/split_calendar.mdx +++ b/docs/zh-HK/docs/market/calendar/split_calendar.mdx @@ -29,6 +29,9 @@ longbridge finance-calendar split --market HK | start | string | YES | 開始日期,格式 YYYY-MM-DD | | end | string | YES | 結束日期,格式 YYYY-MM-DD | | market | string | NO | 市場篩選:US、HK、SH、SZ,不填則返回所有市場 | +| count | integer | NO | 每頁最大事件數,省略時使用伺服器預設值 | +| offset | integer | NO | 從視窗起始跳過的事件數 | +| next | CalendarPageDirection | NO | 從 `next_date` 游標翻頁的方向:`Later` 或 `Earlier` | ## Request Example @@ -36,13 +39,13 @@ longbridge finance-calendar split --market HK ```python -from longbridge.openapi import CalendarContext, Config, OAuthBuilder +from longbridge.openapi import CalendarContext, CalendarCategory, 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") +resp = ctx.finance_calendar(CalendarCategory.Split, "2024-01-01", "2024-03-31") print(resp) ``` @@ -51,14 +54,14 @@ 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)) config = Config.from_oauth(oauth) ctx = AsyncCalendarContext.create(config) - resp = await ctx.split_calendar("AAPL.US") + resp = await ctx.finance_calendar(CalendarCategory.Split, "2024-01-01", "2024-03-31") print(resp) if __name__ == "__main__": @@ -69,7 +72,7 @@ if __name__ == "__main__": ```javascript -const { Config, CalendarContext, OAuth } = require('longbridge') +const { Config, CalendarContext, CalendarCategory, OAuth } = require('longbridge') async function main() { const oauth = await OAuth.build('your-client-id', (_, url) => { @@ -77,7 +80,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, '2024-01-01', '2024-03-31') console.log(resp) } main().catch(console.error) @@ -95,7 +98,7 @@ 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(); + var resp = ctx.financeCalendar(CalendarCategory.Split, "2024-01-01", "2024-03-31", null).get(); System.out.println(resp); } } @@ -107,14 +110,14 @@ class Main { ```rust use std::sync::Arc; -use longbridge::{oauth::OAuthBuilder, calendar::CalendarContext, Config}; +use longbridge::{oauth::OAuthBuilder, calendar::{CalendarContext, CalendarCategory}, 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, "2024-01-01", "2024-03-31", None, None, None, None).await?; println!("{:?}", resp); Ok(()) } @@ -137,7 +140,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, "2024-01-01", "2024-03-31", "", std::nullopt, std::nullopt, std::nullopt, [](auto resp) { if (resp) std::cout << "OK" << std::endl; }); }); @@ -176,7 +179,7 @@ func main() { log.Fatal(err) } defer c.Close() - resp, err := c.SplitCalendar(context.Background(), "AAPL.US") + resp, err := c.FinanceCalendar(context.Background(), "Split", "2024-01-01", "2024-03-31", nil) if err != nil { log.Fatal(err) } From 8fa5808ae6cfac99b03abcc1077e030856458239 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=A2=81=E7=AB=A0=E6=B4=AA?= Date: Wed, 23 Sep 2026 10:48:37 +0800 Subject: [PATCH 2/2] docs(market): add missing zh meeting/merge pages and fix response examples - Add zh-CN / zh-HK translations for meeting_calendar and merge_calendar (4 files), which previously existed only in English. - Fix the misleading Response Example JSON on the split/dividend/earnings/ ipo/macro pages: macro now shows a real macro-economic event instead of a stock, per-day event counts corrected to match the single sample row, and the sample dates aligned to the request window. Salvaged from the stale longbridge/developers#1125, which targeted the pre-`.mdx` docs and can no longer merge cleanly. --- .../market/calendar/dividend_calendar.mdx | 8 +- .../market/calendar/earnings_calendar.mdx | 8 +- docs/en/docs/market/calendar/ipo_calendar.mdx | 6 +- .../docs/market/calendar/macro_calendar.mdx | 14 +- .../docs/market/calendar/split_calendar.mdx | 8 +- .../market/calendar/dividend_calendar.mdx | 8 +- .../market/calendar/earnings_calendar.mdx | 8 +- .../docs/market/calendar/ipo_calendar.mdx | 6 +- .../docs/market/calendar/macro_calendar.mdx | 14 +- .../docs/market/calendar/meeting_calendar.mdx | 157 ++++++++++++++++++ .../docs/market/calendar/merge_calendar.mdx | 157 ++++++++++++++++++ .../docs/market/calendar/split_calendar.mdx | 8 +- .../market/calendar/dividend_calendar.mdx | 8 +- .../market/calendar/earnings_calendar.mdx | 8 +- .../docs/market/calendar/ipo_calendar.mdx | 6 +- .../docs/market/calendar/macro_calendar.mdx | 14 +- .../docs/market/calendar/meeting_calendar.mdx | 157 ++++++++++++++++++ .../docs/market/calendar/merge_calendar.mdx | 157 ++++++++++++++++++ .../docs/market/calendar/split_calendar.mdx | 8 +- 19 files changed, 694 insertions(+), 66 deletions(-) create mode 100644 docs/zh-CN/docs/market/calendar/meeting_calendar.mdx create mode 100644 docs/zh-CN/docs/market/calendar/merge_calendar.mdx create mode 100644 docs/zh-HK/docs/market/calendar/meeting_calendar.mdx create mode 100644 docs/zh-HK/docs/market/calendar/merge_calendar.mdx diff --git a/docs/en/docs/market/calendar/dividend_calendar.mdx b/docs/en/docs/market/calendar/dividend_calendar.mdx index f418d914e..cb02c0f94 100644 --- a/docs/en/docs/market/calendar/dividend_calendar.mdx +++ b/docs/en/docs/market/calendar/dividend_calendar.mdx @@ -200,11 +200,11 @@ func main() { "code": 0, "message": "success", "data": { - "date": "2026-04-30", + "date": "2024-01-01", "list": [ { - "date": "2026-04-30", - "count": 275, + "date": "2024-01-15", + "count": 1, "infos": [ { "id": "12345", @@ -213,7 +213,7 @@ func main() { "counter_name": "Apple Inc.", "event_type": "", "activity_type": "", - "date": "2026-05-14", + "date": "2024-01-15", "datetime": "", "content": "", "star": 0, diff --git a/docs/en/docs/market/calendar/earnings_calendar.mdx b/docs/en/docs/market/calendar/earnings_calendar.mdx index 1f8f9c4f6..e9aadcda8 100644 --- a/docs/en/docs/market/calendar/earnings_calendar.mdx +++ b/docs/en/docs/market/calendar/earnings_calendar.mdx @@ -200,11 +200,11 @@ func main() { "code": 0, "message": "success", "data": { - "date": "2026-04-30", + "date": "2024-01-01", "list": [ { - "date": "2026-04-30", - "count": 2228, + "date": "2024-01-15", + "count": 1, "infos": [ { "id": "12345", @@ -213,7 +213,7 @@ func main() { "counter_name": "Apple Inc.", "event_type": "", "activity_type": "", - "date": "2026-05-14", + "date": "2024-01-15", "datetime": "", "content": "", "star": 0, diff --git a/docs/en/docs/market/calendar/ipo_calendar.mdx b/docs/en/docs/market/calendar/ipo_calendar.mdx index 24dfee046..29201fd3a 100644 --- a/docs/en/docs/market/calendar/ipo_calendar.mdx +++ b/docs/en/docs/market/calendar/ipo_calendar.mdx @@ -200,10 +200,10 @@ func main() { "code": 0, "message": "success", "data": { - "date": "2026-04-30", + "date": "2024-01-01", "list": [ { - "date": "2026-05-05", + "date": "2024-01-15", "count": 1, "infos": [ { @@ -213,7 +213,7 @@ func main() { "counter_name": "Apple Inc.", "event_type": "", "activity_type": "", - "date": "2026-05-14", + "date": "2024-01-15", "datetime": "", "content": "", "star": 0, diff --git a/docs/en/docs/market/calendar/macro_calendar.mdx b/docs/en/docs/market/calendar/macro_calendar.mdx index 22e01869e..fb0c3b083 100644 --- a/docs/en/docs/market/calendar/macro_calendar.mdx +++ b/docs/en/docs/market/calendar/macro_calendar.mdx @@ -200,22 +200,22 @@ func main() { "code": 0, "message": "success", "data": { - "date": "2026-04-30", + "date": "2024-01-01", "list": [ { - "date": "2026-05-02", - "count": 0, + "date": "2024-01-15", + "count": 1, "infos": [ { "id": "12345", - "symbol": "AAPL.US", + "symbol": "", "market": "US", - "counter_name": "Apple Inc.", + "counter_name": "", "event_type": "", "activity_type": "", - "date": "2026-05-14", + "date": "2024-01-15", "datetime": "", - "content": "", + "content": "US Core PPI MoM", "star": 0, "currency": "", "icon": "", diff --git a/docs/en/docs/market/calendar/split_calendar.mdx b/docs/en/docs/market/calendar/split_calendar.mdx index f9e749e0a..d92fe3c7d 100644 --- a/docs/en/docs/market/calendar/split_calendar.mdx +++ b/docs/en/docs/market/calendar/split_calendar.mdx @@ -200,11 +200,11 @@ func main() { "code": 0, "message": "success", "data": { - "date": "2026-04-30", + "date": "2024-01-01", "list": [ { - "date": "2026-04-30", - "count": 2228, + "date": "2024-01-15", + "count": 1, "infos": [ { "id": "12345", @@ -213,7 +213,7 @@ func main() { "counter_name": "Apple Inc.", "event_type": "", "activity_type": "", - "date": "2026-05-14", + "date": "2024-01-15", "datetime": "", "content": "", "star": 0, diff --git a/docs/zh-CN/docs/market/calendar/dividend_calendar.mdx b/docs/zh-CN/docs/market/calendar/dividend_calendar.mdx index 0237349fc..f308cd9e6 100644 --- a/docs/zh-CN/docs/market/calendar/dividend_calendar.mdx +++ b/docs/zh-CN/docs/market/calendar/dividend_calendar.mdx @@ -200,11 +200,11 @@ func main() { "code": 0, "message": "success", "data": { - "date": "2026-04-30", + "date": "2024-01-01", "list": [ { - "date": "2026-04-30", - "count": 275, + "date": "2024-01-15", + "count": 1, "infos": [ { "id": "12345", @@ -213,7 +213,7 @@ func main() { "counter_name": "Apple Inc.", "event_type": "", "activity_type": "", - "date": "2026-05-14", + "date": "2024-01-15", "datetime": "", "content": "", "star": 0, diff --git a/docs/zh-CN/docs/market/calendar/earnings_calendar.mdx b/docs/zh-CN/docs/market/calendar/earnings_calendar.mdx index f6ba21cf2..60ad558be 100644 --- a/docs/zh-CN/docs/market/calendar/earnings_calendar.mdx +++ b/docs/zh-CN/docs/market/calendar/earnings_calendar.mdx @@ -200,11 +200,11 @@ func main() { "code": 0, "message": "success", "data": { - "date": "2026-04-30", + "date": "2024-01-01", "list": [ { - "date": "2026-04-30", - "count": 2228, + "date": "2024-01-15", + "count": 1, "infos": [ { "id": "12345", @@ -213,7 +213,7 @@ func main() { "counter_name": "Apple Inc.", "event_type": "", "activity_type": "", - "date": "2026-05-14", + "date": "2024-01-15", "datetime": "", "content": "", "star": 0, diff --git a/docs/zh-CN/docs/market/calendar/ipo_calendar.mdx b/docs/zh-CN/docs/market/calendar/ipo_calendar.mdx index bfb36d799..9c0f7e82c 100644 --- a/docs/zh-CN/docs/market/calendar/ipo_calendar.mdx +++ b/docs/zh-CN/docs/market/calendar/ipo_calendar.mdx @@ -200,10 +200,10 @@ func main() { "code": 0, "message": "success", "data": { - "date": "2026-04-30", + "date": "2024-01-01", "list": [ { - "date": "2026-05-05", + "date": "2024-01-15", "count": 1, "infos": [ { @@ -213,7 +213,7 @@ func main() { "counter_name": "Apple Inc.", "event_type": "", "activity_type": "", - "date": "2026-05-14", + "date": "2024-01-15", "datetime": "", "content": "", "star": 0, diff --git a/docs/zh-CN/docs/market/calendar/macro_calendar.mdx b/docs/zh-CN/docs/market/calendar/macro_calendar.mdx index c942a6c78..e27e500a3 100644 --- a/docs/zh-CN/docs/market/calendar/macro_calendar.mdx +++ b/docs/zh-CN/docs/market/calendar/macro_calendar.mdx @@ -200,22 +200,22 @@ func main() { "code": 0, "message": "success", "data": { - "date": "2026-04-30", + "date": "2024-01-01", "list": [ { - "date": "2026-05-02", - "count": 0, + "date": "2024-01-15", + "count": 1, "infos": [ { "id": "12345", - "symbol": "AAPL.US", + "symbol": "", "market": "US", - "counter_name": "Apple Inc.", + "counter_name": "", "event_type": "", "activity_type": "", - "date": "2026-05-14", + "date": "2024-01-15", "datetime": "", - "content": "", + "content": "US Core PPI MoM", "star": 0, "currency": "", "icon": "", diff --git a/docs/zh-CN/docs/market/calendar/meeting_calendar.mdx b/docs/zh-CN/docs/market/calendar/meeting_calendar.mdx new file mode 100644 index 000000000..306aade96 --- /dev/null +++ b/docs/zh-CN/docs/market/calendar/meeting_calendar.mdx @@ -0,0 +1,157 @@ +--- +slug: /market/calendar/meeting-calendar +title: 股东大会日历 +sidebar_position: 6 +language_tabs: false +toc_footers: [] +includes: [] +search: true +highlight_theme: '' +headingLevel: 2 +--- + +浏览即将到来的股东大会和公司事件。 + + + + +## 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,不填则返回所有市场 | +| count | integer | NO | 每页最大事件数,省略时使用服务端默认值 | +| offset | integer | NO | 从窗口起始跳过的事件数 | +| next | CalendarPageDirection | NO | 从 `next_date` 游标翻页的方向:`Later` 或 `Earlier` | + +## Request Example + + + + +```python +from longbridge.openapi import CalendarContext, CalendarCategory, 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) +``` + + + + +```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, "2024-01-01", "2024-03-31") + print(resp) + +if __name__ == "__main__": + asyncio.run(main()) +``` + + + + +```javascript +const { Config, CalendarContext, CalendarCategory, OAuth } = require('longbridge') + +async function main() { + const oauth = await OAuth.build('your-client-id', (_, url) => console.log('Open:', url)) + const config = Config.fromOAuth(oauth) + const ctx = CalendarContext.new(config) + const resp = await ctx.financeCalendar(CalendarCategory.Meeting, '2024-01-01', '2024-03-31') + 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: " + 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(); + System.out.println(resp); + } + } +} +``` + + + + +```rust +use std::sync::Arc; +use longbridge::{oauth::OAuthBuilder, calendar::{CalendarContext, CalendarCategory}, 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, None, None, None).await?; + println!("{:?}", resp); + Ok(()) +} +``` + + + + +```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:", 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) +} +``` + + + + +## Response + + +### Response Status + +| Status | Description | Schema | +| ------ | ----------- | ------ | +| 200 | 成功 | CalendarEventsResponse | +| 400 | 请求错误 | None | diff --git a/docs/zh-CN/docs/market/calendar/merge_calendar.mdx b/docs/zh-CN/docs/market/calendar/merge_calendar.mdx new file mode 100644 index 000000000..1888135b7 --- /dev/null +++ b/docs/zh-CN/docs/market/calendar/merge_calendar.mdx @@ -0,0 +1,157 @@ +--- +slug: /market/calendar/merge-calendar +title: 并购日历 +sidebar_position: 7 +language_tabs: false +toc_footers: [] +includes: [] +search: true +highlight_theme: '' +headingLevel: 2 +--- + +浏览即将到来的并购(M&A)与合并事件。 + + + + +## 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,不填则返回所有市场 | +| count | integer | NO | 每页最大事件数,省略时使用服务端默认值 | +| offset | integer | NO | 从窗口起始跳过的事件数 | +| next | CalendarPageDirection | NO | 从 `next_date` 游标翻页的方向:`Later` 或 `Earlier` | + +## Request Example + + + + +```python +from longbridge.openapi import CalendarContext, CalendarCategory, 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) +``` + + + + +```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, "2024-01-01", "2024-03-31") + print(resp) + +if __name__ == "__main__": + asyncio.run(main()) +``` + + + + +```javascript +const { Config, CalendarContext, CalendarCategory, OAuth } = require('longbridge') + +async function main() { + const oauth = await OAuth.build('your-client-id', (_, url) => console.log('Open:', url)) + const config = Config.fromOAuth(oauth) + const ctx = CalendarContext.new(config) + const resp = await ctx.financeCalendar(CalendarCategory.Merge, '2024-01-01', '2024-03-31') + 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: " + 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(); + System.out.println(resp); + } + } +} +``` + + + + +```rust +use std::sync::Arc; +use longbridge::{oauth::OAuthBuilder, calendar::{CalendarContext, CalendarCategory}, 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, None, None, None).await?; + println!("{:?}", resp); + Ok(()) +} +``` + + + + +```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:", 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) +} +``` + + + + +## Response + + +### Response Status + +| Status | Description | Schema | +| ------ | ----------- | ------ | +| 200 | 成功 | CalendarEventsResponse | +| 400 | 请求错误 | None | diff --git a/docs/zh-CN/docs/market/calendar/split_calendar.mdx b/docs/zh-CN/docs/market/calendar/split_calendar.mdx index 88406c8c8..b56a4e2e3 100644 --- a/docs/zh-CN/docs/market/calendar/split_calendar.mdx +++ b/docs/zh-CN/docs/market/calendar/split_calendar.mdx @@ -200,11 +200,11 @@ func main() { "code": 0, "message": "success", "data": { - "date": "2026-04-30", + "date": "2024-01-01", "list": [ { - "date": "2026-04-30", - "count": 2228, + "date": "2024-01-15", + "count": 1, "infos": [ { "id": "12345", @@ -213,7 +213,7 @@ func main() { "counter_name": "Apple Inc.", "event_type": "", "activity_type": "", - "date": "2026-05-14", + "date": "2024-01-15", "datetime": "", "content": "", "star": 0, diff --git a/docs/zh-HK/docs/market/calendar/dividend_calendar.mdx b/docs/zh-HK/docs/market/calendar/dividend_calendar.mdx index 362f84e6d..6e41299a3 100644 --- a/docs/zh-HK/docs/market/calendar/dividend_calendar.mdx +++ b/docs/zh-HK/docs/market/calendar/dividend_calendar.mdx @@ -200,11 +200,11 @@ func main() { "code": 0, "message": "success", "data": { - "date": "2026-04-30", + "date": "2024-01-01", "list": [ { - "date": "2026-04-30", - "count": 275, + "date": "2024-01-15", + "count": 1, "infos": [ { "id": "12345", @@ -213,7 +213,7 @@ func main() { "counter_name": "Apple Inc.", "event_type": "", "activity_type": "", - "date": "2026-05-14", + "date": "2024-01-15", "datetime": "", "content": "", "star": 0, diff --git a/docs/zh-HK/docs/market/calendar/earnings_calendar.mdx b/docs/zh-HK/docs/market/calendar/earnings_calendar.mdx index 5cebf81c7..20c1f4683 100644 --- a/docs/zh-HK/docs/market/calendar/earnings_calendar.mdx +++ b/docs/zh-HK/docs/market/calendar/earnings_calendar.mdx @@ -200,11 +200,11 @@ func main() { "code": 0, "message": "success", "data": { - "date": "2026-04-30", + "date": "2024-01-01", "list": [ { - "date": "2026-04-30", - "count": 2228, + "date": "2024-01-15", + "count": 1, "infos": [ { "id": "12345", @@ -213,7 +213,7 @@ func main() { "counter_name": "Apple Inc.", "event_type": "", "activity_type": "", - "date": "2026-05-14", + "date": "2024-01-15", "datetime": "", "content": "", "star": 0, diff --git a/docs/zh-HK/docs/market/calendar/ipo_calendar.mdx b/docs/zh-HK/docs/market/calendar/ipo_calendar.mdx index 66e816121..f2f8a8c4e 100644 --- a/docs/zh-HK/docs/market/calendar/ipo_calendar.mdx +++ b/docs/zh-HK/docs/market/calendar/ipo_calendar.mdx @@ -200,10 +200,10 @@ func main() { "code": 0, "message": "success", "data": { - "date": "2026-04-30", + "date": "2024-01-01", "list": [ { - "date": "2026-05-05", + "date": "2024-01-15", "count": 1, "infos": [ { @@ -213,7 +213,7 @@ func main() { "counter_name": "Apple Inc.", "event_type": "", "activity_type": "", - "date": "2026-05-14", + "date": "2024-01-15", "datetime": "", "content": "", "star": 0, diff --git a/docs/zh-HK/docs/market/calendar/macro_calendar.mdx b/docs/zh-HK/docs/market/calendar/macro_calendar.mdx index 306a305cd..a86093afa 100644 --- a/docs/zh-HK/docs/market/calendar/macro_calendar.mdx +++ b/docs/zh-HK/docs/market/calendar/macro_calendar.mdx @@ -200,22 +200,22 @@ func main() { "code": 0, "message": "success", "data": { - "date": "2026-04-30", + "date": "2024-01-01", "list": [ { - "date": "2026-05-02", - "count": 0, + "date": "2024-01-15", + "count": 1, "infos": [ { "id": "12345", - "symbol": "AAPL.US", + "symbol": "", "market": "US", - "counter_name": "Apple Inc.", + "counter_name": "", "event_type": "", "activity_type": "", - "date": "2026-05-14", + "date": "2024-01-15", "datetime": "", - "content": "", + "content": "US Core PPI MoM", "star": 0, "currency": "", "icon": "", diff --git a/docs/zh-HK/docs/market/calendar/meeting_calendar.mdx b/docs/zh-HK/docs/market/calendar/meeting_calendar.mdx new file mode 100644 index 000000000..a214e0451 --- /dev/null +++ b/docs/zh-HK/docs/market/calendar/meeting_calendar.mdx @@ -0,0 +1,157 @@ +--- +slug: /market/calendar/meeting-calendar +title: 股東大會日曆 +sidebar_position: 6 +language_tabs: false +toc_footers: [] +includes: [] +search: true +highlight_theme: '' +headingLevel: 2 +--- + +瀏覽即將到來的股東大會和公司事件。 + + + + +## 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,不填則返回所有市場 | +| count | integer | NO | 每頁最大事件數,省略時使用伺服器預設值 | +| offset | integer | NO | 從視窗起始跳過的事件數 | +| next | CalendarPageDirection | NO | 從 `next_date` 游標翻頁的方向:`Later` 或 `Earlier` | + +## Request Example + + + + +```python +from longbridge.openapi import CalendarContext, CalendarCategory, 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) +``` + + + + +```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, "2024-01-01", "2024-03-31") + print(resp) + +if __name__ == "__main__": + asyncio.run(main()) +``` + + + + +```javascript +const { Config, CalendarContext, CalendarCategory, OAuth } = require('longbridge') + +async function main() { + const oauth = await OAuth.build('your-client-id', (_, url) => console.log('Open:', url)) + const config = Config.fromOAuth(oauth) + const ctx = CalendarContext.new(config) + const resp = await ctx.financeCalendar(CalendarCategory.Meeting, '2024-01-01', '2024-03-31') + 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: " + 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(); + System.out.println(resp); + } + } +} +``` + + + + +```rust +use std::sync::Arc; +use longbridge::{oauth::OAuthBuilder, calendar::{CalendarContext, CalendarCategory}, 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, None, None, None).await?; + println!("{:?}", resp); + Ok(()) +} +``` + + + + +```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:", 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) +} +``` + + + + +## Response + + +### Response Status + +| Status | Description | Schema | +| ------ | ----------- | ------ | +| 200 | 成功 | CalendarEventsResponse | +| 400 | 請求錯誤 | None | diff --git a/docs/zh-HK/docs/market/calendar/merge_calendar.mdx b/docs/zh-HK/docs/market/calendar/merge_calendar.mdx new file mode 100644 index 000000000..e0aa7c44e --- /dev/null +++ b/docs/zh-HK/docs/market/calendar/merge_calendar.mdx @@ -0,0 +1,157 @@ +--- +slug: /market/calendar/merge-calendar +title: 併購日曆 +sidebar_position: 7 +language_tabs: false +toc_footers: [] +includes: [] +search: true +highlight_theme: '' +headingLevel: 2 +--- + +瀏覽即將到來的併購(M&A)與合併事件。 + + + + +## 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,不填則返回所有市場 | +| count | integer | NO | 每頁最大事件數,省略時使用伺服器預設值 | +| offset | integer | NO | 從視窗起始跳過的事件數 | +| next | CalendarPageDirection | NO | 從 `next_date` 游標翻頁的方向:`Later` 或 `Earlier` | + +## Request Example + + + + +```python +from longbridge.openapi import CalendarContext, CalendarCategory, 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) +``` + + + + +```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, "2024-01-01", "2024-03-31") + print(resp) + +if __name__ == "__main__": + asyncio.run(main()) +``` + + + + +```javascript +const { Config, CalendarContext, CalendarCategory, OAuth } = require('longbridge') + +async function main() { + const oauth = await OAuth.build('your-client-id', (_, url) => console.log('Open:', url)) + const config = Config.fromOAuth(oauth) + const ctx = CalendarContext.new(config) + const resp = await ctx.financeCalendar(CalendarCategory.Merge, '2024-01-01', '2024-03-31') + 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: " + 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(); + System.out.println(resp); + } + } +} +``` + + + + +```rust +use std::sync::Arc; +use longbridge::{oauth::OAuthBuilder, calendar::{CalendarContext, CalendarCategory}, 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, None, None, None).await?; + println!("{:?}", resp); + Ok(()) +} +``` + + + + +```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:", 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) +} +``` + + + + +## Response + + +### Response Status + +| Status | Description | Schema | +| ------ | ----------- | ------ | +| 200 | 成功 | CalendarEventsResponse | +| 400 | 請求錯誤 | None | diff --git a/docs/zh-HK/docs/market/calendar/split_calendar.mdx b/docs/zh-HK/docs/market/calendar/split_calendar.mdx index f327e4a1b..d7232d124 100644 --- a/docs/zh-HK/docs/market/calendar/split_calendar.mdx +++ b/docs/zh-HK/docs/market/calendar/split_calendar.mdx @@ -200,11 +200,11 @@ func main() { "code": 0, "message": "success", "data": { - "date": "2026-04-30", + "date": "2024-01-01", "list": [ { - "date": "2026-04-30", - "count": 2228, + "date": "2024-01-15", + "count": 1, "infos": [ { "id": "12345", @@ -213,7 +213,7 @@ func main() { "counter_name": "Apple Inc.", "event_type": "", "activity_type": "", - "date": "2026-05-14", + "date": "2024-01-15", "datetime": "", "content": "", "star": 0,