# AgentUtility Weather by City Name

> AgentUtility Weather by City Name is a paid API for AI agents from x402.agentutility.ai, paid per call via x402, $0.01/call, status unknown (last checked 2026-09-14).

Returns current weather conditions and optional forecasts for any city or place name by geocoding it automatically via Open-Meteo.

## Facts

- Endpoint: POST https://x402.agentutility.ai/weather-current-city
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agentutility-weather-by-city-name-493bf4de
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_NjAwT2pn5QdmxJpAgAH2F

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 agentutility-weather-by-city-name-493bf4de -d '<json body>'
```

Example prompt: What's the current weather in Tokyo, Japan? Give me the temperature in Celsius, humidity, wind speed, and include a 3-day forecast.

## When to prefer this

Prefer this endpoint when you need current weather by city or place name without knowing coordinates, especially when coordinate geocoding is inconvenient. It wraps Open-Meteo's geocoding and forecast APIs into a single call and returns a rich set of current conditions plus optional forecasts. Choose this over raw Open-Meteo if you want a simple city-name-in, weather-out interface with USDC micropayment settlement via x402.

## Known failure modes

- City name not recognized or too ambiguous — returns no match or wrong location without country_code disambiguation
- Multiple cities share the same name and no country_code provided — may return wrong city
- Open-Meteo geocoding API unavailable — upstream failure
- Invalid country_code format — may cause geocoding failure
- forecast_days out of 1-7 range — may return error or clamped result
- Network timeout from Open-Meteo backend — propagated as server error

## How this service works

Returns current weather for any city or place name, no coordinates needed. Geocodes the name with Open-Meteo, chooses the best match with optional country_code, then returns current temperature, feels-like, humidity, wind, precipitation, WMO weather code, timezone, and optional daily/hourly forecast from Open-Meteo. Use it as a city weather API or instant weather lookup by place name.

## Output

A JSON object containing the resolved location (name, admin region, latitude, longitude, country code), current conditions (temperature, apparent temperature, humidity percentage, wind speed, WMO weather code), and optionally arrays of daily or hourly forecast data. Also includes source attribution URLs for geocoding and forecast data.

## 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",
    "bodyType",
    "body"
   ],
   "properties": {
    "body": {
     "required": [
      "city"
     ],
     "properties": {
      "city": {
       "type": "string",
       "description": "City or place name, e.g. 'Paris', 'San Francisco', or 'Springfield'."
      },
      "query": {
       "type": "string",
       "description": "Alias for city."
      },
      "units": {
       "enum": [
        "metric",
        "imperial"
       ],
       "type": "string",
       "description": "Metric or imperial output units. Default metric."
      },
      "hourly": {
       "type": "boolean",
       "description": "If true, include hourly temperature, precipitation, and weather code arrays."
      },
      "country_code": {
       "type": "string",
       "description": "Optional two-letter ISO country code to disambiguate, e.g. 'US', 'FR', 'JP'."
      },
      "forecast_days": {
       "type": "number",
       "description": "Daily forecast days to include, 1-7. Default 1."
      }
     }
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST"
     ],
     "type": "string"
    },
    "bodyType": {
     "enum": [
      "json",
      "form-data",
      "text"
     ],
     "type": "string"
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "query": {
       "type": "string"
      },
      "source": {
       "type": "object",
       "properties": {
        "forecast": {
         "type": "string"
        },
        "geocoding": {
         "type": "string"
        }
       }
      },
      "current": {
       "type": "object",
       "properties": {
        "wind_speed": {
         "type": "integer"
        },
        "temperature": {
         "type": "integer"
        },
        "humidity_pct": {
         "type": "integer"
        },
        "weather_code": {
         "type": "integer"
        },
        "apparent_temperature": {
         "type": "integer"
        }
       }
      },
      "resolved_location": {
       "type": "object",
       "properties": {
        "name": {
         "type": "string"
        },

… (truncated)
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "query": "San Francisco",
  "source": {
   "forecast": "https://open-meteo.com",
   "geocoding": "https://open-meteo.com/en/docs/geocoding-api"
  },
  "current": {
   "wind_speed": 9,
   "temperature": 62,
   "humidity_pct": 78,
   "weather_code": 3,
   "apparent_temperature": 60
  },
  "resolved_location": {
   "name": "San Francisco",
   "admin1": "California",
   "latitude": 37.7749,
   "longitude": -122.4194,
   "country_code": "US"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agentutility-weather-by-city-name-493bf4de/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402.agentutility.ai](https://www.zero.xyz/host/x402.agentutility.ai/llms.txt)
