Double 11 annual ¥1,699/yrView
Data in 3 steps

Quick start

Two ways in: one curl call, or the official SDK — two lines to a DataFrame. Neither needs an approval process.

1Get a key

Free endpoints work without a key. For everything else, get a key (see pricing).

# Free endpoints, no key needed
curl "https://api.ashareapi.com/v1/quote?code=sh600667"
2Call with your key

The Authorization header is recommended (keeps the key out of logs); a ?key= URL parameter also works and is handy for a quick browser test.

# Option A (recommended — use this in scripts / production): request header
curl -H "Authorization: Bearer ct-your-key" \
  "https://api.ashareapi.com/v1/fund?code=sh600667"

# Option B (quick test only): URL parameter — paste it straight into a browser
curl "https://api.ashareapi.com/v1/fund?code=sh600667&key=ct-your-key"
3Read the response

One JSON envelope: ok / endpoint / tier / elapsed_ms / source / data

{
  "ok": true,
  "endpoint": "fund",
  "tier": "pro",
  "elapsed_ms": 862,
  "source": "multi",
  "data": { "main_net": "...", "lhb": [...], ... }
}
Use the official SDK: two lines to a DataFrame

Official packages for Python and Node.js / TypeScript. Same response shape as REST, ready to drop into your scripts, dashboards or strategy code.

Pythonpip install ashareapi
from ashareapi import AShareAPI

cli = AShareAPI()                     # free endpoints need no key
df  = cli.kline("sh600519", "day", 30)
Node.jsnpm install ashareapi
import { AShareAPI } from 'ashareapi'

const cli  = new AShareAPI()          // free endpoints need no key
const rows = await cli.kline('sh600519', 'day', 30)
Use a lowercase market prefix

sh600519 (Shanghai) · sz000001 (Shenzhen) · bj920002 (Beijing) · hk00700 (Hong Kong) · usAAPL (US). Writing 600519, 600519.SH or uppercase SH600519 returns empty data.

Code format reference
Need the full set?

Paid tiers unlock all 102 endpoints, up to 1212 bars per call, and no daily cap.

See pricing

Error codes

Check this table first — most problems you can solve yourself.

401
Invalid API key
Key mistyped or disabled → check it; or you called a paid endpoint without a key
403
This key already used N different IPs today
Anti-resale limit hit → if a network change caused it, contact us to reset
429
Rate limit exceeded (per minute), or a daily endpoint cap is used up
Slow down or add a delay; if the body carries heavy_limit, that endpoint hit its daily cap and resets at 00:00 (UTC+8)
200 + ok:false
Upstream fetch failed
We already switched sources and do not count these calls; if it persists, tell us (endpoint + time)

Integration guides

Connect your AI Agent (MCP)

One config block lets Claude Code / Codex and other agents query A-share data

View
Agent Skill (45+ clients)

One folder installs into Claude Code / Cursor / Codex and more

View
China platforms (Doubao / Bailian / Coze, etc.)

Checked against each platform docs — just paste the URL

View
AI crawler list & verification

International + China crawlers, official IP ranges / rDNS checks, common blocking mistakes

View
Migrating from Tushare

Endpoint mapping, four-step rewrite, field mapping (including what cannot move)

View
Migrating from Eastmoney

secid / klt / fqt mapping, kline field map, and the six places the data differs

View
Tutorials & guides

Runnable Python (and more) with trade-offs and boundaries

View
Daily A-share report

Pre-market / midday / post-close summaries, Markdown version included

View
Call from Python

Sample code lives in the endpoint reference

View
Data source status

What is available right now — public

View
Want the full endpoint list?

Parameters plus curl / Python / JS samples for all 102 endpoints, on one page.

Endpoint reference