AShareHub API Documentation
AShareHub provides RESTful API access to Chinese A-Share market data through 38 endpoints, covering all listed A-shares on the Shanghai and Shenzhen exchanges. Our API delivers daily OHLCV prices, fundamental indicators, northbound capital flows, money flow by order size, chip distribution, margin trading, block trades, shareholder data, concept/theme sectors, FX rates, index data, industry classifications, and financial statements.
https://asharehub.com
Version: v1
Format: JSON
Quick Start
Step 1: Create a free account at asharehub.com/console/register
Step 2: Generate your API key in the Dashboard
Step 3: Make your first request:
curl -H "X-API-Key: ash_your_key_here" \
"https://asharehub.com/v1/market/daily?ts_code=000001.SZ&limit=5"
pip install asharehub
from asharehub import AShareHub
client = AShareHub(api_key="ash_your_key_here")
df = client.market_daily(ts_code="000001.SZ", limit=5)
print(df)
Authentication
All data API endpoints require an API key passed via the X-API-Key header.
curl -H "X-API-Key: ash_your_key_here" https://asharehub.com/v1/market/daily
Rate Limits
Requests are limited per API key on a daily basis. When exceeded, the API returns 429 Too Many Requests.
| Plan | Price | Daily Limit |
|---|---|---|
| Free | $0 | 100 |
| Pro | $49/mo | 10,000 |
| Business | $99/mo | 50,000 |
Real-time Quote
Latest intraday quote snapshot — one row per security, continuously refreshed during trading hours. Outside trading hours, returns the last session's closing snapshot.
GET /v1/market/realtime
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| ts_code | string | No | Ticker, or comma-separated basket up to 200, e.g. 600519.SH,000001.SZ. Omit to page the whole market. |
| limit | int | No | Max rows (default 100, max 5000) |
| offset | int | No | Pagination offset (default 0) |
Response Fields
| Field | Type | Description |
|---|---|---|
| ts_code | string | Stock/index ticker |
| name | string | Security name |
| price | number | Latest traded price |
| open | number | Open price |
| high | number | Intraday high |
| low | number | Intraday low |
| pre_close | number | Previous close |
| pct_chg | number | Percent change vs previous close (%) |
| volume | number | Cumulative volume (shares) |
| amount | number | Cumulative turnover (CNY) |
| trade_time | string | Quote timestamp from source |
curl -H "X-API-Key: YOUR_KEY" \
"https://asharehub.com/v1/market/realtime?ts_code=600519.SH,000001.SZ"
News Flash
Real-time Chinese financial news flashes. source is required — each source is a separate feed (they report the same events independently, so query one at a time). Content is Chinese.
GET /v1/news/flash
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| source | string | Yes | Feed: cls (财联社), jin10 (金十), sina (新浪) |
| start_date | string | No | Start date (YYYY-MM-DD), filters publish_time |
| end_date | string | No | End date (YYYY-MM-DD) |
| importance | int | No | Only items with importance ≥ this (1 = important) |
| limit | int | No | Max rows (default 100, max 5000) |
| offset | int | No | Pagination offset (default 0) |
Response Fields
| Field | Type | Description |
|---|---|---|
| source | string | News source (cls / jin10 / sina) |
| publish_time | string | Publish timestamp |
| content_cn | string | Flash content (Chinese) |
| tags | string | Category tags (nullable) |
| importance | int | Importance flag 0/1 (nullable) |
| url | string | Source article URL (nullable) |
curl -H "X-API-Key: YOUR_KEY" \
"https://asharehub.com/v1/news/flash?source=cls&importance=1&limit=10"
Market Daily
Daily OHLCV price data for A-share stocks.
GET /v1/market/daily
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| ts_code | string | No | Stock code, e.g. 000001.SZ |
| start_date | string | No | Start date (YYYY-MM-DD) |
| end_date | string | No | End date (YYYY-MM-DD) |
| limit | int | No | Max rows (default 100, max 5000) |
| offset | int | No | Pagination offset (default 0) |
Response Fields
| Field | Type | Description |
|---|---|---|
| ts_code | string | Stock code |
| trade_date | string | Trading date |
| open | number | Opening price |
| high | number | Highest price |
| low | number | Lowest price |
| close | number | Closing price |
| pre_close | number | Previous close |
| change | number | Price change |
| pct_chg | number | Change % |
| vol | number | Volume (lots) |
| amount | number | Turnover (CNY thousands) |
curl -H "X-API-Key: YOUR_KEY" \
"https://asharehub.com/v1/market/daily?ts_code=000001.SZ&start_date=2024-01-01&end_date=2024-01-31&limit=5"
Fundamentals
Daily fundamental indicators including PE, PB, turnover rate, market cap, etc.
GET /v1/market/fundamentals
Parameters
Same as Market Daily: ts_code, start_date, end_date, limit, offset
Key Response Fields
| Field | Description |
|---|---|
| pe / pe_ttm | Price-to-Earnings ratio (static / trailing 12m) |
| pb | Price-to-Book ratio |
| ps / ps_ttm | Price-to-Sales ratio |
| turnover_rate / turnover_rate_f | Turnover rate (total / free float) |
| total_mv / circ_mv | Total / circulating market cap (CNY 10k) |
| volume_ratio | Volume ratio |
Margin Trading
Daily margin trading and short selling data per stock.
GET /v1/market/margin
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| ts_code | string | No | Stock code, e.g. 000001.SZ |
| start_date | string | No | Start date (YYYY-MM-DD) |
| end_date | string | No | End date (YYYY-MM-DD) |
| limit | int | No | Max rows (default 100, max 5000) |
| offset | int | No | Pagination offset (default 0) |
Response Fields
| Field | Type | Description |
|---|---|---|
| trade_date | string | Trading date |
| ts_code | string | Stock code |
| name | string | Stock name |
| rzye | number | Margin buy balance (CNY) |
| rqye | number | Short sell balance (CNY) |
| rzmre | number | Margin buy amount today |
| rqyl | number | Short sell volume today |
| rzche | number | Margin repayment today |
| rqchl | number | Short cover volume today |
| rqmcl | number | Short sell volume today |
| rzrqye | number | Total margin + short balance |
curl -H "X-API-Key: YOUR_KEY" \
"https://asharehub.com/v1/market/margin?ts_code=000001.SZ&start_date=2024-01-01&limit=5"
Block Trade
Block (large-lot) trade records for A-share stocks.
GET /v1/market/block-trade
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| ts_code | string | No | Stock code, e.g. 000001.SZ |
| start_date | string | No | Start date (YYYY-MM-DD) |
| end_date | string | No | End date (YYYY-MM-DD) |
| limit | int | No | Max rows (default 100, max 5000) |
| offset | int | No | Pagination offset (default 0) |
Response Fields
| Field | Type | Description |
|---|---|---|
| ts_code | string | Stock code |
| trade_date | string | Trading date |
| price | number | Trade price (CNY) |
| vol | number | Volume (10k shares) |
| amount | number | Amount (10k CNY) |
| buyer | string | Buyer broker |
| seller | string | Seller broker |
curl -H "X-API-Key: YOUR_KEY" \
"https://asharehub.com/v1/market/block-trade?ts_code=000001.SZ&start_date=2024-01-01&limit=5"
Top List
Dragon & Tiger list — stocks triggering exchange disclosure rules.
GET /v1/market/top-list
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| ts_code | string | No | Stock code, e.g. 000001.SZ |
| start_date | string | No | Start date (YYYY-MM-DD) |
| end_date | string | No | End date (YYYY-MM-DD) |
| limit | int | No | Max rows (default 100, max 5000) |
| offset | int | No | Pagination offset (default 0) |
Response Fields
| Field | Type | Description |
|---|---|---|
| trade_date | string | Trading date |
| ts_code | string | Stock code |
| name | string | Stock name |
| close | number | Closing price |
| pct_change | number | Price change % |
| turnover_rate | number | Turnover rate % |
| amount | number | Total turnover (CNY) |
| l_sell | number | Institutional sell (CNY) |
| l_buy | number | Institutional buy (CNY) |
| l_amount | number | Institutional total (CNY) |
curl -H "X-API-Key: YOUR_KEY" \
"https://asharehub.com/v1/market/top-list?start_date=2024-01-01&end_date=2024-01-31&limit=5"
Top Inst
Per-seat institutional breakdown of Dragon & Tiger list buying/selling. Unlike the aggregated top list, this shows which specific brokerage branch (e.g. "中信建投上海溧阳路") was trading — widely used for hot-money tracking.
GET /v1/market/top-inst
Same parameters as Market Daily (ts_code, start_date, end_date, limit, offset).
Response Fields
| Field | Description |
|---|---|
| trade_date | Trading date |
| ts_code | Stock code |
| exalter | Brokerage branch / institutional seat name |
| buy / buy_rate | Seat buy amount / % of daily turnover |
| sell / sell_rate | Seat sell amount / % of daily turnover |
| net_buy | Net buy (buy − sell) |
| side | Buy-side / sell-side disclosure |
| reason | Reason the stock was listed |
Holder Trade
Major shareholder and executive trades.
GET /v1/market/holder-trade
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| ts_code | string | No | Stock code, e.g. 000001.SZ |
| start_date | string | No | Start date (YYYY-MM-DD) |
| end_date | string | No | End date (YYYY-MM-DD) |
| limit | int | No | Max rows (default 100, max 5000) |
| offset | int | No | Pagination offset (default 0) |
Response Fields
| Field | Type | Description |
|---|---|---|
| ts_code | string | Stock code |
| ann_date | string | Announcement date |
| holder_name | string | Holder name |
| holder_type | string | G=executive, P=individual, C=company |
| in_de | string | IN=buy, DE=sell |
| change_vol | number | Change volume |
| change_ratio | number | Change ratio |
| after_share | number | Shares after trade |
| after_ratio | number | Ratio after trade |
| avg_price | number | Average price |
| total_share | number | Total shares |
| begin_date | string | Trade begin date |
| close_date | string | Trade close date |
curl -H "X-API-Key: YOUR_KEY" \
"https://asharehub.com/v1/market/holder-trade?ts_code=000001.SZ&limit=5"
Concepts
Concept/theme sector indices (AI, new energy, semiconductors, etc.).
GET /v1/market/concepts
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| ts_code | string | No | Concept code, e.g. BK0425.DC |
| start_date | string | No | Start date (YYYY-MM-DD) |
| end_date | string | No | End date (YYYY-MM-DD) |
| limit | int | No | Max rows (default 100, max 5000) |
| offset | int | No | Pagination offset (default 0) |
Response Fields
| Field | Type | Description |
|---|---|---|
| ts_code | string | Concept code (e.g. BK0425.DC) |
| trade_date | string | Trading date |
| name | string | Concept name |
| leading | string | Leading stock name |
| leading_code | string | Leading stock code |
| pct_change | number | Daily return % |
| leading_pct | number | Leading stock return % |
| total_mv | number | Total market value (10k CNY) |
| turnover_rate | number | Turnover rate |
| up_num | number | Number of stocks up |
| down_num | number | Number of stocks down |
| idx_type | string | Index type |
| level | string | Level |
curl -H "X-API-Key: YOUR_KEY" \
"https://asharehub.com/v1/market/concepts?start_date=2024-01-01&end_date=2024-01-31&limit=5"
Concept Members
Constituent stocks of concept/theme indices.
GET /v1/market/concept-members
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| ts_code | string | No | Concept index code |
| con_code | string | No | Constituent stock code |
| start_date | string | No | Start date (YYYY-MM-DD) |
| end_date | string | No | End date (YYYY-MM-DD) |
| limit | int | No | Max rows (default 100, max 5000) |
| offset | int | No | Pagination offset (default 0) |
Response Fields
| Field | Type | Description |
|---|---|---|
| trade_date | string | Trading date |
| ts_code | string | Concept index code |
| con_code | string | Constituent stock code |
| name | string | Stock name |
curl -H "X-API-Key: YOUR_KEY" \
"https://asharehub.com/v1/market/concept-members?ts_code=BK0425.DC&limit=10"
Adjustment Factor
Daily adjustment factors for calculating forward/backward adjusted prices. Essential for accurate historical price analysis across splits and dividends.
GET /v1/market/adj-factor
Parameters
ts_code, start_date, end_date, limit (max 5000), offset
Response Fields
| Field | Type | Description |
|---|---|---|
| ts_code | string | Stock code |
| trade_date | string | Trading date |
| adj_factor | number | Adjustment factor |
curl -H "X-API-Key: YOUR_KEY" \
"https://asharehub.com/v1/market/adj-factor?ts_code=000001.SZ&start_date=2024-01-01&limit=5"
Technical Factors
Daily technical indicators (MACD, KDJ, RSI, Bollinger Bands, CCI) and forward/backward adjusted prices.
GET /v1/market/technical-factors
Parameters
ts_code, start_date, end_date, limit (max 5000), offset
Key Response Fields
| Field | Description |
|---|---|
| close_qfq / close_hfq | Forward / backward adjusted close price |
| macd_dif, macd_dea, macd | MACD indicator (DIF, DEA, histogram) |
| kdj_k, kdj_d, kdj_j | KDJ oscillator |
| rsi_6, rsi_12, rsi_24 | RSI (6/12/24 period) |
| boll_upper, boll_mid, boll_lower | Bollinger Bands |
| cci | Commodity Channel Index |
curl -H "X-API-Key: YOUR_KEY" \
"https://asharehub.com/v1/market/technical-factors?ts_code=000001.SZ&start_date=2024-01-01&limit=5"
Technical Factors Pro
Professional-grade technical indicators — 200+ columns per row. Beyond MACD/KDJ/RSI/BOLL/CCI, includes MA, EMA, DMI, ATR, OBV, TRIX, MFI, BBI, BIAS, BRAR, CR, ROC, PSY, WR, ASI and more. Every indicator ships in unadjusted (_bfq), forward-adjusted (_qfq) and backward-adjusted (_hfq) variants.
GET /v1/market/technical-factors-pro
Parameters
ts_code, start_date, end_date, limit (max 5000), offset
Key Response Fields
| Field | Description |
|---|---|
| close_qfq / close_hfq | Forward / backward adjusted close price |
| ma_qfq_5 / ma_qfq_10 / ma_qfq_20 | Simple moving averages (forward-adjusted) |
| ema_qfq_5 / ema_qfq_12 / ema_qfq_26 | Exponential moving averages (forward-adjusted) |
| macd_dif_qfq, macd_dea_qfq, macd_qfq | MACD (forward-adjusted) |
| rsi_qfq_6 / rsi_qfq_12 / rsi_qfq_24 | RSI (forward-adjusted) |
| _bfq / _qfq / _hfq | Each indicator in 3 variants — unadjusted / forward / backward |
curl -H "X-API-Key: YOUR_KEY" \
"https://asharehub.com/v1/market/technical-factors-pro?ts_code=000001.SZ&limit=1"
Limit List
Daily limit-up and limit-down stocks. A-share stocks have ±10% (±20% for ChiNext/STAR) daily price limits.
GET /v1/market/limit-list
Parameters
ts_code, start_date, end_date, limit_type (U=up, D=down, Z=broken), limit (max 5000), offset
Key Response Fields
| Field | Description |
|---|---|
| ts_code / name | Stock code and name |
| close / pct_chg | Closing price and change % |
| first_time / last_time | First/last limit hit time |
| open_times | Times limit was broken |
| limit_times | Consecutive limit days |
| limit | Type: U=up, D=down, Z=broken |
curl -H "X-API-Key: YOUR_KEY" \
"https://asharehub.com/v1/market/limit-list?limit_type=U&start_date=2024-03-01&limit=10"
Northbound Capital Flows
Daily northbound capital flows via Stock Connect (Shanghai & Shenzhen). A key indicator of foreign investor sentiment toward A-shares.
GET /v1/flows/moneyflow-hsgt
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| start_date | string | No | Start date (YYYY-MM-DD) |
| end_date | string | No | End date (YYYY-MM-DD) |
| limit | int | No | Max rows (default 100, max 1000) |
| offset | int | No | Pagination offset |
Response Fields
| Field | Type | Description |
|---|---|---|
| trade_date | string | Trading date |
| north_money | number | Total northbound net buy (CNY million) |
| south_money | number | Total southbound net buy (CNY million) |
| ggt_ss | number | Shanghai Connect northbound (CNY million) |
| ggt_sz | number | Shenzhen Connect northbound (CNY million) |
curl -H "X-API-Key: YOUR_KEY" \
"https://asharehub.com/v1/flows/moneyflow-hsgt?start_date=2024-01-01&end_date=2024-01-31"
Money Flow
Individual stock money flow by order size.
GET /v1/flows/moneyflow
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| ts_code | string | No | Stock code, e.g. 000001.SZ |
| start_date | string | No | Start date (YYYY-MM-DD) |
| end_date | string | No | End date (YYYY-MM-DD) |
| limit | int | No | Max rows (default 100, max 5000) |
| offset | int | No | Pagination offset (default 0) |
Key Response Fields
| Field | Type | Description |
|---|---|---|
| ts_code | string | Stock code |
| trade_date | string | Trading date |
| buy_sm_vol / buy_sm_amount | number | Small order buy (<50K) |
| sell_sm_vol / sell_sm_amount | number | Small order sell |
| buy_md_vol / buy_md_amount | number | Medium order buy (50K–200K) |
| sell_md_vol / sell_md_amount | number | Medium order sell |
| buy_lg_vol / buy_lg_amount | number | Large order buy (200K–1M) |
| sell_lg_vol / sell_lg_amount | number | Large order sell |
| buy_elg_vol / buy_elg_amount | number | Extra-large order buy (>=1M) |
| sell_elg_vol / sell_elg_amount | number | Extra-large order sell |
| net_mf_vol | number | Net money flow volume |
| net_mf_amount | number | Net money flow (10k CNY) |
curl -H "X-API-Key: YOUR_KEY" \
"https://asharehub.com/v1/flows/moneyflow?ts_code=000001.SZ&start_date=2024-01-01&limit=5"
Northbound Holdings
Northbound (foreign) investor holdings per stock.
GET /v1/flows/northbound-holdings
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| ts_code | string | No | Stock code, e.g. 000001.SZ |
| start_date | string | No | Start date (YYYY-MM-DD) |
| end_date | string | No | End date (YYYY-MM-DD) |
| limit | int | No | Max rows (default 100, max 5000) |
| offset | int | No | Pagination offset (default 0) |
Response Fields
| Field | Type | Description |
|---|---|---|
| trade_date | string | Trading date |
| ts_code | string | Stock code |
| name | string | Stock name |
| vol | number | Shares held |
| ratio | number | % of total shares |
| exchange | string | Exchange (SH/SZ) |
curl -H "X-API-Key: YOUR_KEY" \
"https://asharehub.com/v1/flows/northbound-holdings?ts_code=000001.SZ&start_date=2024-01-01&limit=5"
Southbound Holdings
Mainland-held HK stocks via Stock Connect — the mirror of Northbound Holdings. Tracks how much of each HK-listed stock (e.g. Tencent, Meituan, HK-listed Chinese banks) is held by mainland investors, useful for A/H premium signals.
GET /v1/flows/southbound-holdings
Same parameters as Market Daily (ts_code is an HK code, start_date, end_date, limit, offset).
Response Fields
| Field | Description |
|---|---|
| trade_date | Trading date |
| ts_code | HK stock code (e.g. 00700) |
| name | Stock name |
| vol | Shares held by mainland investors |
| ratio | % of total shares outstanding |
| exchange | Connect channel (SH / SZ) |
Financial Indicators
Quarterly financial indicators including ROE, margins, EPS, and 50+ metrics per company.
GET /v1/financials/indicators
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| ts_code | string | Yes | Stock code, e.g. 000001.SZ |
| start_date | string | No | Start date (YYYY-MM-DD) |
| end_date | string | No | End date (YYYY-MM-DD) |
| limit | int | No | Max rows (default 100, max 1000) |
Key Response Fields
| Field | Type | Description |
|---|---|---|
| ts_code | string | Stock code |
| end_date | string | Reporting period end date |
| ann_date | string | Announcement date |
| roe | number | Return on equity (%) |
| eps | number | Earnings per share (CNY) |
| grossprofit_margin | number | Gross profit margin (%) |
| netprofit_margin | number | Net profit margin (%) |
| current_ratio | number | Current ratio |
| debt_to_assets | number | Debt-to-asset ratio (%) |
curl -H "X-API-Key: YOUR_KEY" \
"https://asharehub.com/v1/financials/indicators?ts_code=000001.SZ&limit=4"
Income Statement
Quarterly/annual income statement data. All monetary values in CNY.
GET /v1/financials/income
Parameters
ts_code, start_date, end_date (report period), limit (max 200), offset
Key Response Fields
| Field | Description |
|---|---|
| revenue / total_revenue | Operating / total revenue |
| operate_profit / total_profit | Operating / pre-tax profit |
| n_income / n_income_attr_p | Net income / attributable to parent |
| basic_eps / diluted_eps | Earnings per share |
| sell_exp / admin_exp / fin_exp / rd_exp | Operating expenses breakdown |
| ebit / ebitda | EBIT / EBITDA |
curl -H "X-API-Key: YOUR_KEY" \
"https://asharehub.com/v1/financials/income?ts_code=000001.SZ&start_date=2023-01-01&limit=4"
Balance Sheet
Quarterly/annual balance sheet data. All monetary values in CNY.
GET /v1/financials/balance-sheet
Parameters
ts_code, start_date, end_date (report period), limit (max 200), offset
Key Response Fields
| Field | Description |
|---|---|
| total_assets | Total assets |
| total_liab | Total liabilities |
| total_hldr_eqy_exc_min_int | Equity attributable to parent |
| money_cap | Cash and equivalents |
| accounts_receiv / inventories | Receivables / inventory |
| goodwill / intan_assets | Goodwill / intangible assets |
curl -H "X-API-Key: YOUR_KEY" \
"https://asharehub.com/v1/financials/balance-sheet?ts_code=000001.SZ&limit=4"
Cash Flow Statement
Quarterly/annual cash flow statement. Three sections: operating, investing, and financing activities.
GET /v1/financials/cash-flow
Parameters
ts_code, start_date, end_date (report period), limit (max 200), offset
Key Response Fields
| Field | Description |
|---|---|
| n_cashflow_act | Net operating cash flow |
| n_cashflow_inv_act | Net investing cash flow |
| n_cash_flows_fnc_act | Net financing cash flow |
| free_cashflow | Free cash flow |
| c_cash_equ_end_period | Cash at period end |
curl -H "X-API-Key: YOUR_KEY" \
"https://asharehub.com/v1/financials/cash-flow?ts_code=600519.SH&limit=4"
Earnings Forecast
Earnings forecasts (业绩预告) — early profit guidance disclosures required by exchange rules. Types include significant increase, decrease, turnaround, first loss, etc.
GET /v1/financials/forecast
Parameters
ts_code, start_date, end_date (announcement date), limit (max 1000), offset
Key Response Fields
| Field | Description |
|---|---|
| type | Forecast type (预增/预减/扭亏/首亏/续亏/略增/略减) |
| p_change_min / p_change_max | Net profit change range % |
| net_profit_min / net_profit_max | Forecast net profit range (10k CNY) |
| summary / change_reason | Summary and reason for change |
curl -H "X-API-Key: YOUR_KEY" \
"https://asharehub.com/v1/financials/forecast?ts_code=000001.SZ&limit=5"
Earnings Express
Preliminary earnings flash reports (业绩快报) released before formal financial statements.
GET /v1/financials/express
Parameters
ts_code, start_date, end_date (announcement date), limit (max 1000), offset
Key Response Fields
| Field | Description |
|---|---|
| revenue / n_income | Revenue / net income (CNY) |
| diluted_eps / diluted_roe | Diluted EPS and ROE |
| yoy_net_profit | Net profit YoY growth % |
| perf_summary | Performance summary |
curl -H "X-API-Key: YOUR_KEY" \
"https://asharehub.com/v1/financials/express?ts_code=000001.SZ&limit=5"
Audit Opinions
Annual report audit results — opinion type (unqualified / qualified / disclaimer, etc.), audit firm, signing auditors and audit fees. Annual data only.
GET /v1/financials/audit
Parameters
ts_code, start_date, end_date (report period), limit (max 1000), offset
Key Response Fields
| Field | Description |
|---|---|
| ann_date / end_date | Announcement date / report period end |
| audit_result | Audit opinion type |
| audit_agency | Audit firm |
| audit_sign | Signing auditors |
| audit_fees | Audit fees (CNY) |
Main Business
Main business composition — revenue, cost and profit broken down by product/region segment, to understand what drives a company's business. Disclosed in semi-annual and annual reports.
GET /v1/financials/main-business
Parameters
ts_code, start_date, end_date (report period), limit (max 2000), offset
Key Response Fields
| Field | Description |
|---|---|
| end_date | Report period end |
| bz_item | Business segment name |
| bz_sales | Segment revenue |
| bz_profit | Segment profit |
| bz_cost | Segment cost |
| curr_type | Currency |
Disclosure Date
Financial report disclosure schedule — planned vs. actual disclosure dates per company, useful for scheduling earnings tracking ahead of time.
GET /v1/financials/disclosure-date
Parameters
ts_code, start_date, end_date (report period), limit (max 2000), offset
Key Response Fields
| Field | Description |
|---|---|
| ann_date | Latest announcement date |
| end_date | Report period |
| pre_date | Planned disclosure date |
| actual_date | Actual disclosure date |
| modify_date | Revision date |
Analyst Reports
Sell-side analyst reports and earnings forecasts — report title, brokerage, rating (buy / overweight / neutral / sell), target price, and revenue / net profit / EPS forecasts.
GET /v1/financials/analyst-reports
Parameters
ts_code, start_date, end_date (report date), limit (max 3000), offset
Key Response Fields
| Field | Description |
|---|---|
| report_date / report_title | Report date / title |
| org_name / author_name | Brokerage / analyst |
| rating | Rating (buy / overweight / neutral / sell) |
| max_price / min_price | Target price high / low |
| eps / pe / roe | Forecast EPS / PE / ROE |
| quarter | Forecast period |
Dividend
Cash and stock dividend distribution data. Includes ex-dividend dates, record dates, and payment dates.
GET /v1/shareholders/dividend
Parameters
ts_code, start_date, end_date (announcement date), limit (max 1000), offset
Key Response Fields
| Field | Description |
|---|---|
| cash_div | Cash dividend per share pre-tax (CNY) |
| stk_div | Total stock dividend per share |
| ex_date | Ex-dividend date |
| record_date / pay_date | Record date / payment date |
| div_proc | Progress (预案/实施) |
curl -H "X-API-Key: YOUR_KEY" \
"https://asharehub.com/v1/shareholders/dividend?ts_code=600519.SH&limit=10"
Index Daily
Daily OHLCV data for major Chinese market indices.
GET /v1/indices/daily
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| ts_code | string | No | Index code (default: 000001.SH — SSE Composite) |
| start_date | string | No | Start date (YYYY-MM-DD) |
| end_date | string | No | End date (YYYY-MM-DD) |
| limit | int | No | Max rows (default 100, max 5000) |
Common Index Codes
| Code | Name |
|---|---|
| 000001.SH | SSE Composite (上证综指) |
| 000300.SH | CSI 300 (沪深300) |
| 399001.SZ | SZSE Component (深证成指) |
| 399006.SZ | ChiNext (创业板指) |
| 000016.SH | SSE 50 (上证50) |
curl -H "X-API-Key: YOUR_KEY" \
"https://asharehub.com/v1/indices/daily?ts_code=000300.SH&start_date=2024-01-01&limit=10"
Index Weight
Constituent stock weights for major indices. Useful for tracking index rebalancing and passive fund flows.
GET /v1/indices/index-weight
Parameters
index_code (e.g. 399300.SZ), start_date, end_date, limit (max 5000), offset
Response Fields
| Field | Type | Description |
|---|---|---|
| index_code | string | Index code |
| trade_date | string | Effective date |
| con_code | string | Constituent stock code |
| weight | number | Weight in index % |
curl -H "X-API-Key: YOUR_KEY" \
"https://asharehub.com/v1/indices/index-weight?index_code=399300.SZ&limit=10"
Chip Distribution
Cost distribution and winner rates — unique A-share market microstructure data showing the percentage of shareholders in profit at various price levels.
GET /v1/chips/distribution
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| ts_code | string | No | Stock code, e.g. 000001.SZ |
| start_date | string | No | Start date (YYYY-MM-DD) |
| end_date | string | No | End date (YYYY-MM-DD) |
| limit | int | No | Max rows (default 100, max 2000) |
| offset | int | No | Pagination offset |
Response Fields
| Field | Type | Description |
|---|---|---|
| ts_code | string | Stock code |
| trade_date | string | Trading date |
| winner_rate | number | Winner rate (% of shareholders in profit) |
| weight_avg | number | Weighted average cost |
| cost_5pct | number | 5th percentile cost |
| cost_25pct | number | 25th percentile cost |
| cost_50pct | number | Median cost |
| cost_75pct | number | 75th percentile cost |
| cost_95pct | number | 95th percentile cost |
FX Rates
Daily foreign exchange rates with bid/ask prices. Default pair is USD/CNH — essential for cross-border portfolio valuation.
GET /v1/fx/daily
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| ts_code | string | No | Currency pair (default: USDCNH.FXCM) |
| start_date | string | No | Start date (YYYY-MM-DD) |
| end_date | string | No | End date (YYYY-MM-DD) |
| limit | int | No | Max rows (default 100, max 5000) |
| offset | int | No | Pagination offset |
Response Fields
| Field | Type | Description |
|---|---|---|
| ts_code | string | Currency pair code |
| trade_date | string | Trading date |
| bid_open | number | Bid opening price |
| bid_close | number | Bid closing price |
| bid_high | number | Bid highest price |
| bid_low | number | Bid lowest price |
| ask_open | number | Ask opening price |
| ask_close | number | Ask closing price |
curl -H "X-API-Key: YOUR_KEY" \
"https://asharehub.com/v1/fx/daily?start_date=2024-01-01&end_date=2024-01-31&limit=5"
Stock List
A-share stock list with basic reference info.
GET /v1/reference/stocks
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| ts_code | string | No | Stock code, e.g. 000001.SZ |
| limit | int | No | Max rows (default 100, max 5000) |
| offset | int | No | Pagination offset (default 0) |
Response Fields
| Field | Type | Description |
|---|---|---|
| ts_code | string | Stock code |
| symbol | string | Symbol |
| name | string | Stock name |
| area | string | Region |
| industry | string | Industry |
| fullname | string | Full company name |
| enname | string | English name |
| cnspell | string | Chinese pinyin abbreviation |
| market | string | Market |
| exchange | string | Exchange |
| curr_type | string | Currency type |
| list_status | string | L=listed, D=delisted, P=paused |
| list_date | string | Listing date |
| delist_date | string | Delisting date |
| is_hs | string | Stock Connect: H/S/N |
curl -H "X-API-Key: YOUR_KEY" \
"https://asharehub.com/v1/reference/stocks?limit=10"
Industries
Shenwan 3-level industry classification (SW2021).
GET /v1/reference/industries
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| ts_code | string | No | Stock code, e.g. 000001.SZ |
| limit | int | No | Max rows (default 100, max 5000) |
| offset | int | No | Pagination offset (default 0) |
Response Fields
| Field | Type | Description |
|---|---|---|
| ts_code | string | Stock code |
| name | string | Stock name |
| l1_code | string | L1 industry code |
| l1_name | string | L1 industry name (31 industries) |
| l2_code | string | L2 industry code |
| l2_name | string | L2 industry name |
| l3_code | string | L3 industry code |
| l3_name | string | L3 industry name |
curl -H "X-API-Key: YOUR_KEY" \
"https://asharehub.com/v1/reference/industries?ts_code=000001.SZ"
Trade Calendar
Trading calendar for Shanghai (SSE) and Shenzhen (SZSE) exchanges. Useful for scheduling data pulls and handling holidays.
GET /v1/reference/trade-calendar
Parameters
exchange (SSE/SZSE), start_date, end_date, is_open (1=trading days, 0=closed), limit (max 5000), offset
Response Fields
| Field | Type | Description |
|---|---|---|
| exchange | string | Exchange code (SSE / SZSE) |
| cal_date | string | Calendar date |
| is_open | int | 1=trading day, 0=closed |
| pretrade_date | string | Previous trading date |
curl -H "X-API-Key: YOUR_KEY" \
"https://asharehub.com/v1/reference/trade-calendar?exchange=SSE&is_open=1&start_date=2024-01-01&limit=20"
Python SDK
The official Python SDK wraps all API endpoints and returns pandas DataFrames.
Installation
pip install asharehub
Requires Python 3.8+. Dependencies: httpx, pydantic.
SDK Usage Examples
Initialize the client:
from asharehub import AShareHub
client = AShareHub(api_key="ash_your_key_here")
Fetch daily prices:
df = client.market_daily(ts_code="000001.SZ", start_date="2024-01-01", end_date="2024-03-31")
print(df.head())
Fetch northbound capital flows:
flows = client.moneyflow_hsgt(start_date="2024-01-01", end_date="2024-01-31")
print(flows[["trade_date", "north_money"]].head())
Fetch financial indicators:
fina = client.financial_indicators(ts_code="000001.SZ")
print(fina[["end_date", "roe", "grossprofit_margin", "eps"]].head())
All available methods:
| Method | Endpoint | Description |
|---|---|---|
| market_daily() | /v1/market/daily | Daily OHLCV prices |
| fundamentals() | /v1/market/fundamentals | PE, PB, turnover, market cap |
| adj_factor() | /v1/market/adj-factor | Price adjustment factor |
| technical_factors() | /v1/market/technical-factors | MACD, KDJ, RSI, BOLL, CCI |
| technical_factors_pro() | /v1/market/technical-factors-pro | 200+ technical indicators |
| margin() | /v1/market/margin | Margin trading detail |
| block_trade() | /v1/market/block-trade | Block trade with buyer/seller |
| top_list() | /v1/market/top-list | Dragon & Tiger list |
| top_inst() | /v1/market/top-inst | Dragon & Tiger institutional seats |
| shareholders() | /v1/market/shareholders | Shareholder count |
| holder_trade() | /v1/market/holder-trade | Major shareholder trades |
| concepts() | /v1/market/concepts | Concept sector indices |
| concept_members() | /v1/market/concept-members | Concept constituents |
| limit_list() | /v1/market/limit-list | Limit up/down stocks |
| moneyflow_hsgt() | /v1/flows/moneyflow-hsgt | Stock Connect capital flows |
| moneyflow() | /v1/flows/moneyflow | Per-stock money flow |
| northbound_holdings() | /v1/flows/northbound-holdings | Foreign investor holdings |
| southbound_holdings() | /v1/flows/southbound-holdings | Mainland-held HK stocks |
| chip_distribution() | /v1/chips/distribution | Cost distribution & winner rates |
| fx_daily() | /v1/fx/daily | FX rates (default USD/CNH) |
| index_daily() | /v1/indices/daily | Index OHLCV data |
| index_weight() | /v1/indices/index-weight | Index constituent weights |
| financial_indicators() | /v1/financials/indicators | 50+ quarterly financial metrics |
| income() | /v1/financials/income | Income statement |
| balance_sheet() | /v1/financials/balance-sheet | Balance sheet |
| cash_flow() | /v1/financials/cash-flow | Cash flow statement |
| forecast() | /v1/financials/forecast | Earnings forecast |
| express() | /v1/financials/express | Earnings express |
| audit() | /v1/financials/audit | Audit opinions |
| main_business() | /v1/financials/main-business | Main business composition |
| disclosure_date() | /v1/financials/disclosure-date | Disclosure schedule |
| analyst_reports() | /v1/financials/analyst-reports | Analyst reports & forecasts |
| dividend() | /v1/shareholders/dividend | Dividend distribution |
| stock_list() | /v1/reference/stocks | A-share stock list |
| industry_list() | /v1/reference/industries | Shenwan industry classification |
| trade_calendar() | /v1/reference/trade-calendar | SSE/SZSE trading calendar |
MCP — Cloud Hosted
AShareHub provides a cloud-hosted Model Context Protocol server. No local installation required — just point your MCP client to our endpoint.
Connection URL
Client Configuration
Claude Desktop / Claude Code
{
"mcpServers": {
"asharehub": {
"url": "https://asharehub.com/mcp/sse?api_key=ash_your_key"
}
}
}
Cursor
{
"mcpServers": {
"asharehub": {
"url": "https://asharehub.com/mcp/sse?api_key=ash_your_key"
}
}
}
Windsurf
{
"mcpServers": {
"asharehub": {
"serverUrl": "https://asharehub.com/mcp/sse?api_key=ash_your_key"
}
}
}
MCP — Available Tools (38)
All 37 API endpoints are available as MCP tools. Each tool returns JSON data.
| Tool | Description |
|---|---|
| get_realtime | Real-time intraday quote snapshot |
| get_news_flash | Real-time financial news flash |
| get_market_daily | Daily OHLC prices |
| get_fundamentals | PE, PB, turnover, market cap |
| get_adj_factor | Price adjustment factor |
| get_technical_factors | MACD, KDJ, RSI, BOLL, CCI |
| get_technical_factors_pro | 200+ technical indicators |
| get_margin | Margin trading detail |
| get_block_trade | Block trade with buyer/seller |
| get_top_list | Dragon & Tiger list |
| get_top_inst | Dragon & Tiger institutional seats |
| get_shareholders | Shareholder count |
| get_holder_trade | Major shareholder trades |
| get_concepts | Concept sector indices |
| get_concept_members | Concept constituents |
| get_limit_list | Limit up/down stocks |
| get_moneyflow_hsgt | Stock Connect capital flows |
| get_moneyflow | Per-stock money flow |
| get_northbound_holdings | Foreign investor holdings |
| get_southbound_holdings | Mainland-held HK stocks |
| get_chip_distribution | Cost basis & winner rate |
| get_fx_daily | FX rates (USD/CNH) |
| get_index_daily | Index OHLC data |
| get_index_weight | Index constituent weights |
| get_financial_indicators | 50+ quarterly financial metrics |
| get_income | Income statement |
| get_balance_sheet | Balance sheet |
| get_cash_flow | Cash flow statement |
| get_forecast | Earnings forecast |
| get_express | Earnings express |
| get_audit | Audit opinions |
| get_main_business | Main business composition |
| get_disclosure_date | Disclosure schedule |
| get_analyst_reports | Analyst reports & forecasts |
| get_dividend | Dividend distribution |
| get_stock_list | A-share stock list |
| get_industry_list | Shenwan industry classification |
| get_trade_calendar | SSE/SZSE trading calendar |