EN

OpenAPI Reference

AShare API

Draft OpenAPI 3.1 contract for the unified market-data REST API.

打开 llm.txt

概览

This draft reflects the current code contract implemented by `ashare-api`. Scope of this draft: - system endpoints - markets - classifications - equities - indices - funds The API is read-only in this version.

服务地址

  • / Same-origin server
  • http://localhost:8080 Local development

鉴权

  • ApiKeyAuth: apiKey 通过 X-API-Key 位置 header

System

3 个操作

Liveness probe

Operation ID: getSystemHealth

鉴权: 公开

参数

无参数。

响应

  • 200 Service is alive schema: StatusResponse

Readiness probe

Operation ID: getSystemReadiness

鉴权: 公开

参数

无参数。

响应

  • 200 Service is ready schema: StatusResponse

Service version metadata

Operation ID: getSystemVersion

鉴权: 公开

参数

无参数。

响应

  • 200 Version metadata schema: VersionResponse

Markets

3 个操作

List supported markets

Operation ID: listMarkets

鉴权: API Key

参数

无参数。

响应

  • 200 Market collection schema: MarketCollectionResponse
  • 401 Unauthorized schema: ErrorResponse

Get one market

Operation ID: getMarket

鉴权: API Key

参数

  • market [path] 必填 schema: MarketId

响应

  • 200 Market resource schema: MarketResponse
  • 401 Unauthorized schema: ErrorResponse
  • 404 Resource not found schema: ErrorResponse

List trading days for one market

Operation ID: listTradingDays

鉴权: API Key

参数

  • market [path] 必填 schema: MarketId
  • from [query] schema: string (date)
  • to [query] schema: string (date)
  • page[size] [query] schema: integer

响应

  • 200 Trading day collection schema: TradingDayCollectionResponse
  • 400 Invalid request parameters schema: ErrorResponse
  • 401 Unauthorized schema: ErrorResponse
  • 404 Resource not found schema: ErrorResponse

Classifications

2 个操作

List primary industries

Operation ID: listPrimaryIndustries

鉴权: API Key

参数

  • page[size] [query] schema: integer

响应

  • 200 Primary industry collection schema: ClassificationCollectionResponse
  • 401 Unauthorized schema: ErrorResponse

List sector classifications

Operation ID: listSectors

鉴权: API Key

参数

  • page[size] [query] schema: integer

响应

  • 200 Sector collection schema: ClassificationCollectionResponse
  • 401 Unauthorized schema: ErrorResponse

Equities

25 个操作

List equities

Operation ID: listEquities

鉴权: API Key

参数

  • market [query] schema: MarketId
  • board [query] schema: BoardId
  • code [query] schema: string
  • name [query] schema: string
  • page[size] [query] schema: integer

响应

  • 200 Equity collection schema: InstrumentCollectionResponse
  • 400 Invalid request parameters schema: ErrorResponse
  • 401 Unauthorized schema: ErrorResponse

Get one equity

Operation ID: getEquity

鉴权: API Key

参数

  • instrument_id [path] 必填 schema: string

响应

  • 200 Equity resource schema: InstrumentResponse
  • 401 Unauthorized schema: ErrorResponse
  • 404 Resource not found schema: ErrorResponse

List equity bars

Operation ID: listEquityBars

鉴权: API Key

参数

  • instrument_id [path] 必填 schema: string
  • interval [query] 必填 schema: IntervalId
  • adjustment [query] schema: AdjustmentId
  • from [query] schema: string (date-time)
  • to [query] schema: string (date-time)
  • date [query] schema: string (date)
  • page[size] [query] schema: integer

响应

  • 200 Bar collection schema: BarCollectionResponse
  • 400 Invalid request parameters schema: ErrorResponse
  • 401 Unauthorized schema: ErrorResponse

List business scope entries

Operation ID: listBusinessScope

鉴权: API Key

参数

  • instrument_id [path] 必填 schema: string
  • page[size] [query] schema: integer

响应

  • 200 Business scope collection schema: TextEntryCollectionResponse
  • 401 Unauthorized schema: ErrorResponse

List capital flows

Operation ID: listCapitalFlows

鉴权: API Key

参数

  • instrument_id [path] 必填 schema: string
  • from [query] schema: string (date-time)
  • to [query] schema: string (date-time)
  • date [query] schema: string (date)
  • page[size] [query] schema: integer

响应

  • 200 Capital flow collection schema: CapitalFlowCollectionResponse
  • 400 Invalid request parameters schema: ErrorResponse
  • 401 Unauthorized schema: ErrorResponse

Get company profile

Operation ID: getCompanyProfile

鉴权: API Key

参数

  • instrument_id [path] 必填 schema: string

响应

  • 200 Company profile resource schema: CompanyProfileResponse
  • 401 Unauthorized schema: ErrorResponse
  • 404 Resource not found schema: ErrorResponse

List dividends

Operation ID: listDividends

鉴权: API Key

参数

  • instrument_id [path] 必填 schema: string
  • from [query] schema: string (date)
  • to [query] schema: string (date)
  • page[size] [query] schema: integer

响应

  • 200 Dividend collection schema: DividendCollectionResponse
  • 400 Invalid request parameters schema: ErrorResponse
  • 401 Unauthorized schema: ErrorResponse

List earnings forecasts

Operation ID: listEarningsForecasts

鉴权: API Key

参数

  • instrument_id [path] 必填 schema: string
  • from [query] schema: string (date)
  • to [query] schema: string (date)
  • page[size] [query] schema: integer

响应

  • 200 Earnings forecast collection schema: EarningsForecastCollectionResponse
  • 400 Invalid request parameters schema: ErrorResponse
  • 401 Unauthorized schema: ErrorResponse

List financial indicators

Operation ID: listFinancialIndicators

鉴权: API Key

参数

  • instrument_id [path] 必填 schema: string
  • from [query] schema: string (date)
  • to [query] schema: string (date)
  • page[size] [query] schema: integer

响应

  • 200 Financial indicator collection schema: FinancialIndicatorCollectionResponse
  • 400 Invalid request parameters schema: ErrorResponse
  • 401 Unauthorized schema: ErrorResponse

List balance sheets

Operation ID: listBalanceSheets

鉴权: API Key

参数

  • instrument_id [path] 必填 schema: string
  • from [query] schema: string (date)
  • to [query] schema: string (date)
  • page[size] [query] schema: integer

响应

  • 200 Balance sheet collection schema: BalanceSheetCollectionResponse
  • 400 Invalid request parameters schema: ErrorResponse
  • 401 Unauthorized schema: ErrorResponse

List cash flow statements

Operation ID: listCashFlowStatements

鉴权: API Key

参数

  • instrument_id [path] 必填 schema: string
  • page[size] [query] schema: integer

响应

  • 200 Cash flow statement collection schema: CashFlowStatementCollectionResponse
  • 401 Unauthorized schema: ErrorResponse

List income statements

Operation ID: listIncomeStatements

鉴权: API Key

参数

  • instrument_id [path] 必填 schema: string
  • page[size] [query] schema: integer

响应

  • 200 Income statement collection schema: IncomeStatementCollectionResponse
  • 401 Unauthorized schema: ErrorResponse

List institutional holdings

Operation ID: listInstitutionalHoldings

鉴权: API Key

参数

  • instrument_id [path] 必填 schema: string
  • page[size] [query] schema: integer

响应

  • 200 Institutional holding collection schema: InstitutionalHoldingCollectionResponse
  • 401 Unauthorized schema: ErrorResponse

List management history

Operation ID: listManagementHistory

鉴权: API Key

参数

  • instrument_id [path] 必填 schema: string
  • page[size] [query] schema: integer

响应

  • 200 Management history collection schema: ManagementHistoryCollectionResponse
  • 401 Unauthorized schema: ErrorResponse

List price limits

Operation ID: listPriceLimits

鉴权: API Key

参数

  • instrument_id [path] 必填 schema: string
  • from [query] schema: string (date)
  • to [query] schema: string (date)
  • date [query] schema: string (date)
  • page[size] [query] schema: integer

响应

  • 200 Price limit collection schema: PriceLimitCollectionResponse
  • 400 Invalid request parameters schema: ErrorResponse
  • 401 Unauthorized schema: ErrorResponse

List equity quotes

Operation ID: listEquityQuotes

鉴权: API Key

参数

  • instrument_id [path] 必填 schema: string
  • from [query] schema: string (date-time)
  • to [query] schema: string (date-time)
  • date [query] schema: string (date)
  • page[size] [query] schema: integer

响应

  • 200 Quote collection schema: QuoteCollectionResponse
  • 400 Invalid request parameters schema: ErrorResponse
  • 401 Unauthorized schema: ErrorResponse

List sector memberships

Operation ID: listSectorMemberships

鉴权: API Key

参数

  • instrument_id [path] 必填 schema: string
  • page[size] [query] schema: integer

响应

  • 200 Sector membership collection schema: TextEntryCollectionResponse
  • 401 Unauthorized schema: ErrorResponse

List share capital history

Operation ID: listShareCapitalHistory

鉴权: API Key

参数

  • instrument_id [path] 必填 schema: string
  • from [query] schema: string (date)
  • to [query] schema: string (date)
  • page[size] [query] schema: integer

响应

  • 200 Share capital collection schema: ShareCapitalHistoryCollectionResponse
  • 400 Invalid request parameters schema: ErrorResponse
  • 401 Unauthorized schema: ErrorResponse

List shareholder counts

Operation ID: listShareholderCounts

鉴权: API Key

参数

  • instrument_id [path] 必填 schema: string
  • from [query] schema: string (date)
  • to [query] schema: string (date)
  • page[size] [query] schema: integer

响应

  • 200 Shareholder count collection schema: ShareholderCountCollectionResponse
  • 400 Invalid request parameters schema: ErrorResponse
  • 401 Unauthorized schema: ErrorResponse

List top shareholders

Operation ID: listTopShareholders

鉴权: API Key

参数

  • instrument_id [path] 必填 schema: string
  • page[size] [query] schema: integer

响应

  • 200 Top shareholder collection schema: TopShareholderCollectionResponse
  • 401 Unauthorized schema: ErrorResponse

List top float shareholders

Operation ID: listTopFloatShareholders

鉴权: API Key

参数

  • instrument_id [path] 必填 schema: string
  • page[size] [query] schema: integer

响应

  • 200 Top float shareholder collection schema: TopFloatShareholderCollectionResponse
  • 401 Unauthorized schema: ErrorResponse

List equity technical indicators

Operation ID: listEquityTechnicalIndicators

鉴权: API Key

参数

  • instrument_id [path] 必填 schema: string
  • indicator [path] 必填 schema: IndicatorId
  • interval [query] 必填 schema: IntervalId
  • adjustment [query] schema: AdjustmentId
  • from [query] schema: string (date-time)
  • to [query] schema: string (date-time)
  • date [query] schema: string (date)
  • page[size] [query] schema: integer

响应

  • 200 Technical indicator collection schema: TechnicalIndicatorCollectionResponse
  • 400 Invalid request parameters schema: ErrorResponse
  • 401 Unauthorized schema: ErrorResponse

List equity trades

Operation ID: listEquityTrades

鉴权: API Key

参数

  • instrument_id [path] 必填 schema: string
  • from [query] schema: string (date-time)
  • to [query] schema: string (date-time)
  • date [query] schema: string (date)
  • page[size] [query] schema: integer

响应

  • 200 Trade collection schema: TradeCollectionResponse
  • 400 Invalid request parameters schema: ErrorResponse
  • 401 Unauthorized schema: ErrorResponse

List supported pool types

Operation ID: listPoolTypes

鉴权: API Key

参数

无参数。

响应

  • 200 Pool type collection schema: PoolTypeCollectionResponse
  • 401 Unauthorized schema: ErrorResponse

List pool constituents

Operation ID: listPoolConstituents

鉴权: API Key

参数

  • pool_type [path] 必填 schema: PoolTypeId
  • date [query] schema: string (date)
  • page[size] [query] schema: integer

响应

  • 200 Pool constituent collection schema: PoolConstituentCollectionResponse
  • 400 Invalid request parameters schema: ErrorResponse
  • 401 Unauthorized schema: ErrorResponse
  • 404 Resource not found schema: ErrorResponse

Indices

5 个操作

List indices

Operation ID: listIndices

鉴权: API Key

参数

  • market [query] schema: MarketId
  • code [query] schema: string
  • name [query] schema: string
  • page[size] [query] schema: integer

响应

  • 200 Index collection schema: InstrumentCollectionResponse
  • 400 Invalid request parameters schema: ErrorResponse
  • 401 Unauthorized schema: ErrorResponse

Get one index

Operation ID: getIndex

鉴权: API Key

参数

  • instrument_id [path] 必填 schema: string

响应

  • 200 Index resource schema: InstrumentResponse
  • 401 Unauthorized schema: ErrorResponse
  • 404 Resource not found schema: ErrorResponse

List index bars

Operation ID: listIndexBars

鉴权: API Key

参数

  • instrument_id [path] 必填 schema: string
  • interval [query] 必填 schema: IntervalId
  • adjustment [query] schema: AdjustmentId
  • from [query] schema: string (date-time)
  • to [query] schema: string (date-time)
  • date [query] schema: string (date)
  • page[size] [query] schema: integer

响应

  • 200 Bar collection schema: BarCollectionResponse
  • 400 Invalid request parameters schema: ErrorResponse
  • 401 Unauthorized schema: ErrorResponse

List index quotes

Operation ID: listIndexQuotes

鉴权: API Key

参数

  • instrument_id [path] 必填 schema: string
  • from [query] schema: string (date-time)
  • to [query] schema: string (date-time)
  • date [query] schema: string (date)
  • page[size] [query] schema: integer

响应

  • 200 Quote collection schema: QuoteCollectionResponse
  • 400 Invalid request parameters schema: ErrorResponse
  • 401 Unauthorized schema: ErrorResponse

List index technical indicators

Operation ID: listIndexTechnicalIndicators

鉴权: API Key

参数

  • instrument_id [path] 必填 schema: string
  • indicator [path] 必填 schema: IndicatorId
  • interval [query] 必填 schema: IntervalId
  • adjustment [query] schema: AdjustmentId
  • from [query] schema: string (date-time)
  • to [query] schema: string (date-time)
  • date [query] schema: string (date)
  • page[size] [query] schema: integer

响应

  • 200 Technical indicator collection schema: TechnicalIndicatorCollectionResponse
  • 400 Invalid request parameters schema: ErrorResponse
  • 401 Unauthorized schema: ErrorResponse

Funds

3 个操作

List funds

Operation ID: listFunds

鉴权: API Key

参数

  • market [query] schema: MarketId
  • code [query] schema: string
  • name [query] schema: string
  • page[size] [query] schema: integer

响应

  • 200 Fund collection schema: InstrumentCollectionResponse
  • 400 Invalid request parameters schema: ErrorResponse
  • 401 Unauthorized schema: ErrorResponse

Get one fund

Operation ID: getFund

鉴权: API Key

参数

  • instrument_id [path] 必填 schema: string

响应

  • 200 Fund resource schema: InstrumentResponse
  • 401 Unauthorized schema: ErrorResponse
  • 404 Resource not found schema: ErrorResponse

List fund quotes

Operation ID: listFundQuotes

鉴权: API Key

参数

  • instrument_id [path] 必填 schema: string
  • from [query] schema: string (date-time)
  • to [query] schema: string (date-time)
  • date [query] schema: string (date)
  • page[size] [query] schema: integer

响应

  • 200 Quote collection schema: QuoteCollectionResponse
  • 400 Invalid request parameters schema: ErrorResponse
  • 401 Unauthorized schema: ErrorResponse