> Source: https://ashareapi.com/en/endpoints/  ·  Markdown version for LLMs / AI agents

32 endpoints

# Endpoint reference
 Groups: Free 7 · Pro 25. Parameters and curl / Python / JS samples.
 `/openapi.json` · live · 2026-10-03

## Free 7
 GET `/v1/health` Health check [Open this endpoint →](/en/docs/endpoints/health)
 Checks service status and whether both data CLIs are ready.
 curl

 ```
# 免费端点：无需 API Key（匿名即可调用）
curl "https://api.ashareapi.com/v1/health"
```
 Python

 ```
import requests

r = requests.get(
 "https://api.ashareapi.com/v1/health",
 params={},
 timeout=30,
)
print(r.json())
```
 JavaScript

 ```
const r = await fetch("https://api.ashareapi.com/v1/health");
console.log(await r.json());
```

 GET `/v1/challenge` 获取 PoW 挑战（匿名提额用） [Open this endpoint →](/en/docs/endpoints/challenge)
 匿名请求超限（429）时也会直接返回同一份挑战。解出 nonce 后带 `X-PoW: . ` 请求，匿名配额从 5 次/分提升到 60 次/分。付费 Key 用户无需使用。
 |
| | Parameter | Type | Required | Description

| | difficulty | integer | No | 自定义难度（前导 0 位数），0=服务端默认

 `difficulty` integer
 自定义难度（前导 0 位数），0=服务端默认

 curl

 ```
# 免费端点：无需 API Key（匿名即可调用）
curl "https://api.ashareapi.com/v1/challenge?difficulty=0"
```
 Python

 ```
import requests

r = requests.get(
 "https://api.ashareapi.com/v1/challenge",
 params={},
 timeout=30,
)
print(r.json())
```
 JavaScript

 ```
const r = await fetch("https://api.ashareapi.com/v1/challenge?difficulty=0");
console.log(await r.json());
```

 GET `/v1/quote` Real-time quote [Open this endpoint →](/en/docs/endpoints/quote)
 Real-time quote for A-shares, HK and US (lightweight, 8 fields): last price, open/high/low, volume, amount, turnover rate. ⚠️ `data` is an ARRAY (30 daily bars by default, `data[0]` is the latest) — read the current price from `data[0].last`. ⚠️ The turnover rate field is named `turnover` (in %) — the **same name and value** as `/v1/snapshot` (e.g. sz000001 = 0.54 in both). ⚠️ **Renamed 2026-09-26**: it used to be `exchange`, an upstream name that reads like "exchange" the venue. ⚠️ Does NOT include valuation / market cap — use /v1/snapshot for those (35 fields, pro tier, A-shares only).
 |
| | Parameter | Type | Required | Description

| | code | string | Yes | Stock code with market prefix: sh600667 (SH), sz000001 (SZ), hk00700 (HK), usAAPL (US)

 `code` string Yes
 Stock code with market prefix: sh600667 (SH), sz000001 (SZ), hk00700 (HK), usAAPL (US)

 curl

 ```
# 免费端点：无需 API Key（匿名即可调用）
curl "https://api.ashareapi.com/v1/quote?code=sh600667"
```
 Python

 ```
import requests

r = requests.get(
 "https://api.ashareapi.com/v1/quote",
 params={"code": "sh600667"},
 timeout=30,
)
print(r.json())
```
 JavaScript

 ```
const r = await fetch("https://api.ashareapi.com/v1/quote?code=sh600667");
console.log(await r.json());
```

 GET `/v1/kline` K-line (D/W/M) [Open this endpoint →](/en/docs/endpoints/kline)
 Historical K-line data (daily / weekly / monthly). ⚠️ The turnover rate field is named `turnover` (in %) — same as /v1/quote and /v1/snapshot (renamed from `exchange` on 2026-09-26). ⚠️ The price basis is **fixed at forward-adjusted** (no gap on ex-dividend days; no `adjust` parameter) — **do not re-adjust** (double adjustment).
 |
| | Parameter | Type | Required | Description

| | code | string | Yes | Stock code with market prefix: sh600667 (SH), sz000001 (SZ), hk00700 (HK), usAAPL (US)

| | period | string | No | Period: day / week / month

| | count | integer | No | Number of rows, default 30

 `code` string Yes
 Stock code with market prefix: sh600667 (SH), sz000001 (SZ), hk00700 (HK), usAAPL (US)

 `period` string
 Period: day / week / month

 `count` integer
 Number of rows, default 30

 curl

 ```
# 免费端点：无需 API Key（匿名即可调用）
curl "https://api.ashareapi.com/v1/kline?code=sh600667&period=day"
```
 Python

 ```
import requests

r = requests.get(
 "https://api.ashareapi.com/v1/kline",
 params={"code": "sh600667"},
 timeout=30,
)
print(r.json())
```
 JavaScript

 ```
const r = await fetch("https://api.ashareapi.com/v1/kline?code=sh600667&period=day");
console.log(await r.json());
```

 GET `/v1/hot` Hot list [Open this endpoint →](/en/docs/endpoints/hot)
 Market-wide hot list by attention (A-share / US / ETF) with change %.
 |
| | Parameter | Type | Required | Description

| | limit | integer | No | Number of rows, default 30

 `limit` integer
 Number of rows, default 30

 curl

 ```
# 免费端点：无需 API Key（匿名即可调用）
curl "https://api.ashareapi.com/v1/hot?limit=10"
```
 Python

 ```
import requests

r = requests.get(
 "https://api.ashareapi.com/v1/hot",
 params={},
 timeout=30,
)
print(r.json())
```
 JavaScript

 ```
const r = await fetch("https://api.ashareapi.com/v1/hot?limit=10");
console.log(await r.json());
```

 GET `/v1/market-overview` Market overview [Open this endpoint →](/en/docs/endpoints/market-overview)
 Market-level picture. type = summary / trade / interval / technical / margin / valuation / rotation. ⚠️ type=updown (up/down distribution) is T-1: the response carries its own data date and can lag one trading day — for the current session use /v1/changedist (the two will not match).
 |
| | Parameter | Type | Required | Description

| | type | string | No | Type: summary / trade / interval / technical / margin / valuation / rotation (updown is T-1; use /v1/changedist for current breadth)

 `type` string
 Type: summary / trade / interval / technical / margin / valuation / rotation (updown is T-1; use /v1/changedist for current breadth)

 curl

 ```
# 免费端点：无需 API Key（匿名即可调用）
curl "https://api.ashareapi.com/v1/market-overview?type=institution"
```
 Python

 ```
import requests

r = requests.get(
 "https://api.ashareapi.com/v1/market-overview",
 params={},
 timeout=30,
)
print(r.json())
```
 JavaScript

 ```
const r = await fetch("https://api.ashareapi.com/v1/market-overview?type=institution");
console.log(await r.json());
```

 GET `/v1/changedist` Up/down distribution [Open this endpoint →](/en/docs/endpoints/changedist)
 Advancers, decliners, limit-ups and limit-downs plus turnover — market breadth and sentiment (current session). This is the recommended entry point for breadth; do not use /v1/market-overview?type=updown for the same figures (that one is T-1 and will not match).
 curl

 ```
# 免费端点：无需 API Key（匿名即可调用）
curl "https://api.ashareapi.com/v1/changedist"
```
 Python

 ```
import requests

r = requests.get(
 "https://api.ashareapi.com/v1/changedist",
 params={},
 timeout=30,
)
print(r.json())
```
 JavaScript

 ```
const r = await fetch("https://api.ashareapi.com/v1/changedist");
console.log(await r.json());
```

## Pro 25
 GET `/v1/finance` Financial statements [Open this endpoint →](/en/docs/endpoints/finance)
 Three statements: income, balance sheet, cash flow (multi-period, the latest N periods). ⚠️ `data` is a LIST OF TABLES: `data[0]`=income · `data[1]`=balance sheet · `data[2]`=cash flow; each table is `[{EndDate: …, field: …}]` in DESCENDING period order (latest first).
 |
| | Parameter | Type | Required | Description

| | code | string | Yes | Stock code with market prefix: sh600667 (SH), sz000001 (SZ), hk00700 (HK), usAAPL (US)

| | num | integer | No | Number of periods, default 4 (the latest N periods, descending)

 `code` string Yes
 Stock code with market prefix: sh600667 (SH), sz000001 (SZ), hk00700 (HK), usAAPL (US)

 `num` integer
 Number of periods, default 4 (the latest N periods, descending)

 curl

 ```
# 推荐：Authorization 头（密钥不进日志）
curl -H "Authorization: Bearer YOUR_KEY" \
 "https://api.ashareapi.com/v1/finance?code=sh600667&num=4"

# 快速测试：直接浏览器打开（?key= 会留在日志/历史里，别用于生产）
curl "https://api.ashareapi.com/v1/finance?code=sh600667&num=4&key=YOUR_KEY"
```
 Python

 ```
import requests

r = requests.get(
 "https://api.ashareapi.com/v1/finance",
 headers={"Authorization": "Bearer YOUR_KEY"},
 params={"code": "sh600667"},
 timeout=30,
)
print(r.json())
```
 JavaScript

 ```
const r = await fetch("https://api.ashareapi.com/v1/finance?code=sh600667&num=4", {
 headers: { Authorization: "Bearer YOUR_KEY" },
});
console.log(await r.json());
```

 GET `/v1/fund` Money flow + boards + margin [Open this endpoint →](/en/docs/endpoints/fund)
 Everything trading-side in one call: main money flow (+ market rank), top-trader boards, block trades, margin trading.
 |
| | Parameter | Type | Required | Description

| | code | string | Yes | Stock code with market prefix: sh600667 (SH), sz000001 (SZ), hk00700 (HK), usAAPL (US)

 `code` string Yes
 Stock code with market prefix: sh600667 (SH), sz000001 (SZ), hk00700 (HK), usAAPL (US)

 curl

 ```
# 推荐：Authorization 头（密钥不进日志）
curl -H "Authorization: Bearer YOUR_KEY" \
 "https://api.ashareapi.com/v1/fund?code=sh600667"

# 快速测试：直接浏览器打开（?key= 会留在日志/历史里，别用于生产）
curl "https://api.ashareapi.com/v1/fund?code=sh600667&key=YOUR_KEY"
```
 Python

 ```
import requests

r = requests.get(
 "https://api.ashareapi.com/v1/fund",
 headers={"Authorization": "Bearer YOUR_KEY"},
 params={"code": "sh600667"},
 timeout=30,
)
print(r.json())
```
 JavaScript

 ```
const r = await fetch("https://api.ashareapi.com/v1/fund?code=sh600667", {
 headers: { Authorization: "Bearer YOUR_KEY" },
});
console.log(await r.json());
```

 GET `/v1/technical` Technical indicators [Open this endpoint →](/en/docs/endpoints/technical)
 MA / MACD / KDJ / RSI / BOLL.
 |
| | Parameter | Type | Required | Description

| | code | string | Yes | Stock code with market prefix: sh600667 (SH), sz000001 (SZ), hk00700 (HK), usAAPL (US)

 `code` string Yes
 Stock code with market prefix: sh600667 (SH), sz000001 (SZ), hk00700 (HK), usAAPL (US)

 curl

 ```
# 推荐：Authorization 头（密钥不进日志）
curl -H "Authorization: Bearer YOUR_KEY" \
 "https://api.ashareapi.com/v1/technical?code=sh600667"

# 快速测试：直接浏览器打开（?key= 会留在日志/历史里，别用于生产）
curl "https://api.ashareapi.com/v1/technical?code=sh600667&key=YOUR_KEY"
```
 Python

 ```
import requests

r = requests.get(
 "https://api.ashareapi.com/v1/technical",
 headers={"Authorization": "Bearer YOUR_KEY"},
 params={"code": "sh600667"},
 timeout=30,
)
print(r.json())
```
 JavaScript

 ```
const r = await fetch("https://api.ashareapi.com/v1/technical?code=sh600667", {
 headers: { Authorization: "Bearer YOUR_KEY" },
});
console.log(await r.json());
```

 GET `/v1/shareholder` Shareholder research [Open this endpoint →](/en/docs/endpoints/shareholder)
 Shareholder research (sectioned response). ⚠️ `data` is a SECTIONED structure: `data.tables` is an ordered list of sections, each with `title` / `slug` / `rows`; plus `data.data{slug: rows}` as a convenience index. A-shares: `top10_holders` / `top10_float_holders` / `holder_count` (holder counts include totalSHNum / avgHoldShares). HK: `shareholders` / `holder_distribution` / `institutional_holdings` — semantically different from A-shares, do not index by position.
 |
| | Parameter | Type | Required | Description

| | code | string | Yes | Stock code with market prefix: sh600667 (SH), sz000001 (SZ), hk00700 (HK), usAAPL (US)

 `code` string Yes
 Stock code with market prefix: sh600667 (SH), sz000001 (SZ), hk00700 (HK), usAAPL (US)

 curl

 ```
# 推荐：Authorization 头（密钥不进日志）
curl -H "Authorization: Bearer YOUR_KEY" \
 "https://api.ashareapi.com/v1/shareholder?code=sh600667"

# 快速测试：直接浏览器打开（?key= 会留在日志/历史里，别用于生产）
curl "https://api.ashareapi.com/v1/shareholder?code=sh600667&key=YOUR_KEY"
```
 Python

 ```
import requests

r = requests.get(
 "https://api.ashareapi.com/v1/shareholder",
 headers={"Authorization": "Bearer YOUR_KEY"},
 params={"code": "sh600667"},
 timeout=30,
)
print(r.json())
```
 JavaScript

 ```
const r = await fetch("https://api.ashareapi.com/v1/shareholder?code=sh600667", {
 headers: { Authorization: "Bearer YOUR_KEY" },
});
console.log(await r.json());
```

 GET `/v1/chip` Chip distribution / cost [Open this endpoint →](/en/docs/endpoints/chip)
 Chip distribution and holding-cost analysis.
 |
| | Parameter | Type | Required | Description

| | code | string | Yes | Stock code with market prefix: sh600667 (SH), sz000001 (SZ), hk00700 (HK), usAAPL (US)

 `code` string Yes
 Stock code with market prefix: sh600667 (SH), sz000001 (SZ), hk00700 (HK), usAAPL (US)

 curl

 ```
# 推荐：Authorization 头（密钥不进日志）
curl -H "Authorization: Bearer YOUR_KEY" \
 "https://api.ashareapi.com/v1/chip?code=sh600667"

# 快速测试：直接浏览器打开（?key= 会留在日志/历史里，别用于生产）
curl "https://api.ashareapi.com/v1/chip?code=sh600667&key=YOUR_KEY"
```
 Python

 ```
import requests

r = requests.get(
 "https://api.ashareapi.com/v1/chip",
 headers={"Authorization": "Bearer YOUR_KEY"},
 params={"code": "sh600667"},
 timeout=30,
)
print(r.json())
```
 JavaScript

 ```
const r = await fetch("https://api.ashareapi.com/v1/chip?code=sh600667", {
 headers: { Authorization: "Bearer YOUR_KEY" },
});
console.log(await r.json());
```

 GET `/v1/orderbook` 五档盘口（order book · 买五卖五） [Open this endpoint →](/en/docs/endpoints/orderbook)
 **秒级快照**：买一~买五 / 卖一~卖五的**价格与挂单量（手）**，含现价/涨跌/数据时间。字段命名对齐 Tushare 惯例：`b1_p`/`b1_v` ~ `b5_p`/`b5_v` = 买档价格/量，`a1_p`/`a1_v` ~ `a5_p`/`a5_v` = 卖档（**扁平列，pandas 直接取 `df['b1_p']`**）。用途：看封单强度、买卖压力、盘中支撑压力位。⚠️ **盘中才有意义**（收盘后为当日最后快照）；数据约 10 秒刷新一次。⚠️ 量单位是**手**（×100 = 股）；**跌停时买档全 0 / 涨停时卖档全 0**（正常现象）。
 |
| | Parameter | Type | Required | Description

| | code | string | Yes | Stock code with market prefix: sh600667 (SH), sz000001 (SZ), hk00700 (HK), usAAPL (US)

 `code` string Yes
 Stock code with market prefix: sh600667 (SH), sz000001 (SZ), hk00700 (HK), usAAPL (US)

 curl

 ```
# 推荐：Authorization 头（密钥不进日志）
curl -H "Authorization: Bearer YOUR_KEY" \
 "https://api.ashareapi.com/v1/orderbook?code=sh600667"

# 快速测试：直接浏览器打开（?key= 会留在日志/历史里，别用于生产）
curl "https://api.ashareapi.com/v1/orderbook?code=sh600667&key=YOUR_KEY"
```
 Python

 ```
import requests

r = requests.get(
 "https://api.ashareapi.com/v1/orderbook",
 headers={"Authorization": "Bearer YOUR_KEY"},
 params={"code": "sh600667"},
 timeout=30,
)
print(r.json())
```
 JavaScript

 ```
const r = await fetch("https://api.ashareapi.com/v1/orderbook?code=sh600667", {
 headers: { Authorization: "Bearer YOUR_KEY" },
});
console.log(await r.json());
```

 GET `/v1/snapshot` 全字段行情画像（估值/市值/股本/涨停价） [Open this endpoint →](/en/docs/endpoints/snapshot)
 **一只股票的完整画像**：价格 + 盘口（买五卖五+委差）+ 估值（PE TTM/动/静 + PB） + 市值（流通/总）+ 股本（流通/总）+ 打板（涨停/跌停价 + 量比 + 振幅 + 涨速） + 标识（证券类型/股票状态/币种）+ 外盘/内盘。⚠️ **与 `/v1/quote` 的分工**：quote 轻（8 字段）· 走官方通道 · **免费**；本端点全（35 字段）· **pro 档**。只要现价用 quote 更轻（字段少、响应快）。⚠️ **仅 A 股**（港股/美股字段布局不同，请用 `/v1/quote`）——**传其他市场返回空，不返回错数据**。⚠️ **计费 = 次数**：本端点 1 次拿全 35 字段——**要估值+市值+股本+涨停价多项时，比分别调 quote/valuation/orderbook 更省次数**。⚠️ 单位：`volume` 手 · `amount` 万元 · 市值 亿元 · 股本 股 · 比率/涨幅 百分数。（字段含义见 https://ashareapi.com/docs/）
 |
| | Parameter | Type | Required | Description

| | code | string | Yes | Stock code with market prefix: sh600667 (SH), sz000001 (SZ), hk00700 (HK), usAAPL (US)

 `code` string Yes
 Stock code with market prefix: sh600667 (SH), sz000001 (SZ), hk00700 (HK), usAAPL (US)

 curl

 ```
# 推荐：Authorization 头（密钥不进日志）
curl -H "Authorization: Bearer YOUR_KEY" \
 "https://api.ashareapi.com/v1/snapshot?code=sh600667"

# 快速测试：直接浏览器打开（?key= 会留在日志/历史里，别用于生产）
curl "https://api.ashareapi.com/v1/snapshot?code=sh600667&key=YOUR_KEY"
```
 Python

 ```
import requests

r = requests.get(
 "https://api.ashareapi.com/v1/snapshot",
 headers={"Authorization": "Bearer YOUR_KEY"},
 params={"code": "sh600667"},
 timeout=30,
)
print(r.json())
```
 JavaScript

 ```
const r = await fetch("https://api.ashareapi.com/v1/snapshot?code=sh600667", {
 headers: { Authorization: "Bearer YOUR_KEY" },
});
console.log(await r.json());
```

 GET `/v1/events` Stock event labels (42) [Open this endpoint →](/en/docs/endpoints/events)
 42 event tags per stock: block trades, top-trader boards, buybacks, placements, dividends, earnings, lockups.
 |
| | Parameter | Type | Required | Description

| | code | string | Yes | Stock code with market prefix: sh600667 (SH), sz000001 (SZ), hk00700 (HK), usAAPL (US)

 `code` string Yes
 Stock code with market prefix: sh600667 (SH), sz000001 (SZ), hk00700 (HK), usAAPL (US)

 curl

 ```
# 推荐：Authorization 头（密钥不进日志）
curl -H "Authorization: Bearer YOUR_KEY" \
 "https://api.ashareapi.com/v1/events?code=sh600667"

# 快速测试：直接浏览器打开（?key= 会留在日志/历史里，别用于生产）
curl "https://api.ashareapi.com/v1/events?code=sh600667&key=YOUR_KEY"
```
 Python

 ```
import requests

r = requests.get(
 "https://api.ashareapi.com/v1/events",
 headers={"Authorization": "Bearer YOUR_KEY"},
 params={"code": "sh600667"},
 timeout=30,
)
print(r.json())
```
 JavaScript

 ```
const r = await fetch("https://api.ashareapi.com/v1/events?code=sh600667", {
 headers: { Authorization: "Bearer YOUR_KEY" },
});
console.log(await r.json());
```

 GET `/v1/lhb` Top-trader boards (split) [Open this endpoint →](/en/docs/endpoints/lhb)
 Top-trader boards by type: institution / hot money / active seats.
 |
| | Parameter | Type | Required | Description

| | type | string | No | Type: summary / trade / interval / technical / margin / valuation / rotation (updown is T-1; use /v1/changedist for current breadth)

| | date | string | No | Date YYYY-MM-DD (blank = latest trading day)

 `type` string
 Type: summary / trade / interval / technical / margin / valuation / rotation (updown is T-1; use /v1/changedist for current breadth)

 `date` string
 Date YYYY-MM-DD (blank = latest trading day)

 curl

 ```
# 推荐：Authorization 头（密钥不进日志）
curl -H "Authorization: Bearer YOUR_KEY" \
 "https://api.ashareapi.com/v1/lhb?type=institution"

# 快速测试：直接浏览器打开（?key= 会留在日志/历史里，别用于生产）
curl "https://api.ashareapi.com/v1/lhb?type=institution&key=YOUR_KEY"
```
 Python

 ```
import requests

r = requests.get(
 "https://api.ashareapi.com/v1/lhb",
 headers={"Authorization": "Bearer YOUR_KEY"},
 params={},
 timeout=30,
)
print(r.json())
```
 JavaScript

 ```
const r = await fetch("https://api.ashareapi.com/v1/lhb?type=institution", {
 headers: { Authorization: "Bearer YOUR_KEY" },
});
console.log(await r.json());
```

 GET `/v1/screen` Factor screening [Open this endpoint →](/en/docs/endpoints/screen)
 Screen the whole market with a factor expression, e.g. intersect([PE_TTM > 0, PE_TTM 15]).
 |
| | Parameter | Type | Required | Description

| | expr | string | No | Factor expression, e.g. intersect([PE_TTM > 0, PE_TTM 15])

| | preset | string | No | Preset name (alternative to expr): LowPE / LowPB / HighDividend / PEG / HighROE, and 17 more

| | limit | integer | No | Number of rows, default 30

| | orderby | string | No | Sort field (e.g. ROETTM)

| | desc | boolean | No | True = descending, False = ascending

| | market | string | No | Market: hs (A-share) / hk / us (blank = A-share)

 `expr` string
 Factor expression, e.g. intersect([PE_TTM > 0, PE_TTM 15])

 `preset` string
 Preset name (alternative to expr): LowPE / LowPB / HighDividend / PEG / HighROE, and 17 more

 `limit` integer
 Number of rows, default 30

 `orderby` string
 Sort field (e.g. ROETTM)

 `desc` boolean
 True = descending, False = ascending

 `market` string
 Market: hs (A-share) / hk / us (blank = A-share)

 curl

 ```
# 注：expr 的值已做 URL 编码（含 [ ] 空格 等）
# 推荐：Authorization 头（密钥不进日志）
curl -H "Authorization: Bearer YOUR_KEY" \
 "https://api.ashareapi.com/v1/screen?expr=intersect(%5BPE_TTM%20%3E%200%2C%20PE_TTM%20%3C%2020%2C%20ROETTM%20%3E%2015%5D)"

# 快速测试：直接浏览器打开（?key= 会留在日志/历史里，别用于生产）
curl "https://api.ashareapi.com/v1/screen?expr=intersect(%5BPE_TTM%20%3E%200%2C%20PE_TTM%20%3C%2020%2C%20ROETTM%20%3E%2015%5D)&key=YOUR_KEY"
```
 Python

 ```
import requests

r = requests.get(
 "https://api.ashareapi.com/v1/screen",
 headers={"Authorization": "Bearer YOUR_KEY"},
 params={},
 timeout=30,
)
print(r.json())
```
 JavaScript

 ```
const r = await fetch("https://api.ashareapi.com/v1/screen?expr=intersect(%5BPE_TTM%20%3E%200%2C%20PE_TTM%20%3C%2020%2C%20ROETTM%20%3E%2015%5D)", {
 headers: { Authorization: "Bearer YOUR_KEY" },
});
console.log(await r.json());
```

 GET `/v1/sector` Sector performance [Open this endpoint →](/en/docs/endpoints/sector)
 Industry / concept / region sector moves, with the leading stock.
 curl

 ```
# 推荐：Authorization 头（密钥不进日志）
curl -H "Authorization: Bearer YOUR_KEY" \
 "https://api.ashareapi.com/v1/sector"

# 快速测试：直接浏览器打开（?key= 会留在日志/历史里，别用于生产）
curl "https://api.ashareapi.com/v1/sector?key=YOUR_KEY"
```
 Python

 ```
import requests

r = requests.get(
 "https://api.ashareapi.com/v1/sector",
 headers={"Authorization": "Bearer YOUR_KEY"},
 params={},
 timeout=30,
)
print(r.json())
```
 JavaScript

 ```
const r = await fetch("https://api.ashareapi.com/v1/sector", {
 headers: { Authorization: "Bearer YOUR_KEY" },
});
console.log(await r.json());
```

 GET `/v1/industry-chain` 产业链（主题/图谱/个股定位） [Open this endpoint →](/en/docs/endpoints/industry-chain)
 A 股产业链数据（**183 个产业链主题**）：mode=list 主题列表 · mode=graph&topic=超级电容 → **产业链图谱**（关联个股 + 所属节点 + 产业链位置 上游/中游/下游）· mode=stock&code=sh600667 → **个股所属产业链**（主题 / 节点 / 位置 / 关联度 / **业务描述**）。用户问『产业链/上下游/某公司处于链上什么位置/这个主题有哪些公司』时用。
 |
| | Parameter | Type | Required | Description

| | mode | string | No | list or detail

| | topic | string | No | 主题名（mode=graph）：如 超级电容 / 集成电路

| | code | string | No | Stock code with market prefix: sh600667 (SH), sz000001 (SZ), hk00700 (HK), usAAPL (US)

 `mode` string
 list or detail

 `topic` string
 主题名（mode=graph）：如 超级电容 / 集成电路

 `code` string
 Stock code with market prefix: sh600667 (SH), sz000001 (SZ), hk00700 (HK), usAAPL (US)

 curl

 ```
# 推荐：Authorization 头（密钥不进日志）
curl -H "Authorization: Bearer YOUR_KEY" \
 "https://api.ashareapi.com/v1/industry-chain?mode=list"

# 快速测试：直接浏览器打开（?key= 会留在日志/历史里，别用于生产）
curl "https://api.ashareapi.com/v1/industry-chain?mode=list&key=YOUR_KEY"
```
 Python

 ```
import requests

r = requests.get(
 "https://api.ashareapi.com/v1/industry-chain",
 headers={"Authorization": "Bearer YOUR_KEY"},
 params={},
 timeout=30,
)
print(r.json())
```
 JavaScript

 ```
const r = await fetch("https://api.ashareapi.com/v1/industry-chain?mode=list", {
 headers: { Authorization: "Bearer YOUR_KEY" },
});
console.log(await r.json());
```

 GET `/v1/sector-valuation` Sector valuation (percentile) [Open this endpoint →](/en/docs/endpoints/sector-valuation)
 Shenwan sector PE/PB/PS/PCF + dividend yield + historical percentile. code like pt01801780.
 |
| | Parameter | Type | Required | Description

| | code | string | Yes | Stock code with market prefix: sh600667 (SH), sz000001 (SZ), hk00700 (HK), usAAPL (US)

 `code` string Yes
 Stock code with market prefix: sh600667 (SH), sz000001 (SZ), hk00700 (HK), usAAPL (US)

 curl

 ```
# 推荐：Authorization 头（密钥不进日志）
curl -H "Authorization: Bearer YOUR_KEY" \
 "https://api.ashareapi.com/v1/sector-valuation?code=sh600667"

# 快速测试：直接浏览器打开（?key= 会留在日志/历史里，别用于生产）
curl "https://api.ashareapi.com/v1/sector-valuation?code=sh600667&key=YOUR_KEY"
```
 Python

 ```
import requests

r = requests.get(
 "https://api.ashareapi.com/v1/sector-valuation",
 headers={"Authorization": "Bearer YOUR_KEY"},
 params={"code": "sh600667"},
 timeout=30,
)
print(r.json())
```
 JavaScript

 ```
const r = await fetch("https://api.ashareapi.com/v1/sector-valuation?code=sh600667", {
 headers: { Authorization: "Bearer YOUR_KEY" },
});
console.log(await r.json());
```

 GET `/v1/macro` Macro data [Open this endpoint →](/en/docs/endpoints/macro)
 Global macro: GDP / CPI / PMI / LPR / treasury yields / fiscal.
 |
| | Parameter | Type | Required | Description

| | region | string | No | Region: cn / us / jp / eu / hk

| | names | string | No | Indicator short names (e.g. cn_gdp / cn_cpi_ppi / cn_lpr / us_inflation); blank = all for that region

 `region` string
 Region: cn / us / jp / eu / hk

 `names` string
 Indicator short names (e.g. cn_gdp / cn_cpi_ppi / cn_lpr / us_inflation); blank = all for that region

 curl

 ```
# 推荐：Authorization 头（密钥不进日志）
curl -H "Authorization: Bearer YOUR_KEY" \
 "https://api.ashareapi.com/v1/macro?region=cn"

# 快速测试：直接浏览器打开（?key= 会留在日志/历史里，别用于生产）
curl "https://api.ashareapi.com/v1/macro?region=cn&key=YOUR_KEY"
```
 Python

 ```
import requests

r = requests.get(
 "https://api.ashareapi.com/v1/macro",
 headers={"Authorization": "Bearer YOUR_KEY"},
 params={},
 timeout=30,
)
print(r.json())
```
 JavaScript

 ```
const r = await fetch("https://api.ashareapi.com/v1/macro?region=cn", {
 headers: { Authorization: "Bearer YOUR_KEY" },
});
console.log(await r.json());
```

 GET `/v1/bond` Convertible bond terms [Open this endpoint →](/en/docs/endpoints/bond)
 Full convertible-bond terms: premium, conversion value, double-low, redemption triggers, rating. code like sh113052.
 |
| | Parameter | Type | Required | Description

| | code | string | Yes | Stock code with market prefix: sh600667 (SH), sz000001 (SZ), hk00700 (HK), usAAPL (US)

 `code` string Yes
 Stock code with market prefix: sh600667 (SH), sz000001 (SZ), hk00700 (HK), usAAPL (US)

 curl

 ```
# 推荐：Authorization 头（密钥不进日志）
curl -H "Authorization: Bearer YOUR_KEY" \
 "https://api.ashareapi.com/v1/bond?code=sh600667"

# 快速测试：直接浏览器打开（?key= 会留在日志/历史里，别用于生产）
curl "https://api.ashareapi.com/v1/bond?code=sh600667&key=YOUR_KEY"
```
 Python

 ```
import requests

r = requests.get(
 "https://api.ashareapi.com/v1/bond",
 headers={"Authorization": "Bearer YOUR_KEY"},
 params={"code": "sh600667"},
 timeout=30,
)
print(r.json())
```
 JavaScript

 ```
const r = await fetch("https://api.ashareapi.com/v1/bond?code=sh600667", {
 headers: { Authorization: "Bearer YOUR_KEY" },
});
console.log(await r.json());
```

 GET `/v1/etf` ETF overview [Open this endpoint →](/en/docs/endpoints/etf)
 ETF quote / size / premium-discount / money flow. code like sh510300.
 |
| | Parameter | Type | Required | Description

| | code | string | Yes | Stock code with market prefix: sh600667 (SH), sz000001 (SZ), hk00700 (HK), usAAPL (US)

 `code` string Yes
 Stock code with market prefix: sh600667 (SH), sz000001 (SZ), hk00700 (HK), usAAPL (US)

 curl

 ```
# 推荐：Authorization 头（密钥不进日志）
curl -H "Authorization: Bearer YOUR_KEY" \
 "https://api.ashareapi.com/v1/etf?code=sh600667"

# 快速测试：直接浏览器打开（?key= 会留在日志/历史里，别用于生产）
curl "https://api.ashareapi.com/v1/etf?code=sh600667&key=YOUR_KEY"
```
 Python

 ```
import requests

r = requests.get(
 "https://api.ashareapi.com/v1/etf",
 headers={"Authorization": "Bearer YOUR_KEY"},
 params={"code": "sh600667"},
 timeout=30,
)
print(r.json())
```
 JavaScript

 ```
const r = await fetch("https://api.ashareapi.com/v1/etf?code=sh600667", {
 headers: { Authorization: "Bearer YOUR_KEY" },
});
console.log(await r.json());
```

 GET `/v1/ipo` IPO calendar [Open this endpoint →](/en/docs/endpoints/ipo)
 IPO calendar: issue, subscription, allotment, listing.
 |
| | Parameter | Type | Required | Description

| | days | integer | No | Number of days, default 15

 `days` integer
 Number of days, default 15

 curl

 ```
# 推荐：Authorization 头（密钥不进日志）
curl -H "Authorization: Bearer YOUR_KEY" \
 "https://api.ashareapi.com/v1/ipo?days=15"

# 快速测试：直接浏览器打开（?key= 会留在日志/历史里，别用于生产）
curl "https://api.ashareapi.com/v1/ipo?days=15&key=YOUR_KEY"
```
 Python

 ```
import requests

r = requests.get(
 "https://api.ashareapi.com/v1/ipo",
 headers={"Authorization": "Bearer YOUR_KEY"},
 params={},
 timeout=30,
)
print(r.json())
```
 JavaScript

 ```
const r = await fetch("https://api.ashareapi.com/v1/ipo?days=15", {
 headers: { Authorization: "Bearer YOUR_KEY" },
});
console.log(await r.json());
```

 GET `/v1/dividend` Dividends & splits [Open this endpoint →](/en/docs/endpoints/dividend)
 Dividend and split history (per-share dividend, bonus, ex-date).
 |
| | Parameter | Type | Required | Description

| | code | string | Yes | Stock code with market prefix: sh600667 (SH), sz000001 (SZ), hk00700 (HK), usAAPL (US)

| | years | integer | No | Number of years, default 3

 `code` string Yes
 Stock code with market prefix: sh600667 (SH), sz000001 (SZ), hk00700 (HK), usAAPL (US)

 `years` integer
 Number of years, default 3

 curl

 ```
# 推荐：Authorization 头（密钥不进日志）
curl -H "Authorization: Bearer YOUR_KEY" \
 "https://api.ashareapi.com/v1/dividend?code=sh600667&years=3"

# 快速测试：直接浏览器打开（?key= 会留在日志/历史里，别用于生产）
curl "https://api.ashareapi.com/v1/dividend?code=sh600667&years=3&key=YOUR_KEY"
```
 Python

 ```
import requests

r = requests.get(
 "https://api.ashareapi.com/v1/dividend",
 headers={"Authorization": "Bearer YOUR_KEY"},
 params={"code": "sh600667"},
 timeout=30,
)
print(r.json())
```
 JavaScript

 ```
const r = await fetch("https://api.ashareapi.com/v1/dividend?code=sh600667&years=3", {
 headers: { Authorization: "Bearer YOUR_KEY" },
});
console.log(await r.json());
```

 GET `/v1/dehydrated` Research digest [Open this endpoint →](/en/docs/endpoints/dehydrated)
 Broker research digests.
 |
| | Parameter | Type | Required | Description

| | mode | string | No | list or detail

| | symbol | string | No | Stock code (used with detail)

| | limit | integer | No | Number of rows, default 30

 `mode` string
 list or detail

 `symbol` string
 Stock code (used with detail)

 `limit` integer
 Number of rows, default 30

 curl

 ```
# 推荐：Authorization 头（密钥不进日志）
curl -H "Authorization: Bearer YOUR_KEY" \
 "https://api.ashareapi.com/v1/dehydrated?mode=list"

# 快速测试：直接浏览器打开（?key= 会留在日志/历史里，别用于生产）
curl "https://api.ashareapi.com/v1/dehydrated?mode=list&key=YOUR_KEY"
```
 Python

 ```
import requests

r = requests.get(
 "https://api.ashareapi.com/v1/dehydrated",
 headers={"Authorization": "Bearer YOUR_KEY"},
 params={},
 timeout=30,
)
print(r.json())
```
 JavaScript

 ```
const r = await fetch("https://api.ashareapi.com/v1/dehydrated?mode=list", {
 headers: { Authorization: "Bearer YOUR_KEY" },
});
console.log(await r.json());
```

 GET `/v1/profile` Company profile [Open this endpoint →](/en/docs/endpoints/profile)
 Company basics: listing date, main business, industry.
 |
| | Parameter | Type | Required | Description

| | code | string | Yes | Stock code with market prefix: sh600667 (SH), sz000001 (SZ), hk00700 (HK), usAAPL (US)

 `code` string Yes
 Stock code with market prefix: sh600667 (SH), sz000001 (SZ), hk00700 (HK), usAAPL (US)

 curl

 ```
# 推荐：Authorization 头（密钥不进日志）
curl -H "Authorization: Bearer YOUR_KEY" \
 "https://api.ashareapi.com/v1/profile?code=sh600667"

# 快速测试：直接浏览器打开（?key= 会留在日志/历史里，别用于生产）
curl "https://api.ashareapi.com/v1/profile?code=sh600667&key=YOUR_KEY"
```
 Python

 ```
import requests

r = requests.get(
 "https://api.ashareapi.com/v1/profile",
 headers={"Authorization": "Bearer YOUR_KEY"},
 params={"code": "sh600667"},
 timeout=30,
)
print(r.json())
```
 JavaScript

 ```
const r = await fetch("https://api.ashareapi.com/v1/profile?code=sh600667", {
 headers: { Authorization: "Bearer YOUR_KEY" },
});
console.log(await r.json());
```

 GET `/v1/search` Search (disambiguation) [Open this endpoint →](/en/docs/endpoints/search)
 Search stocks, funds and sectors by name or code. Use this first to confirm a code.
 |
| | Parameter | Type | Required | Description

| | q | string | Yes | Keyword: a stock name (Chinese works) or a code

 `q` string Yes
 Keyword: a stock name (Chinese works) or a code

 curl

 ```
# 注：q 的值已做 URL 编码（含 [ ] 空格 等）
# 推荐：Authorization 头（密钥不进日志）
curl -H "Authorization: Bearer YOUR_KEY" \
 "https://api.ashareapi.com/v1/search?q=%E5%A4%AA%E6%9E%81%E5%AE%9E%E4%B8%9A"

# 快速测试：直接浏览器打开（?key= 会留在日志/历史里，别用于生产）
curl "https://api.ashareapi.com/v1/search?q=%E5%A4%AA%E6%9E%81%E5%AE%9E%E4%B8%9A&key=YOUR_KEY"
```
 Python

 ```
import requests

r = requests.get(
 "https://api.ashareapi.com/v1/search",
 headers={"Authorization": "Bearer YOUR_KEY"},
 params={"q": "太极实业"},
 timeout=30,
)
print(r.json())
```
 JavaScript

 ```
const r = await fetch("https://api.ashareapi.com/v1/search?q=%E5%A4%AA%E6%9E%81%E5%AE%9E%E4%B8%9A", {
 headers: { Authorization: "Bearer YOUR_KEY" },
});
console.log(await r.json());
```

 GET `/v1/calendar` Corporate event calendar [Open this endpoint →](/en/docs/endpoints/calendar)
 Corporate event calendar (per-stock events, NOT macro): dividend, lockup release, earnings disclosure and other scheduled company events. For macro data use /v1/macro. ⚠️ `data` is a SECTIONED structure: `data.tables` is an ordered list of sections, each with `title` / `slug` / `rows`; plus `data.data{slug: rows}` as a convenience index. Common slugs: `financial_report` / `dividend` / `ipo` / `meeting` / `lockup_release` / `rights_issue`.
 |
| | Parameter | Type | Required | Description

| | date | string | No | Date YYYY-MM-DD (blank = latest trading day)

| | limit | integer | No | Number of rows, default 30

 `date` string
 Date YYYY-MM-DD (blank = latest trading day)

 `limit` integer
 Number of rows, default 30

 curl

 ```
# 推荐：Authorization 头（密钥不进日志）
curl -H "Authorization: Bearer YOUR_KEY" \
 "https://api.ashareapi.com/v1/calendar?date=2026-09-16"

# 快速测试：直接浏览器打开（?key= 会留在日志/历史里，别用于生产）
curl "https://api.ashareapi.com/v1/calendar?date=2026-09-16&key=YOUR_KEY"
```
 Python

 ```
import requests

r = requests.get(
 "https://api.ashareapi.com/v1/calendar",
 headers={"Authorization": "Bearer YOUR_KEY"},
 params={},
 timeout=30,
)
print(r.json())
```
 JavaScript

 ```
const r = await fetch("https://api.ashareapi.com/v1/calendar?date=2026-09-16", {
 headers: { Authorization: "Bearer YOUR_KEY" },
});
console.log(await r.json());
```

 GET `/v1/margin-trade` Margin trading [Open this endpoint →](/en/docs/endpoints/margin-trade)
 Margin trading detail: margin balance, buys, repayments, short balance.
 |
| | Parameter | Type | Required | Description

| | code | string | No | Stock code with market prefix: sh600667 (SH), sz000001 (SZ), hk00700 (HK), usAAPL (US)

| | date | string | No | Date YYYY-MM-DD (blank = latest trading day)

 `code` string
 Stock code with market prefix: sh600667 (SH), sz000001 (SZ), hk00700 (HK), usAAPL (US)

 `date` string
 Date YYYY-MM-DD (blank = latest trading day)

 curl

 ```
# 推荐：Authorization 头（密钥不进日志）
curl -H "Authorization: Bearer YOUR_KEY" \
 "https://api.ashareapi.com/v1/margin-trade?code=sh600667"

# 快速测试：直接浏览器打开（?key= 会留在日志/历史里，别用于生产）
curl "https://api.ashareapi.com/v1/margin-trade?code=sh600667&key=YOUR_KEY"
```
 Python

 ```
import requests

r = requests.get(
 "https://api.ashareapi.com/v1/margin-trade",
 headers={"Authorization": "Bearer YOUR_KEY"},
 params={},
 timeout=30,
)
print(r.json())
```
 JavaScript

 ```
const r = await fetch("https://api.ashareapi.com/v1/margin-trade?code=sh600667", {
 headers: { Authorization: "Bearer YOUR_KEY" },
});
console.log(await r.json());
```

 GET `/v1/block-trade` Block trades [Open this endpoint →](/en/docs/endpoints/block-trade)
 Block trades: price, premium/discount, volume, both-side brokerages.
 |
| | Parameter | Type | Required | Description

| | code | string | No | Stock code with market prefix: sh600667 (SH), sz000001 (SZ), hk00700 (HK), usAAPL (US)

| | date | string | No | Date YYYY-MM-DD (blank = latest trading day)

 `code` string
 Stock code with market prefix: sh600667 (SH), sz000001 (SZ), hk00700 (HK), usAAPL (US)

 `date` string
 Date YYYY-MM-DD (blank = latest trading day)

 curl

 ```
# 推荐：Authorization 头（密钥不进日志）
curl -H "Authorization: Bearer YOUR_KEY" \
 "https://api.ashareapi.com/v1/block-trade?code=sh600667"

# 快速测试：直接浏览器打开（?key= 会留在日志/历史里，别用于生产）
curl "https://api.ashareapi.com/v1/block-trade?code=sh600667&key=YOUR_KEY"
```
 Python

 ```
import requests

r = requests.get(
 "https://api.ashareapi.com/v1/block-trade",
 headers={"Authorization": "Bearer YOUR_KEY"},
 params={},
 timeout=30,
)
print(r.json())
```
 JavaScript

 ```
const r = await fetch("https://api.ashareapi.com/v1/block-trade?code=sh600667", {
 headers: { Authorization: "Bearer YOUR_KEY" },
});
console.log(await r.json());
```

 GET `/v1/usage` Usage & quota [Open this endpoint →](/en/docs/endpoints/usage)
 The key's call count today, tier and daily quota.
 curl

 ```
# 推荐：Authorization 头（密钥不进日志）
curl -H "Authorization: Bearer YOUR_KEY" \
 "https://api.ashareapi.com/v1/usage"

# 快速测试：直接浏览器打开（?key= 会留在日志/历史里，别用于生产）
curl "https://api.ashareapi.com/v1/usage?key=YOUR_KEY"
```
 Python

 ```
import requests

r = requests.get(
 "https://api.ashareapi.com/v1/usage",
 headers={"Authorization": "Bearer YOUR_KEY"},
 params={},
 timeout=30,
)
print(r.json())
```
 JavaScript

 ```
const r = await fetch("https://api.ashareapi.com/v1/usage", {
 headers: { Authorization: "Bearer YOUR_KEY" },
});
console.log(await r.json());
```

 Need other data?
 Free endpoints need no key. Paid endpoints need a key (see pricing).

 [Use with an AI Agent](/en/mcp)[Get a Key](/en/pricing)
