Wiki
Reference material: field references, convention notes and common misuses. Shorter than the tutorials — look things up as needed.
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.
ViewThe same field name can carry different units on different endpoints: volume is always lots, but amount is CNY on K-line and CNY-10k on snapshot. Mixing them up throws the value off by 100x to 10,000x.
ViewK-line prices are always forward-adjusted. There is no adjust parameter, and prices do not gap on ex-dividend dates — so moving averages and pattern work are not fooled by the ex-dividend hole. But do not splice in unadjusted data from elsewhere: that double-adjusts the series.
ViewEvery endpoint wraps its result in the same six outer fields, and the payload itself lives in data, which comes in more than one shape. Some errors (missing parameter, over the limit, a paid endpoint without a key) use a different structure — do not parse those as the envelope.
ViewA code is always written as market prefix plus code, and the prefix must be lowercase. A-shares use sh/sz/bj, Hong Kong hk, US us; ETFs, convertible bonds and sectors each have their own number ranges. A bare code without a prefix comes back empty on the quote endpoints.
ViewTo judge how fresh the data is, read the date field in the response, not your system clock. Each market has its own latest trading day, and endpoints refresh at different cadences — from about 10 seconds to once per trading day after the close.
ViewAn empty array usually means there was no data for this request, not that the API is broken — a malformed code, a market holiday, or data that has not been disclosed yet all look like this. Empty results do not consume quota; work through the list below first.
View