技术指标 API
技术指标全家桶:MA / EMA / MACD / KDJ / RSI / BOLL / BIAS / WR / DMI / OBV 等共 55 项。用户问『技术面/指标/金叉死叉/超买超卖』时用。date 可回看历史(YYYY-MM-DD,缺省=最新);只有日线口径。 ⭐ 多只请用 /v1/technical-batch(一次 500 只、逐只标明成功与否,实测 500 只 1.2 秒 —— 自己循环要 500 次请求且会撞限频)。 ⚠️ 代码可传 sh600667 或裸 6 位 600667;A 股(含北交所)/ 港股 / 美股均支持。
GET /v1/technicalGET /v1/technical?code=sh600667&date=2026-09-16curl "https://api.ashareapi.com/v1/technical?code=sh600667&date=2026-09-16&key=YOUR_KEY"code * · date带 * 为必填快速开始
把下面的代码里的 Key 换成你的(免费端点无需 Key,直接调):
# 推荐:Authorization 头(密钥不进日志)
curl -H "Authorization: Bearer YOUR_KEY" \
"https://api.ashareapi.com/v1/technical?code=sh600667&date=2026-09-16"
# 快速测试:直接浏览器打开(?key= 会留在日志/历史里,别用于生产)
curl "https://api.ashareapi.com/v1/technical?code=sh600667&date=2026-09-16&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&date=2026-09-16", {
headers: { Authorization: "Bearer YOUR_KEY" },
});
console.log(await r.json());参数
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| code | string | 是 | 股票代码:sh600667 / 600667 |
| date | string | 否 | 交易日 YYYY-MM-DD(默认最新)。非交易日自动回退到最近交易日,以返回的 date 为准 |
codestring是datestring返回字段
下表由线上真实调用采集(非文档推断):每行是响应里的字段名、类型和一条真实样例值,用来对齐解析代码。
data统一信封: ok / endpoint / tier / elapsed_ms / source取样日: 2026-10-20| 字段 | 类型 | 真实样例值 |
|---|---|---|
| code | str | sh600519 |
| name | str | 贵州茅台 |
| date | str | 2026-10-20 |
| closePrice | str | 1331.88 |
| ma_MA_5 | str | 1316.96 |
| ma_MA_10 | str | 1292.51 |
| ma_MA_20 | str | 1272.70 |
| ma_MA_30 | str | 1281.15 |
| ma_MA_60 | str | 1298.18 |
| ma_MA_120 | str | 1281.32 |
| ma_MA_250 | str | 1341.16 |
| ma_EMA_12 | str | 1296.02 |
| ma_EMA_26 | str | 1286.60 |
| ma_EMA_50 | str | 1285.77 |
| macd_DIF | str | 9.42 |
| macd_DEA | str | -0.70 |
| macd_MACD | str | 20.24 |
| kdj_KDJ_K | str | 85.31 |
| kdj_KDJ_D | str | 81.43 |
| kdj_KDJ_J | str | 93.09 |
| rsi_RSI_2 | str | 86.34 |
| rsi_RSI_6 | str | 78.82 |
| rsi_RSI_12 | str | 67.83 |
| rsi_RSI_24 | str | 58.58 |
| boll_BOLL_UPPER | str | 1331.38 |
| boll_BOLL_MID | str | 1272.70 |
| boll_BOLL_LOWER | str | 1214.02 |
| bias_BIAS_6 | str | 1.67 |
| bias_BIAS_12 | str | 3.75 |
| bias_BIAS_24 | str | 4.52 |
| wr_WR_6 | str | 20.24 |
| wr_WR_10 | str | 14.86 |
| dmi_SAR | str | 1264.53 |
| dmi_PDI | str | 36.87 |
| dmi_MDI | str | 9.00 |
| dmi_ADX | str | 48.83 |
| dmi_ADXR | str | 44.86 |
| other_OBV | str | -881451 |
| other_VR | str | 86.79 |
| other_VRMA | str | 88.96 |
| other_BBI | str | 1299.15 |
| other_TRIX | str | 0.04 |
| other_TRIXMA | str | -0.12 |
| other_DPO | str | 53.22 |
| other_MADPO | str | 24.66 |
| other_PSY | str | 66.67 |
| other_PSYMA | str | 55.56 |
| other_ENE | str | 1305.44 |
| other_ENE_UPPER | str | 1434.69 |
| other_ENE_LOWER | str | 1176.19 |
| other_CCI_14 | str | 129.32 |
| other_DDD | str | -1.22 |
| other_AMA | str | -32.03 |
| other_AR | str | 123.80 |
| other_BR | str | 103.03 |
统一返回信封: { ok, endpoint, tier, elapsed_ms, source, data }
数据在 data 字段;数据源为空时 ok:false 且不扣次数。
免费端点无需 Key(匿名 5 次/分,解一次 PoW 可到 15 次/分;每次最多 250 根 K 线、每天最多 10 万条)。付费端点按档位限流:体验 30 · 标准 120 · 专业 300 · 机构版 600 次/分;买断档按总量计(不用完不过期)。
看错误码对照表 →常见问题
通用问题(所有端点通用)
免费端点不需要:health、challenge、quote、kline、hot、market-overview、changedist 匿名即可调用。付费端点需要:在请求头带 Authorization: Bearer <你的 Key>。⚠️ 匿名额度按调用者类型分级:浏览器(真人)5 次/分;脚本 / SDK / AI Agent(curl、requests、axios、openai 等 UA)2 次/分 —— 自动化流量更易被滥用。解一次 PoW 挑战(GET /v1/challenge,再带 X-PoW 头)可提到 15 次/分,与类型无关。⚠️ 另外,匿名调用单次最多取 250 根 K 线、每天最多 10 万条 —— 要一次拿满 1212 根或不限日量,请用 API Key。
不会。数据源失败或空结果时返回 ok:false,并自动退回本次计费(total_calls / usage_log / ep_log 三处同时回滚)。只有真正取到数据的请求才计入用量。
行情类(quote / kline / orderbook / changedist)为实时或当日;财务、股东、分红、事件等为数据源披露后 T+1 内。每份响应都自带数据时点字段 —— 分时看 time(HHMM),行情看 date(交易日),据此可核对这份数据对应的是哪一刻。
不能。code 是单值参数,一次一只;批量请并发调用(注意各自档位的每分钟限流)。
配一次 MCP 即可,之后直接问 AI「查一下……」它会自己调。MCP 暴露 92 个工具,覆盖行情 / 财务 / 选股 / 板块 / 宏观。