# CN Data – Chinese Stock K-Line (Candlestick) History

> CN Data – Chinese Stock K-Line (Candlestick) History is a paid API for AI agents from cn-data-x402.cn-data-x402-worker.workers.dev, paid per call via x402, $0.02/call, status unknown (last checked 2026-10-16).

Returns OHLCV candlestick bars and moving averages for Chinese A-share, H-share, US-listed, and index symbols, with optional price adjustment (forward/backward split)

## Facts

- Endpoint: GET https://cn-data-x402.cn-data-x402-worker.workers.dev/cn/kline?utm_source=zero.xyz
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-16
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/cn-data-chinese-stock-k-line-candlestick-history-53a7446f
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_PqS9qkzan8DYZ-QNP52Z6

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability cn-data-chinese-stock-k-line-candlestick-history-53a7446f
```

Example prompt: Pull the last 90 daily forward-adjusted (qfq) candlestick bars for 贵州茅台 (symbol 600519) from the CN Data kline endpoint, including moving averages.

## When to prefer this

Choose this endpoint when you need structured OHLCV candlestick history for Chinese A-share, H-share, or index symbols without requiring an API key or subscription — payment is per-call in USDC via x402. Prefer it over generic global stock APIs when you specifically need Chinese market data with split-adjusted prices, Chinese-language metadata (stock names), and moving averages bundled in one call. It also handles Hong Kong and US-listed symbols with automatic exchange suffix resolution.

## Known failure modes

- Missing or invalid symbol returns an error JSON with ok:false
- Symbol not found on the upstream Tencent data source returns empty bars
- Requesting more bars than available history returns fewer bars than requested (returned < requested)
- Unsupported adj value or period string may result in default fallback or error
- HTTP 402 returned if payment has not been completed — agent must pay USDC on Base and retry
- Network timeout from upstream Tencent endpoint causes delayed or failed response

## How this service works

Chinese market and China-focused public data over the x402 protocol. No API key and no signup: call any endpoint, receive HTTP 402 with payment terms, pay the listed amount in USDC on Base and retry. Every response is JSON. Some Chinese-language sources are published only as web pages — these endpoints return them as clean, machine-readable JSON.

## Output

A JSON object with: an array of OHLCV bar objects (date, open, high, low, close, volume in lots, volume in shares, change percent), a moving averages object (MA5/MA10/MA20/MA60), a range summary (overall high/low/change%), the latest real-time quote (price, open, previous close), stock name and code, market identifier, period type, adjustment method, and data source attribution in Chinese.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "properties": {
      "adj": {
       "type": "string",
       "description": "复权：qfq（前复权，默认）/ hfq（后复权）/ none（不复权）"
      },
      "days": {
       "type": "integer",
       "description": "返回多少根 K 线 2-500，默认 60"
      },
      "period": {
       "type": "string",
       "description": "周期：day（日线，默认）/ week（周线）/ month（月线）"
      },
      "symbol": {
       "type": "string",
       "description": "代码：600519 / sh600519 / 000001.SZ / 00700.HK / AAPL（美股自动配交易所后缀）/ sh000300 指数"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "ok": true,
  "data": {
   "ma": {
    "ma5": 1258.084,
    "ma10": null,
    "ma20": null,
    "ma60": null
   },
   "bars": [
    {
     "low": 1255.42,
     "date": "2026-10-09",
     "high": 1282,
     "open": 1255.42,
     "close": 1263,
     "volume": 35111,
     "volumeShares": 3511100,
     "changePercent": 0.5741
    },
    {
     "low": 1261,
     "date": "2026-10-12",
     "high": 1284.44,
     "open": 1262.95,
     "close": 1277.43,
     "volume": 9405,
     "volumeShares": 940500,
     "changePercent": 1.1425
    }
   ],
   "code": "600519",
   "name": "贵州茅台",
   "range": {
    "low": 1228.1,
    "high": 1284.44,
    "changePercent": 3.3519
   },
   "market": "A",
   "period": "day",
   "source": "历史行情来自腾讯证券公开接口（web.ifzq.gtimg.cn，前复权/后复权由 ?adj= 选择）。",
   "symbol": "SH600519",
   "lastDate": "2026-10-12",
   "returned": 6,
   "firstDate": "2026-09-28",
   "requested": 5,
   "adjustment": "qfq",
   "volumeUnit": "lot (手，1 手 = 100 股)",
   "latestQuote": {
    "name": "贵州茅台",
    "open": 1262.95,
    "price": 1277.43,
    "previousClose": 1263
   }
  },
  "endpoint": "/cn/kline"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/cn-data-chinese-stock-k-line-candlestick-history-53a7446f/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from cn-data-x402.cn-data-x402-worker.workers.dev](https://www.zero.xyz/host/cn-data-x402.cn-data-x402-worker.workers.dev/llms.txt)
