Skip to main content

Client

Struct Client 

Source
pub struct Client { /* private fields */ }
Expand description

Reusable async API client.

Implementations§

Source§

impl Client

Source

pub async fn prices_snapshot( &self, selection: &PriceSnapshotSelection, ) -> Result<Response<PriceSnapshotData>, Error>

Fetch current A-share price snapshots.

Source

pub async fn prices_historical( &self, thscode: &AShareCode, start: UnixMillis, end: UnixMillis, adjustment: Adjustment, offset: u32, ) -> Result<Response<HistoricalData>, Error>

Fetch one target’s historical daily K-line data.

Source

pub async fn corp_actions_adjustment_factors( &self, thscode: &AShareCode, from: Option<NaturalDate>, to: Option<NaturalDate>, ) -> Result<Response<AdjustmentFactorsData>, Error>

Fetch raw corporate action events used for price adjustment.

Source

pub async fn financials_income_statements( &self, thscode: &AShareCode, period: FinancialPeriod, range: FinancialRange, ) -> Result<Response<IncomeStatementsData>, Error>

Fetch income statements.

Source

pub async fn financials_balance_sheets( &self, thscode: &AShareCode, period: FinancialPeriod, range: FinancialRange, ) -> Result<Response<BalanceSheetsData>, Error>

Fetch balance sheets.

Source

pub async fn financials_cash_flow_statements( &self, thscode: &AShareCode, period: FinancialPeriod, range: FinancialRange, ) -> Result<Response<CashFlowStatementsData>, Error>

Fetch cash-flow statements.

Source

pub async fn financials_indicators( &self, thscode: &AShareCode, report: &FinancialReport, ) -> Result<Response<FinancialIndicatorsData>, Error>

Fetch the five groups of financial indicators for one report.

Source

pub async fn calendar_trading_days( &self, ) -> Result<Response<TradingDaysData>, Error>

Fetch the service’s recent A-share trading-day sequence.

Source

pub async fn a_share_auction_snapshot( &self, thscodes: &[AShareCode], stage: AuctionStage, ) -> Result<Response<AuctionSnapshotData>, Error>

Fetch auction snapshots for one or more A-share targets.

Source

pub async fn a_share_auction_short_term_benchmark( &self, date: Option<NaturalDate>, ) -> Result<Response<AuctionBenchmarkData>, Error>

Fetch the short-term auction benchmark, optionally for a natural day.

Source

pub async fn a_share_valuations_snapshot( &self, thscodes: &[AShareCode], ) -> Result<Response<ValuationsData>, Error>

Fetch latest valuation metrics for up to 100 A-share targets.

Source

pub async fn special_data_anomaly_analysis_list( &self, tag_codes: &[AnomalyTag], ) -> Result<Response<AnomalyData>, Error>

Fetch today’s anomaly rows, optionally filtered with OR-combined tags.

Source

pub async fn special_data_anomaly_analysis_stock( &self, thscodes: &[AShareCode], ) -> Result<Response<AnomalyData>, Error>

Fetch today’s anomaly rows for up to 50 A-share targets.

Source

pub async fn special_data_dragon_tiger_list( &self, board_type: DragonTigerBoard, date: Option<NaturalDate>, ) -> Result<Response<DragonTigerData>, Error>

Fetch the dragon-tiger list.

Source

pub async fn special_data_hot_stock_list( &self, period: HotListPeriod, ) -> Result<Response<HotStockData>, Error>

Fetch the current hot-stock list.

Source

pub async fn special_data_hot_stock_list_history( &self, date: NaturalDate, ) -> Result<Response<HotStockHistoryData>, Error>

Fetch a historical hot-stock ranking for one natural day.

Source

pub async fn special_data_hot_stock_rank_trend( &self, thscode: &AShareCode, start_date: NaturalDate, end_date: NaturalDate, ) -> Result<Response<HotStockTrendData>, Error>

Fetch one A-share target’s hot-rank trend.

Source

pub async fn special_data_limit_up_pool( &self, date_ms: Option<ShanghaiDateMillis>, page: Page, sort_field: LimitUpSortField, sort_dir: SortDirection, ) -> Result<Response<LimitUpData>, Error>

Fetch the limit-up pool.

Source

pub async fn special_data_limit_down_pool( &self, date_ms: Option<ShanghaiDateMillis>, page: Page, sort_field: LimitDownSortField, sort_dir: SortDirection, ) -> Result<Response<LimitDownData>, Error>

Fetch the limit-down pool.

Source

pub async fn special_data_limit_break_pool( &self, date_ms: Option<ShanghaiDateMillis>, page: Page, sort_field: LimitBreakSortField, sort_dir: SortDirection, ) -> Result<Response<LimitBreakData>, Error>

Fetch the limit-break pool.

Source

pub async fn special_data_limit_up_ladder( &self, ) -> Result<Response<LadderData>, Error>

Fetch the fixed 30-trading-day limit-up ladder.

Source

pub async fn special_data_skyrocket_list( &self, period: HotListPeriod, ) -> Result<Response<HotStockData>, Error>

Fetch the current skyrocket ranking.

Source§

impl Client

Source

pub fn builder(api_key: ApiKey) -> ClientBuilder

Start client configuration with an explicit API key.

Source

pub fn from_env() -> Result<Self, Error>

Construct a client using HITHINK_FINANCE_API_KEY.

Source§

impl Client

Source

pub async fn fund_companies_detail( &self, company_id: &CompanyId, ) -> Result<Response<FundCompanyData>, Error>

Fetch fund company details.

Source

pub async fn fund_corporate_actions_dividends( &self, fund_type: FundType, thscode: &Thscode, ) -> Result<Response<FundDividendsData>, Error>

Fetch historical fund dividends.

Source

pub async fn fund_diagnostics_detail( &self, fund_type: FundType, thscode: &Thscode, ) -> Result<Response<FundDiagnosticsData>, Error>

Fetch fund diagnostic dimensions.

Source

pub async fn fund_financials_indicators( &self, fund_type: FundType, thscode: &Thscode, ) -> Result<Response<FundFinancialIndicatorsData>, Error>

Fetch fund financial indicators.

Source

pub async fn fund_financials_income_statements( &self, fund_type: FundType, thscode: &Thscode, ) -> Result<Response<FundIncomeStatementsData>, Error>

Fetch fund income statements.

Source

pub async fn fund_financials_balance_sheets( &self, fund_type: FundType, thscode: &Thscode, ) -> Result<Response<FundBalanceSheetsData>, Error>

Fetch fund balance sheets.

Source

pub async fn fund_holders_detail( &self, fund_type: FundType, thscode: &Thscode, merge_scope: HolderMergeScope, ) -> Result<Response<FundHoldersData>, Error>

Fetch fund holder structure.

Source

pub async fn fund_holders_top( &self, fund_type: FundType, thscode: &Thscode, limit: Option<u8>, ) -> Result<Response<FundTopHoldersData>, Error>

Fetch up to ten largest fund holders.

Source

pub async fn fund_portfolio_holdings( &self, fund_type: FundType, thscode: &Thscode, ) -> Result<Response<FundHoldingsData>, Error>

Fetch periodically disclosed fund holdings and summary ratios.

Source

pub async fn fund_managers_investment_style( &self, manager_id: &ManagerId, ) -> Result<Response<FundManagerStyleData>, Error>

Fetch a fund manager’s investment style.

Source

pub async fn fund_managers_performance( &self, manager_id: &ManagerId, range: ManagerPerformanceRange, ) -> Result<Response<FundManagerPerformanceData>, Error>

Fetch a fund manager’s performance series.

Source

pub async fn fund_managers_experience( &self, manager_id: &ManagerId, ) -> Result<Response<FundManagerExperienceData>, Error>

Fetch a fund manager’s professional experience.

Source

pub async fn fund_managers_detail( &self, manager_id: &ManagerId, ) -> Result<Response<FundManagerDetailData>, Error>

Fetch a fund manager’s detailed profile.

Source

pub async fn fund_market_snapshot( &self, thscode: &Thscode, ) -> Result<Response<FundMarketSnapshotData>, Error>

Fetch the latest exchange-traded fund snapshot.

Source

pub async fn fund_market_historical( &self, thscode: &Thscode, start: UnixMillis, end: UnixMillis, ) -> Result<Response<FundMarketHistoricalData>, Error>

Fetch exchange-traded fund historical daily prices.

Source

pub async fn fund_news_article_list( &self, fund_type: FundType, thscode: &Thscode, limit: Option<u32>, offset: Option<&Cursor>, ) -> Result<Response<FundNewsData>, Error>

Fetch cursor-paged fund news.

Source

pub async fn fund_offerings_list( &self, status: OfferingStatus, ) -> Result<Response<FundOfferingsData>, Error>

Fetch active or upcoming fund offerings.

Source

pub async fn fund_performance_nav( &self, fund_type: FundType, thscode: &Thscode, range: Option<FundRange>, nav_type: FundNavType, ) -> Result<Response<FundNavData>, Error>

Fetch fund NAV series.

Source

pub async fn fund_performance_returns( &self, fund_type: FundType, thscode: &Thscode, ) -> Result<Response<FundReturnsData>, Error>

Fetch multi-range fund returns and peer rankings.

Source

pub async fn fund_performance_indicators_historical( &self, fund_type: FundType, thscode: &Thscode, start: UnixMillis, end: UnixMillis, ) -> Result<Response<FundIndicatorHistoryData>, Error>

Fetch historical fund performance indicators.

Source

pub async fn fund_performance_drawdowns( &self, fund_type: FundType, thscode: &Thscode, ) -> Result<Response<FundDrawdownsData>, Error>

Fetch standard-period maximum drawdowns.

Source

pub async fn fund_portfolio_stock_history( &self, fund_type: FundType, thscode: &Thscode, report_type: &ReportType, end_date: NaturalDate, ) -> Result<Response<FundPortfolioHistoryData>, Error>

Fetch historical disclosed stock holdings.

Source

pub async fn fund_portfolio_bond_history( &self, fund_type: FundType, thscode: &Thscode, report_type: &ReportType, end_date: NaturalDate, ) -> Result<Response<FundPortfolioHistoryData>, Error>

Fetch historical disclosed bond holdings.

Source

pub async fn fund_portfolio_stock_report_dates( &self, fund_type: FundType, thscode: &Thscode, report_type: Option<&ReportType>, ) -> Result<Response<FundReportDatesData>, Error>

Fetch available stock-holding report dates.

Source

pub async fn fund_portfolio_bond_report_dates( &self, fund_type: FundType, thscode: &Thscode, report_type: Option<&ReportType>, ) -> Result<Response<FundReportDatesData>, Error>

Fetch available bond-holding report dates.

Source

pub async fn fund_portfolio_asset_allocation( &self, fund_type: FundType, thscode: &Thscode, ) -> Result<Response<FundAssetAllocationData>, Error>

Fetch fund asset allocation.

Source

pub async fn fund_portfolio_industry_allocation( &self, fund_type: FundType, thscode: &Thscode, ) -> Result<Response<FundIndustryAllocationData>, Error>

Fetch fund industry allocation.

Source

pub async fn fund_profile_detail( &self, fund_type: FundType, thscode: &Thscode, ) -> Result<Response<FundProfileData>, Error>

Fetch fund basic profile details.

Source§

impl Client

Source

pub async fn index_catalog_ths_index_list( &self, tag: IndexTag, ) -> Result<Response<IndexCatalogData>, Error>

List Tonghuashun indices for a catalog tag.

Source

pub async fn index_constituents_ths_stock_list( &self, thscode: &Thscode, ) -> Result<Response<IndexConstituentsData>, Error>

Fetch the current constituent list of one index.

Source

pub async fn index_prices_snapshot( &self, thscodes: &[Thscode], ) -> Result<Response<PriceSnapshotData>, Error>

Fetch snapshots for one or more exchange or Tonghuashun indices.

Source

pub async fn index_prices_historical( &self, thscode: &Thscode, start: UnixMillis, end: UnixMillis, ) -> Result<Response<IndexHistoricalData>, Error>

Fetch historical daily K-lines for one index.

Source§

impl Client

Source

pub async fn market_dump_daily_k( &self, ) -> Result<Response<MarketDumpUrl>, Error>

Sign a URL for the full ten-year daily K-line dump.

Source

pub async fn market_dump_daily_k_10d( &self, ) -> Result<Response<MarketDumpUrl>, Error>

Sign a URL for the latest ten trading days of daily K-lines.

Source

pub async fn market_dump_adjustment_factors( &self, ) -> Result<Response<MarketDumpUrl>, Error>

Sign a URL for the full corporate-action event dump.

Source§

impl Client

Search targets by complete code, local ticker, or name.

Source§

impl Client

Source

pub async fn tickers_list( &self, request: &TickerListRequest, ) -> Result<Response<TickerData>, Error>

Browse the normalized target code table.

Trait Implementations§

Source§

impl Clone for Client

Source§

fn clone(&self) -> Client

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Client

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more