# CN Data - China Weather

> CN Data - China Weather 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 current weather conditions and air quality for a Chinese city, given a city name or lat/lon coordinates, as machine-readable JSON

## Facts

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

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-2124df0f
```

Example prompt: What's the current weather and air quality in Shanghai right now — temperature, humidity, wind, and PM2.5?

## When to prefer this

Choose this endpoint when you need current weather and air quality data specifically for Chinese cities, especially when the city name is in Chinese or when you need air quality metrics (PM2.5, PM10, US AQI) alongside standard weather. Prefer this over generic global weather APIs when targeting mainland China locations — it handles Chinese-language city names natively and bundles air quality data not always available from Western APIs. Use it when operating under the x402 pay-per-call model and no API key is available.

## Known failure modes

- Unrecognized city name returns an error — only 14 preset Chinese city names are supported
- Missing both city and lat/lon parameters causes a 400-class error
- HTTP 402 returned on first unauthenticated call — agent must pay $0.02 USDC on Base and retry
- Invalid lat/lon values outside China may return no data or unexpected results
- Stale observation timestamp if upstream weather source is delayed

## 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 field containing: current weather description (Chinese), weather code, temperature in Celsius, feels-like temperature, wind speed (km/h), wind direction (degrees), humidity (%), precipitation (mm), air quality metrics (PM2.5, PM10, US AQI, quality level string), location details (name, latitude, longitude, timezone), and observation timestamp (ISO 8601).

## 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 配对使用），如 31.23"
      },
      "lon": {
       "type": "number",
       "description": "经度，如 121.47"
      },
      "city": {
       "type": "string",
       "description": "中文城市名（14 个预设），如 上海"
      }
     }
    }
   },
   "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": {
   "air": {
    "pm10": 61,
    "level": "良",
    "pm2_5": 35.2,
    "usAqi": 84
   },
   "weather": "多云",
   "location": {
    "name": "北京",
    "latitude": 39.9042,
    "timezone": "Asia/Shanghai",
    "longitude": 116.4074
   },
   "feelsLikeC": 16.9,
   "observedAt": "2026-10-02T21:00",
   "weatherCode": 2,
   "temperatureC": 17.4,
   "windSpeedKmh": 8.6,
   "humidityPercent": 62,
   "precipitationMm": 0,
   "windDirectionDeg": 210
  },
  "endpoint": "/cn/weather"
 }
}
```

## More

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