Reference

K-line field reference

A K-line row has 8 fields — date, open, last, high, low, volume, amount, turnover. 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 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.

Last updated: 2026-10-05

Fields and example taken from a live response on 2026-10-05 (/v1/kline?code=sh600519&count=2).