diff --git a/docs/en/docs/market/calendar/dividend_calendar.mdx b/docs/en/docs/market/calendar/dividend_calendar.mdx index e82654ec..cb02c0f9 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) } @@ -197,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", @@ -210,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 4e2cee97..e9aadcda 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) } @@ -197,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", @@ -210,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 28d1a036..29201fd3 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) } @@ -197,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": [ { @@ -210,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 34270434..fb0c3b08 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) } @@ -197,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/meeting_calendar.mdx b/docs/en/docs/market/calendar/meeting_calendar.mdx index 9fa2319c..29df2f76 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 2d4a7b73..873236f7 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 75772f9f..d92fe3c7 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) } @@ -197,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", @@ -210,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 e06d699b..f308cd9e 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) } @@ -197,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", @@ -210,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 91fa0291..60ad558b 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) } @@ -197,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", @@ -210,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 6fdcf0eb..9c0f7e82 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) } @@ -197,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": [ { @@ -210,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 979a3257..e27e500a 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) } @@ -197,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 00000000..306aade9 --- /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 00000000..1888135b --- /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 9917c85b..b56a4e2e 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) } @@ -197,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", @@ -210,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 f9e6380a..6e41299a 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) } @@ -197,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", @@ -210,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 44d0338a..20c1f468 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) } @@ -197,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", @@ -210,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 bd7bb7c9..f2f8a8c4 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) } @@ -197,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": [ { @@ -210,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 b935e59b..a86093af 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) } @@ -197,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 00000000..a214e045 --- /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 00000000..e0aa7c44 --- /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 a162ef53..d7232d12 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) } @@ -197,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", @@ -210,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,