Double 11 annual ¥1,699/yrView
Reference

K-line field reference

A K-line row has 8 fields — date, open, last, high, low, volume, amount, turnover — and they do not change with the period. Two things trip people up most: the close price field is named last, not close; and every numeric value is a string, not a number.

What the response looks like

A real response from GET /v1/kline?code=sh600519&count=2:

{
  "ok": true,
  "endpoint": "kline",
  "tier": "free",
  "elapsed_ms": 701,
  "source": "multi",
  "data": [
    { "date": "2026-09-30", "open": "1239.53", "last": "1258.62", "high": "1268",
      "low": "1236.05", "volume": "38331", "amount": "4797250000", "turnover": "0.31" }
  ]
}

The five outer fields are the same on every endpoint: ok (success), endpoint (name), tier (current tier), elapsed_ms (latency), source (where the data came from). The market data itself lives in the data array.

The eight fields

Field Meaning Unit / format
date Trading day YYYY-MM-DD
open Open price CNY
last Close price CNY
high High CNY
low Low CNY
volume Volume lots (1 lot = 100 shares)
amount Turnover value CNY
turnover Turnover rate percent value (0.31 = 0.31%)

The fields do not change with the period

Those 8 fields are fixed — whether you pull day, week or minute bars, the response always has these 8 columns.

period accepts: day (default) / week / month / season / year / m1 m5 m15 m30 m60 m120 (minute bars).

⚠️ Minute bars carry three extra limits that day bars do not:

  • Paid tier — an API key is required; day / week / month / quarter / year are free.
  • Unadjusted — they return raw prices, so they can gap on an ex-dividend date (see “Adjustment convention”).
  • Only the last month — the window starts around the beginning of the previous calendar month; outside that range you get an empty result.

⚠️ Symbol limits (which codes have minute bars): minute bars support Shanghai/Shenzhen A-shares / indices / sectors / ETFs / convertible bonds / Hong Kong / US stocks; Beijing Stock Exchange / futures / forex / US indices do not have minute bars — passing those codes returns 422 “minute K-line not supported” (use /v1/minute for intraday Beijing data). US indices us.DJI / us.IXIC / us.SPX support day only; futures / forex have day / week / month only.

The two mistakes people make most

Why is the close price called last instead of close?

Because the same field means latest price during the session and close price after it. One name covers both, so you never have to switch field names based on the clock. If you are porting code, the mapping is close → last.

Why are the numbers strings?

"1258.62" is a string, not a number. This is deliberate — it preserves precision. Floating point across languages produces artefacts like 1258.6200000000001, and prices and amounts are precision-sensitive. Convert on your side:

import requests

r = requests.get("https://api.ashareapi.com/v1/kline",
                 params={"code": "sh600519", "count": 250}).json()

for row in r["data"]:
    close = float(row["last"])      # string -> float
    amount = float(row["amount"])

Common misuses

  • Treating volume as shares — it is lots (1 lot = 100 shares); multiply by 100 for shares.
  • Treating turnover as a fraction — 0.31 means 0.31%, not 31%.
  • Reading data without checking ok — on failure data may be empty or absent. Check ok first.
  • Looking for an adjust parameter — the adjustment convention is fixed; the endpoint neither needs nor accepts one.
  • Assuming day-bar adjustment applies to minute bars — minute bars are unadjusted, so the two price series follow different conventions.
  • Requesting minute bars for Beijing Stock Exchange / futures / forex — those symbols have no minute bars and return 422 with an explicit message (not an empty array); use /v1/minute for intraday Beijing data.

Last updated: 2026-10-07

Fields and example taken from a live response on 2026-10-05 (/v1/kline?code=sh600519&count=2); periods and symbol limits checked against the live openapi on 2026-10-07.