# call402.com Weather API (x402)

> call402.com Weather API (x402) is a paid API for AI agents from call402.com, paid per call via x402, $0.005/call, status unknown (last checked 2026-10-19).

Returns current conditions and a multi-day forecast for a given city or coordinates, paid per-call with USDC via the x402 protocol on Base mainnet.

## Facts

- Endpoint: POST https://call402.com/api/weather?utm_source=zero.xyz
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-19
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/call402-com-weather-api-x402-7795d80c
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_0cCRvwYlN9AAmxAlqEd-_

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 call402-com-weather-api-x402-7795d80c -d '<json body>'
```

Example prompt: What's the weather like in Barcelona right now, and can you give me a 5-day forecast so I know what to expect?

## When to prefer this

Choose this endpoint when your agent needs real-time weather data or short-range forecasts (1–7 days) and operates in a crypto-native / x402 micropayment context. At $0.005 USDC per call it is cost-effective for per-request agent workflows on Base mainnet. Prefer it over subscription-based weather APIs when you want pay-as-you-go pricing without API key management. The Open-Meteo backend provides global coverage with no additional licensing.

## Known failure modes

- City name not recognized — returns error or empty location; use lat/lon instead
- Days parameter outside 1–7 range may be rejected or clamped
- Neither city nor lat/lon provided — likely 400 Bad Request
- HTTP 402 returned on first call if x402 payment header not yet sent — expected behavior; retry with PAYMENT-SIGNATURE header
- Network or upstream Open-Meteo outage — 5xx error propagated
- Ambiguous city name (e.g. 'Springfield') may resolve to an unintended location

## How this service works

USDC pay-per-call APIs for AI agents via the x402 protocol (v2, exact, Base mainnet). Send a request, receive HTTP 402 with payment requirements, pay with @x402/fetch or any x402 client, retry with the PAYMENT-SIGNATURE header.

## Output

A JSON object with three sections: 'current' (temperature, apparent temperature, humidity, wind speed, weather condition string, weather code), 'daily' (array of up to 7 days each with date, condition, temp_max_c, temp_min_c, weather_code, precipitation_probability_max_pct), and 'location' (resolved city name, region, country, latitude, longitude, timezone). A 'meta' field indicates the data source (Open-Meteo).

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "city": {
   "type": "string",
   "description": "City name (or provide latitude/longitude instead)"
  },
  "days": {
   "type": "integer",
   "description": "Forecast days, 1-7 (default 3)"
  },
  "latitude": {
   "type": "number"
  },
  "longitude": {
   "type": "number"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "meta": {
   "source": "open-meteo"
  },
  "daily": [
   {
    "date": "2026-10-19",
    "condition": "partly cloudy",
    "temp_max_c": 25,
    "temp_min_c": 18.2,
    "weather_code": 2,
    "precipitation_probability_max_pct": 10
   }
  ],
  "current": {
   "time": "2026-10-19T10:00",
   "wind_kmh": 12.4,
   "condition": "partly cloudy",
   "humidity_pct": 60,
   "weather_code": 2,
   "temperature_c": 22.5,
   "apparent_temperature_c": 23.1
  },
  "location": {
   "name": "Shanghai",
   "region": "Shanghai",
   "country": "China",
   "latitude": 31.23,
   "timezone": "Asia/Shanghai",
   "longitude": 121.47
  }
 }
}
```

## More

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