# Real-Time City Weather API

> Real-Time City Weather API is a paid API for AI agents from api.cn402.com, paid per call via x402, $0.05/call, status unknown (last checked 2026-09-14).

Returns real-time weather data for any city worldwide given a city name

## Facts

- Endpoint: GET https://api.cn402.com/weather
- Price: $0.05/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/api-cn402-com-d581beef
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_bA6-ZhAFY4f4ofiVUtidH

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 api-cn402-com-d581beef
```

Example prompt: What's the current weather in Beijing right now?

## When to prefer this

Use this endpoint when you need real-time, live weather conditions for any city worldwide by name and can pay per-call via x402 micropayment. Prefer this over cached or forecast-only services when current conditions are required.

## Known failure modes

- City name not recognized or misspelled — returns error or empty result
- City query parameter missing — returns 400 bad request
- Payment not provided or insufficient — returns 402 payment required
- Service unavailable or upstream weather data source down — returns 5xx error

## How this service works

Real-time weather data for any city worldwide. Query param: ?city=Beijing

## Output

Returns real-time weather data for the specified city, including temperature, weather conditions, and related meteorological information.

## 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": {
      "city": {
       "type": "string",
       "description": "City (optional)"
      }
     }
    }
   },
   "additionalProperties": false
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/api-cn402-com-d581beef/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.cn402.com](https://www.zero.xyz/host/api.cn402.com/llms.txt)
