pro

批量行情(多只一次取)

⭐ 一次拿多只股票的行情,逐只标明成功与否 —— 给量化/批量研究用。

它解决什么:自己写循环取 300 只 = 300 次请求 × 约 0.7 秒 ≈ 3.5 分钟(还会撞限频退避);本端点实测 4.16 秒拿完沪深300 全 300 只。

用法:codes 用逗号分隔,如 ?codes=sh600519,sz000001,sz300750;支持裸 6 位码(600519)与带前缀(sh600519)。

返回:data 是数组,每项 {code, ok, data}(或 error)—— 取了几只就回几个条目,缺失的显式标 ok:false 并给原因;同时给 requested / returned / failed 计数。

⚠️ 与 /v1/quote 的区别:/v1/quote 的 code 虽也支持逗号,但返回是扁平行且不带逐只状态(缺了哪只要自己算);本端点逐只回填,缺谁一眼可见。

上限:专业版单次最多 200 只,不限量版 1000 只(一次判 300 只 4.16 秒实测可跑通)。计费按实际返回只数(失败的不计)。

⚠️ period 默认 day;count 默认 1(只取最新一条,最省)。要 N 天历史就传 count=N(每只各 N 条,实测 3 只 × 30 = 90 行)。

⚠️ 换手率字段名是 turnover(%,与 /v1/quote 同名同值)。

⚠️ 付费端点:专业版(¥99)及以上,标准版不可用。

get/v1/quote-batch

Request

  • Base URL: https://api.ashareapi.com (the document declares no server; this is the origin it was published from)
  • URL: https://api.ashareapi.com/v1/quote-batch
  • Auth: none declared

Query parameters

codesstring required

多个股票代码,逗号分隔:sh600519,sz000001,sz300750

periodstring

周期:day/week/month/season/year 或 m1~m120

countinteger

每只返回几条,默认 1(只取最新)

startstring

起始日期 YYYY-MM-DD(可选)

endstring

结束日期 YYYY-MM-DD(可选)

Response

Successful Response

unknown required

Changes

No recorded changes to this operation across all 2 revisions of this API.