Endpoint reference
Groups: Free 7 · Pro 25. Parameters and curl / Python / JS samples.
/openapi.json · live · 2026-10-03
Free7
Checks service status and whether both data CLIs are ready.
# 免费端点:无需 API Key(匿名即可调用)
curl "https://api.ashareapi.com/v1/health"import requests
r = requests.get(
"https://api.ashareapi.com/v1/health",
params={},
timeout=30,
)
print(r.json())const r = await fetch("https://api.ashareapi.com/v1/health");
console.log(await r.json());匿名请求超限(429)时也会直接返回同一份挑战。解出 nonce 后带 `X-PoW:
difficultyinteger# 免费端点:无需 API Key(匿名即可调用)
curl "https://api.ashareapi.com/v1/challenge?difficulty=0"import requests
r = requests.get(
"https://api.ashareapi.com/v1/challenge",
params={},
timeout=30,
)
print(r.json())const r = await fetch("https://api.ashareapi.com/v1/challenge?difficulty=0");
console.log(await r.json());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).
codestringYes# 免费端点:无需 API Key(匿名即可调用)
curl "https://api.ashareapi.com/v1/quote?code=sh600667"import requests
r = requests.get(
"https://api.ashareapi.com/v1/quote",
params={"code": "sh600667"},
timeout=30,
)
print(r.json())const r = await fetch("https://api.ashareapi.com/v1/quote?code=sh600667");
console.log(await r.json());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).
codestringYesperiodstringcountinteger# 免费端点:无需 API Key(匿名即可调用)
curl "https://api.ashareapi.com/v1/kline?code=sh600667&period=day"import requests
r = requests.get(
"https://api.ashareapi.com/v1/kline",
params={"code": "sh600667"},
timeout=30,
)
print(r.json())const r = await fetch("https://api.ashareapi.com/v1/kline?code=sh600667&period=day");
console.log(await r.json());Market-wide hot list by attention (A-share / US / ETF) with change %.
limitinteger# 免费端点:无需 API Key(匿名即可调用)
curl "https://api.ashareapi.com/v1/hot?limit=10"import requests
r = requests.get(
"https://api.ashareapi.com/v1/hot",
params={},
timeout=30,
)
print(r.json())const r = await fetch("https://api.ashareapi.com/v1/hot?limit=10");
console.log(await r.json());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).
typestring# 免费端点:无需 API Key(匿名即可调用)
curl "https://api.ashareapi.com/v1/market-overview?type=institution"import requests
r = requests.get(
"https://api.ashareapi.com/v1/market-overview",
params={},
timeout=30,
)
print(r.json())const r = await fetch("https://api.ashareapi.com/v1/market-overview?type=institution");
console.log(await r.json());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).
# 免费端点:无需 API Key(匿名即可调用)
curl "https://api.ashareapi.com/v1/changedist"import requests
r = requests.get(
"https://api.ashareapi.com/v1/changedist",
params={},
timeout=30,
)
print(r.json())const r = await fetch("https://api.ashareapi.com/v1/changedist");
console.log(await r.json());Pro25
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).
codestringYesnuminteger# 推荐: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"import requests
r = requests.get(
"https://api.ashareapi.com/v1/finance",
headers={"Authorization": "Bearer YOUR_KEY"},
params={"code": "sh600667"},
timeout=30,
)
print(r.json())const r = await fetch("https://api.ashareapi.com/v1/finance?code=sh600667&num=4", {
headers: { Authorization: "Bearer YOUR_KEY" },
});
console.log(await r.json());Everything trading-side in one call: main money flow (+ market rank), top-trader boards, block trades, margin trading.
codestringYes# 推荐: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"import requests
r = requests.get(
"https://api.ashareapi.com/v1/fund",
headers={"Authorization": "Bearer YOUR_KEY"},
params={"code": "sh600667"},
timeout=30,
)
print(r.json())const r = await fetch("https://api.ashareapi.com/v1/fund?code=sh600667", {
headers: { Authorization: "Bearer YOUR_KEY" },
});
console.log(await r.json());MA / MACD / KDJ / RSI / BOLL.
codestringYes# 推荐: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"import requests
r = requests.get(
"https://api.ashareapi.com/v1/technical",
headers={"Authorization": "Bearer YOUR_KEY"},
params={"code": "sh600667"},
timeout=30,
)
print(r.json())const r = await fetch("https://api.ashareapi.com/v1/technical?code=sh600667", {
headers: { Authorization: "Bearer YOUR_KEY" },
});
console.log(await r.json());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.
codestringYes# 推荐: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"import requests
r = requests.get(
"https://api.ashareapi.com/v1/shareholder",
headers={"Authorization": "Bearer YOUR_KEY"},
params={"code": "sh600667"},
timeout=30,
)
print(r.json())const r = await fetch("https://api.ashareapi.com/v1/shareholder?code=sh600667", {
headers: { Authorization: "Bearer YOUR_KEY" },
});
console.log(await r.json());Chip distribution and holding-cost analysis.
codestringYes# 推荐: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"import requests
r = requests.get(
"https://api.ashareapi.com/v1/chip",
headers={"Authorization": "Bearer YOUR_KEY"},
params={"code": "sh600667"},
timeout=30,
)
print(r.json())const r = await fetch("https://api.ashareapi.com/v1/chip?code=sh600667", {
headers: { Authorization: "Bearer YOUR_KEY" },
});
console.log(await r.json());秒级快照:买一~买五 / 卖一~卖五的价格与挂单量(手),含现价/涨跌/数据时间。字段命名对齐 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(正常现象)。
codestringYes# 推荐: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"import requests
r = requests.get(
"https://api.ashareapi.com/v1/orderbook",
headers={"Authorization": "Bearer YOUR_KEY"},
params={"code": "sh600667"},
timeout=30,
)
print(r.json())const r = await fetch("https://api.ashareapi.com/v1/orderbook?code=sh600667", {
headers: { Authorization: "Bearer YOUR_KEY" },
});
console.log(await r.json());一只股票的完整画像:价格 + 盘口(买五卖五+委差)+ 估值(PE TTM/动/静 + PB) + 市值(流通/总)+ 股本(流通/总)+ 打板(涨停/跌停价 + 量比 + 振幅 + 涨速) + 标识(证券类型/股票状态/币种)+ 外盘/内盘。⚠️ 与 `/v1/quote` 的分工:quote 轻(8 字段)· 走官方通道 · 免费;本端点全(35 字段)· pro 档。只要现价用 quote 更轻(字段少、响应快)。⚠️ 仅 A 股(港股/美股字段布局不同,请用 `/v1/quote`)——传其他市场返回空,不返回错数据。⚠️ 计费 = 次数:本端点 1 次拿全 35 字段——要估值+市值+股本+涨停价多项时,比分别调 quote/valuation/orderbook 更省次数。⚠️ 单位:`volume` 手 · `amount` 万元 · 市值 亿元 · 股本 股 · 比率/涨幅 百分数。(字段含义见 https://ashareapi.com/docs/)
codestringYes# 推荐: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"import requests
r = requests.get(
"https://api.ashareapi.com/v1/snapshot",
headers={"Authorization": "Bearer YOUR_KEY"},
params={"code": "sh600667"},
timeout=30,
)
print(r.json())const r = await fetch("https://api.ashareapi.com/v1/snapshot?code=sh600667", {
headers: { Authorization: "Bearer YOUR_KEY" },
});
console.log(await r.json());42 event tags per stock: block trades, top-trader boards, buybacks, placements, dividends, earnings, lockups.
codestringYes# 推荐: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"import requests
r = requests.get(
"https://api.ashareapi.com/v1/events",
headers={"Authorization": "Bearer YOUR_KEY"},
params={"code": "sh600667"},
timeout=30,
)
print(r.json())const r = await fetch("https://api.ashareapi.com/v1/events?code=sh600667", {
headers: { Authorization: "Bearer YOUR_KEY" },
});
console.log(await r.json());Top-trader boards by type: institution / hot money / active seats.
typestringdatestring# 推荐: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"import requests
r = requests.get(
"https://api.ashareapi.com/v1/lhb",
headers={"Authorization": "Bearer YOUR_KEY"},
params={},
timeout=30,
)
print(r.json())const r = await fetch("https://api.ashareapi.com/v1/lhb?type=institution", {
headers: { Authorization: "Bearer YOUR_KEY" },
});
console.log(await r.json());Screen the whole market with a factor expression, e.g. intersect([PE_TTM > 0, PE_TTM < 20, ROETTM > 15]).
exprstringpresetstringlimitintegerorderbystringdescbooleanmarketstring# 注: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"import requests
r = requests.get(
"https://api.ashareapi.com/v1/screen",
headers={"Authorization": "Bearer YOUR_KEY"},
params={},
timeout=30,
)
print(r.json())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());Industry / concept / region sector moves, with the leading stock.
# 推荐:Authorization 头(密钥不进日志)
curl -H "Authorization: Bearer YOUR_KEY" \
"https://api.ashareapi.com/v1/sector"
# 快速测试:直接浏览器打开(?key= 会留在日志/历史里,别用于生产)
curl "https://api.ashareapi.com/v1/sector?key=YOUR_KEY"import requests
r = requests.get(
"https://api.ashareapi.com/v1/sector",
headers={"Authorization": "Bearer YOUR_KEY"},
params={},
timeout=30,
)
print(r.json())const r = await fetch("https://api.ashareapi.com/v1/sector", {
headers: { Authorization: "Bearer YOUR_KEY" },
});
console.log(await r.json());A 股产业链数据(183 个产业链主题):mode=list 主题列表 · mode=graph&topic=超级电容 → 产业链图谱(关联个股 + 所属节点 + 产业链位置 上游/中游/下游)· mode=stock&code=sh600667 → 个股所属产业链(主题 / 节点 / 位置 / 关联度 / 业务描述)。用户问『产业链/上下游/某公司处于链上什么位置/这个主题有哪些公司』时用。
modestringtopicstringcodestring# 推荐: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"import requests
r = requests.get(
"https://api.ashareapi.com/v1/industry-chain",
headers={"Authorization": "Bearer YOUR_KEY"},
params={},
timeout=30,
)
print(r.json())const r = await fetch("https://api.ashareapi.com/v1/industry-chain?mode=list", {
headers: { Authorization: "Bearer YOUR_KEY" },
});
console.log(await r.json());Shenwan sector PE/PB/PS/PCF + dividend yield + historical percentile. code like pt01801780.
codestringYes# 推荐: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"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())const r = await fetch("https://api.ashareapi.com/v1/sector-valuation?code=sh600667", {
headers: { Authorization: "Bearer YOUR_KEY" },
});
console.log(await r.json());Global macro: GDP / CPI / PMI / LPR / treasury yields / fiscal.
regionstringnamesstring# 推荐: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"import requests
r = requests.get(
"https://api.ashareapi.com/v1/macro",
headers={"Authorization": "Bearer YOUR_KEY"},
params={},
timeout=30,
)
print(r.json())const r = await fetch("https://api.ashareapi.com/v1/macro?region=cn", {
headers: { Authorization: "Bearer YOUR_KEY" },
});
console.log(await r.json());Full convertible-bond terms: premium, conversion value, double-low, redemption triggers, rating. code like sh113052.
codestringYes# 推荐: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"import requests
r = requests.get(
"https://api.ashareapi.com/v1/bond",
headers={"Authorization": "Bearer YOUR_KEY"},
params={"code": "sh600667"},
timeout=30,
)
print(r.json())const r = await fetch("https://api.ashareapi.com/v1/bond?code=sh600667", {
headers: { Authorization: "Bearer YOUR_KEY" },
});
console.log(await r.json());ETF quote / size / premium-discount / money flow. code like sh510300.
codestringYes# 推荐: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"import requests
r = requests.get(
"https://api.ashareapi.com/v1/etf",
headers={"Authorization": "Bearer YOUR_KEY"},
params={"code": "sh600667"},
timeout=30,
)
print(r.json())const r = await fetch("https://api.ashareapi.com/v1/etf?code=sh600667", {
headers: { Authorization: "Bearer YOUR_KEY" },
});
console.log(await r.json());IPO calendar: issue, subscription, allotment, listing.
daysinteger# 推荐: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"import requests
r = requests.get(
"https://api.ashareapi.com/v1/ipo",
headers={"Authorization": "Bearer YOUR_KEY"},
params={},
timeout=30,
)
print(r.json())const r = await fetch("https://api.ashareapi.com/v1/ipo?days=15", {
headers: { Authorization: "Bearer YOUR_KEY" },
});
console.log(await r.json());Dividend and split history (per-share dividend, bonus, ex-date).
codestringYesyearsinteger# 推荐: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"import requests
r = requests.get(
"https://api.ashareapi.com/v1/dividend",
headers={"Authorization": "Bearer YOUR_KEY"},
params={"code": "sh600667"},
timeout=30,
)
print(r.json())const r = await fetch("https://api.ashareapi.com/v1/dividend?code=sh600667&years=3", {
headers: { Authorization: "Bearer YOUR_KEY" },
});
console.log(await r.json());Broker research digests.
modestringsymbolstringlimitinteger# 推荐: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"import requests
r = requests.get(
"https://api.ashareapi.com/v1/dehydrated",
headers={"Authorization": "Bearer YOUR_KEY"},
params={},
timeout=30,
)
print(r.json())const r = await fetch("https://api.ashareapi.com/v1/dehydrated?mode=list", {
headers: { Authorization: "Bearer YOUR_KEY" },
});
console.log(await r.json());Company basics: listing date, main business, industry.
codestringYes# 推荐: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"import requests
r = requests.get(
"https://api.ashareapi.com/v1/profile",
headers={"Authorization": "Bearer YOUR_KEY"},
params={"code": "sh600667"},
timeout=30,
)
print(r.json())const r = await fetch("https://api.ashareapi.com/v1/profile?code=sh600667", {
headers: { Authorization: "Bearer YOUR_KEY" },
});
console.log(await r.json());Search stocks, funds and sectors by name or code. Use this first to confirm a code.
qstringYes# 注: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"import requests
r = requests.get(
"https://api.ashareapi.com/v1/search",
headers={"Authorization": "Bearer YOUR_KEY"},
params={"q": "太极实业"},
timeout=30,
)
print(r.json())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());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`.
datestringlimitinteger# 推荐: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"import requests
r = requests.get(
"https://api.ashareapi.com/v1/calendar",
headers={"Authorization": "Bearer YOUR_KEY"},
params={},
timeout=30,
)
print(r.json())const r = await fetch("https://api.ashareapi.com/v1/calendar?date=2026-09-16", {
headers: { Authorization: "Bearer YOUR_KEY" },
});
console.log(await r.json());Margin trading detail: margin balance, buys, repayments, short balance.
codestringdatestring# 推荐: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"import requests
r = requests.get(
"https://api.ashareapi.com/v1/margin-trade",
headers={"Authorization": "Bearer YOUR_KEY"},
params={},
timeout=30,
)
print(r.json())const r = await fetch("https://api.ashareapi.com/v1/margin-trade?code=sh600667", {
headers: { Authorization: "Bearer YOUR_KEY" },
});
console.log(await r.json());Block trades: price, premium/discount, volume, both-side brokerages.
codestringdatestring# 推荐: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"import requests
r = requests.get(
"https://api.ashareapi.com/v1/block-trade",
headers={"Authorization": "Bearer YOUR_KEY"},
params={},
timeout=30,
)
print(r.json())const r = await fetch("https://api.ashareapi.com/v1/block-trade?code=sh600667", {
headers: { Authorization: "Bearer YOUR_KEY" },
});
console.log(await r.json());The key's call count today, tier and daily quota.
# 推荐:Authorization 头(密钥不进日志)
curl -H "Authorization: Bearer YOUR_KEY" \
"https://api.ashareapi.com/v1/usage"
# 快速测试:直接浏览器打开(?key= 会留在日志/历史里,别用于生产)
curl "https://api.ashareapi.com/v1/usage?key=YOUR_KEY"import requests
r = requests.get(
"https://api.ashareapi.com/v1/usage",
headers={"Authorization": "Bearer YOUR_KEY"},
params={},
timeout=30,
)
print(r.json())const r = await fetch("https://api.ashareapi.com/v1/usage", {
headers: { Authorization: "Bearer YOUR_KEY" },
});
console.log(await r.json());Free endpoints need no key. Paid endpoints need a key (see pricing).