中文

OpenAPI Reference

AShare API

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

Open llm.txt

Overview

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.

Servers

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

Security

  • ApiKeyAuth: apiKey via X-API-Key in header

System

3 operations

Liveness probe

Operation ID: getSystemHealth

Auth: Public

Parameters

No parameters.

Responses

  • 200 Service is alive schema: StatusResponse

Readiness probe

Operation ID: getSystemReadiness

Auth: Public

Parameters

No parameters.

Responses

  • 200 Service is ready schema: StatusResponse

Service version metadata

Operation ID: getSystemVersion

Auth: Public

Parameters

No parameters.

Responses

  • 200 Version metadata schema: VersionResponse

Markets

3 operations

List supported markets

Operation ID: listMarkets

Auth: API Key

Parameters

No parameters.

Responses

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

Get one market

Operation ID: getMarket

Auth: API Key

Parameters

  • market [path] required schema: MarketId

Responses

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

List trading days for one market

Operation ID: listTradingDays

Auth: API Key

Parameters

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

Responses

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

Classifications

2 operations

List primary industries

Operation ID: listPrimaryIndustries

Auth: API Key

Parameters

  • page[size] [query] schema: integer

Responses

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

List sector classifications

Operation ID: listSectors

Auth: API Key

Parameters

  • page[size] [query] schema: integer

Responses

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

Equities

25 operations

List equities

Operation ID: listEquities

Auth: API Key

Parameters

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

Responses

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

Get one equity

Operation ID: getEquity

Auth: API Key

Parameters

  • instrument_id [path] required schema: string

Responses

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

List equity bars

Operation ID: listEquityBars

Auth: API Key

Parameters

  • instrument_id [path] required schema: string
  • interval [query] required 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

Responses

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

List business scope entries

Operation ID: listBusinessScope

Auth: API Key

Parameters

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

Responses

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

List capital flows

Operation ID: listCapitalFlows

Auth: API Key

Parameters

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

Responses

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

Get company profile

Operation ID: getCompanyProfile

Auth: API Key

Parameters

  • instrument_id [path] required schema: string

Responses

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

List dividends

Operation ID: listDividends

Auth: API Key

Parameters

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

Responses

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

List earnings forecasts

Operation ID: listEarningsForecasts

Auth: API Key

Parameters

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

Responses

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

List financial indicators

Operation ID: listFinancialIndicators

Auth: API Key

Parameters

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

Responses

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

List balance sheets

Operation ID: listBalanceSheets

Auth: API Key

Parameters

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

Responses

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

List cash flow statements

Operation ID: listCashFlowStatements

Auth: API Key

Parameters

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

Responses

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

List income statements

Operation ID: listIncomeStatements

Auth: API Key

Parameters

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

Responses

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

List institutional holdings

Operation ID: listInstitutionalHoldings

Auth: API Key

Parameters

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

Responses

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

List management history

Operation ID: listManagementHistory

Auth: API Key

Parameters

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

Responses

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

List price limits

Operation ID: listPriceLimits

Auth: API Key

Parameters

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

Responses

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

List equity quotes

Operation ID: listEquityQuotes

Auth: API Key

Parameters

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

Responses

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

List sector memberships

Operation ID: listSectorMemberships

Auth: API Key

Parameters

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

Responses

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

List share capital history

Operation ID: listShareCapitalHistory

Auth: API Key

Parameters

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

Responses

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

List shareholder counts

Operation ID: listShareholderCounts

Auth: API Key

Parameters

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

Responses

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

List top shareholders

Operation ID: listTopShareholders

Auth: API Key

Parameters

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

Responses

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

List top float shareholders

Operation ID: listTopFloatShareholders

Auth: API Key

Parameters

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

Responses

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

List equity technical indicators

Operation ID: listEquityTechnicalIndicators

Auth: API Key

Parameters

  • instrument_id [path] required schema: string
  • indicator [path] required schema: IndicatorId
  • interval [query] required 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

Responses

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

List equity trades

Operation ID: listEquityTrades

Auth: API Key

Parameters

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

Responses

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

List supported pool types

Operation ID: listPoolTypes

Auth: API Key

Parameters

No parameters.

Responses

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

List pool constituents

Operation ID: listPoolConstituents

Auth: API Key

Parameters

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

Responses

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

Indices

5 operations

List indices

Operation ID: listIndices

Auth: API Key

Parameters

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

Responses

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

Get one index

Operation ID: getIndex

Auth: API Key

Parameters

  • instrument_id [path] required schema: string

Responses

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

List index bars

Operation ID: listIndexBars

Auth: API Key

Parameters

  • instrument_id [path] required schema: string
  • interval [query] required 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

Responses

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

List index quotes

Operation ID: listIndexQuotes

Auth: API Key

Parameters

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

Responses

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

List index technical indicators

Operation ID: listIndexTechnicalIndicators

Auth: API Key

Parameters

  • instrument_id [path] required schema: string
  • indicator [path] required schema: IndicatorId
  • interval [query] required 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

Responses

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

Funds

3 operations

List funds

Operation ID: listFunds

Auth: API Key

Parameters

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

Responses

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

Get one fund

Operation ID: getFund

Auth: API Key

Parameters

  • instrument_id [path] required schema: string

Responses

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

List fund quotes

Operation ID: listFundQuotes

Auth: API Key

Parameters

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

Responses

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