# CN Data – China Weather Forecast

> CN Data – China Weather Forecast 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 a multi-day weather forecast for Chinese cities by city name or lat/lon coordinates, delivered as machine-readable JSON.

## Facts

- Endpoint: GET https://cn-data-x402.cn-data-x402-worker.workers.dev/cn/weather-forecast?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-china-weather-forecast-200f56bf
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_8gk1KhJgK9rceSFvHmw5w

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-china-weather-forecast-200f56bf
```

Example prompt: What's the weather forecast for Shanghai over the next 5 days — give me daily highs, lows, precipitation chances, and wind speed in JSON?

## When to prefer this

Choose this endpoint when you need structured, machine-readable weather forecast data specifically for Chinese cities, especially when other international weather APIs do not support Chinese city names or Chinese-language descriptions. It requires no API key or signup — just a $0.02 USDC micropayment via the x402 protocol. Prefer it over scraping Chinese weather sites, which return unstructured HTML.

## Known failure modes

- HTTP 402 returned if payment not yet made — must pay $0.02 USDC on Base and retry
- Unknown city name returns an error if not among the 14 preset Chinese cities
- Missing both city and lat/lon parameters results in a bad request error
- Days parameter outside 1-16 range may return a validation error or default to 7
- Network timeout on the Cloudflare Worker edge node

## 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 `ok: true` and a `data` block containing: location metadata (name, latitude, longitude, timezone), number of forecast days, and an array of daily forecasts each with date, weekday (in Chinese), weather description (in Chinese), weather code, max/min temperature in Celsius, precipitation in mm, precipitation probability percentage, max wind speed in km/h, and sunrise/sunset timestamps.

## 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": {
      "lat": {
       "type": "number",
       "description": "纬度（与 lon 配对使用）"
      },
      "lon": {
       "type": "number",
       "description": "经度"
      },
      "city": {
       "type": "string",
       "description": "中文城市名（14 个预设）"
      },
      "days": {
       "type": "integer",
       "description": "预报天数 1-16，默认 7"
      }
     }
    }
   },
   "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": {
   "days": 3,
   "forecast": [
    {
     "date": "2026-10-05",
     "sunset": "2026-10-05T17:44",
     "sunrise": "2026-10-05T05:52",
     "weather": "小雨",
     "weekday": "周一",
     "tempMaxC": 27.1,
     "tempMinC": 21.4,
     "weatherCode": 61,
     "precipitationMm": 3.2,
     "windSpeedMaxKmh": 18.7,
     "precipitationProbability": 65
    }
   ],
   "location": {
    "name": "上海",
    "latitude": 31.2304,
    "timezone": "Asia/Shanghai",
    "longitude": 121.4737
   }
  },
  "endpoint": "/cn/weather-forecast"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/cn-data-china-weather-forecast-200f56bf/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)
