ETF overview API
ETF quote / size / premium-discount / money flow. code like sh510300.
GET /v1/etfGET /v1/etf?code=sh600667&kind=dailycurl "https://api.ashareapi.com/v1/etf?code=sh600667&kind=daily&key=YOUR_KEY"code * · kind · start · end · date* = requiredQuick start
Replace the key below with yours (free endpoints need no key):
# 推荐:Authorization 头(密钥不进日志)
curl -H "Authorization: Bearer YOUR_KEY" \
"https://api.ashareapi.com/v1/etf?code=sh600667&kind=daily"
# 快速测试:直接浏览器打开(?key= 会留在日志/历史里,别用于生产)
curl "https://api.ashareapi.com/v1/etf?code=sh600667&kind=daily&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&kind=daily", {
headers: { Authorization: "Bearer YOUR_KEY" },
});
console.log(await r.json());Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| code | string | Yes | Stock code with market prefix: sh600667 (SH), sz000001 (SZ), hk00700 (HK), usAAPL (US) |
| kind | string | No | 概览(默认)/详情/持仓/净值/公司/持有人/财务 |
| start | string | No | 仅 kind=净值:起始日 YYYY-MM-DD |
| end | string | No | 仅 kind=净值:结束日 YYYY-MM-DD |
| date | string | No | Date YYYY-MM-DD (blank = latest trading day) |
codestringYeskindstringstartstringendstringdatestringResponse fields
The table below is captured from real API calls (not inferred): each row gives the field name, its type and one real sample value, so you can align your parser.
structuredEnvelope: ok / endpoint / tier / elapsed_ms / sourceProbed: 2026-10-20| Field | Type | Real sample value |
|---|---|---|
| date | str | 2026-10-20 |
| code | str | sh510300 |
| name | str | 沪深300ETF华泰柏瑞 |
| chgPct | str | 0.09 |
| chgPct20D | str | -7.4 |
| chgPct52W | str | -5.8 |
| chgPct5D | str | -2.75 |
| chgPct60D | str | -7.61 |
| chgPctYtd | str | -8.42 |
| divTtm | str | 2.7306 |
| divTtmPct | str | 51.57 |
| etfDisc | str | -0.16 |
| etfDiscAvgM | str | -0.006 |
| etfDiscAvgQ | str | -0.023500000000000007 |
| etfDiscAvgW | str | -0.044000000000000004 |
| etfDiscAvgY | str | -0.02011904761904762 |
| etfInFlow | str | 0 |
| etfInFlowMAvg | str | 0 |
| etfInFlowQAvg | str | 0 |
| etfInFlowWAvg | str | 0 |
| etfInFlowYAvg | str | 0 |
| etfSize | str | 124002419638.21 |
| etfSizeMChg | str | 0 |
| etfSizeQChg | str | 0 |
| etfSizeWChg | str | 0 |
| etfSizeYChg | str | 0 |
| etfTurnover | str | 5137100000 |
| etfTurnoverAvgM | str | 4215661000 |
| etfTurnoverAvgQ | str | 4605923000 |
| etfTurnoverAvgW | str | 7280332000 |
| etfTurnoverAvgY | str | 5315862936.5079365 |
| etfTurnoverR | str | 4.24 |
| etfTurnoverRAvgM | str | 3.81 |
| etfTurnoverRAvgQ | str | 4.073000000000001 |
| etfTurnoverRAvgW | str | 6.3340000000000005 |
| etfTurnoverRAvgY | str | 3.0175793650793654 |
| maxDrawdown1M | str | -8.17 |
| maxDrawdown1Y | str | -16.79 |
| maxDrawdown3M | str | -11.77 |
| maxDrawdown3Y | str | -17.07 |
| maxDrawdown6M | str | -16.79 |
| netValue | str | 94872183996.4 |
| netValueTotal | str | 94872183996.4 |
| pb | str | 1.3849 |
| pbPct | str | 50.33 |
| pcfTtm | str | 3.5244 |
| pcfTtmPct | str | 9.49 |
| peTtm | str | 13.0966 |
| peTtmPct | str | 67.49 |
| peg | str | 2.9842 |
| pegPct | str | 50.74 |
| psTtm | str | 1.4673 |
| psTtmPct | str | 75.99 |
| roe | str | 10.57 |
| roePct | str | 38.37 |
| totalAsset | str | 95683574830.88 |
| turnoverRate | str | 4.24 |
| turnoverValue | str | 5137100000 |
| ytdMaxDrawdown | str | -16.79 |
Unified envelope: { ok, endpoint, tier, elapsed_ms, source, data }
Rows live in data; when upstream returns nothing you get ok:false and the call is not counted.
Free endpoints need no key (anonymous 5/min — 250 bars per request, 100k rows per day; solve one PoW challenge for 15/min). Paid tiers: Trial 30 · Standard 120 · Pro 300 · Unlimited 600 per minute; buyout packs are capped by total calls and never expire.
See the error code table →FAQ
General (applies to every endpoint)
Free endpoints do not: health, challenge, quote, kline, hot, market-overview and changedist work anonymously. Paid endpoints do: send Authorization: Bearer <your key>. ⚠️ The anonymous allowance is tiered by caller type: browsers (humans) get 5/min; scripts, SDKs and AI Agents (curl, requests, axios, openai user-agent strings) get 2/min — automated traffic is easier to abuse. Solving one PoW challenge (GET /v1/challenge, then send the X-PoW header) raises it to 15/min regardless of type. ⚠️ Also, anonymous calls are capped at 250 bars per request and 100k rows per day — use an API key for the full 1212 bars or unlimited daily volume.
No. When the upstream fails or returns nothing you get ok:false and the charge for that call is refunded (total_calls / usage_log / ep_log are rolled back together). Only calls that actually returned data count.
Quotes (quote / kline / orderbook / changedist) are real-time or current session; financials, shareholders, dividends and events are within T+1 of source disclosure. Every response carries its own data timestamp — time (HHMM) on intraday bars, date (trading day) on quotes — so you can check exactly which moment a payload reflects.
No. code is a single-value parameter — one stock per call. For batches, issue concurrent calls and respect your tier per-minute limit.
Set up MCP once, then just ask the AI — it calls the endpoint itself. MCP exposes 92 tools covering quotes, financials, screening, sectors and macro.
Related endpoints
Set up MCP once, then just ask the AI — it calls the endpoint itself.