# City Weather API > Current conditions and multi-day forecast via MET Norway Locationforecast, sunrise/sunset via MET Sunrise, and US NWS alerts. City geocoding uses a bundled GeoNames dump. Each paid operation uses a fixed USDC price on Base with the x402 exact scheme. Unpaid GET, HEAD, and POST return 402 payment terms (POST validates the body only after payment terms are satisfied). A request that carries payment-signature is not yet charged: settlement happens only after a successful (2xx) result that returns real data (status complete or partial). HTTP 4xx/5xx and coverage status failed or empty payloads are not charged. Settled 2xx responses include a payment-response header; uncharged responses do not. Follow https://www.brainiac.software/agent-instructions.txt for install, payment pins, idempotency, and billing rules. - Product: https://www.brainiac.software/api/weather - Docs: https://www.brainiac.software/api/weather/docs - OpenAPI: https://www.brainiac.software/api/weather/openapi.json - Contact: support@brainiac.software (https://www.brainiac.software/contact) ## Operations ### POST /api/v1/weather/report $0.002 USDC. Current conditions and a multi-day forecast for a city or coordinates via MET Norway Locationforecast 2.0, with city geocoding from a bundled GeoNames dump. Keywords: weather report, MET Norway, forecast, GeoNames, temperature, wind, precipitation, no AQI Inputs: city?, countryCode?, latitude?, longitude?, timezone?, temperatureUnit?, windSpeedUnit?, precipitationUnit?, forecastDays? Docs: https://www.brainiac.software/api/weather/report Example request: ```json { "city": "London", "countryCode": "GB" } ``` Example response: ```json { "status": "complete", "retrievedAt": "2026-11-20T21:30:00.000Z", "source": { "name": "Open-Meteo", "attribution": "Weather data by Open-Meteo.com", "license": "CC BY 4.0", "licenseUrl": "https://creativecommons.org/licenses/by/4.0/" }, "location": { "name": "London", "country": "United Kingdom", "countryCode": "GB", "admin1": "England", "latitude": 51.50853, "longitude": -0.12574, "elevationM": 25, "timezone": "Europe/London" }, "units": { "temperature": "celsius", "windSpeed": "kmh", "precipitation": "mm" }, "current": { "time": "2026-11-20T21:30", "temperature": 8.2, "apparentTemperature": 7.1, "relativeHumidity": 60, "weatherCode": 3, "weatherText": "Overcast", "cloudCover": 100, "precipitation": 0, "windSpeed": 3.2, "windDirection": 40, "windGusts": 8, "pressureMsl": 1018.4 }, "hourly": [ { "time": "2026-11-20T22:00", "temperature": 7.9, "precipitationProbability": 10, "precipitation": 0, "weatherCode": 3, "windSpeed": 3, "relativeHumidity": 62, "cloudCover": 100, "uvIndex": 0 }, { "time": "2026-11-20T23:00", "temperature": 7.6, "precipitationProbability": 10, "precipitation": 0, "weatherCode": 3, "windSpeed": 2.8, "relativeHumidity": 64, "cloudCover": 98, "uvIndex": 0 } ], "daily": [ { "date": "2026-11-20", "weatherCode": 3, "weatherText": "Overcast", "temperatureMax": 9.5, "temperatureMin": 4.2, "precipitationSum": 0.2, "precipitationProbabilityMax": 20, "windSpeedMax": 14, "uvIndexMax": 1.2, "sunrise": "2026-11-20T07:27", "sunset": "2026-11-20T16:07" }, { "date": "2026-11-21", "weatherCode": 61, "weatherText": "Slight rain", "temperatureMax": 8.1, "temperatureMin": 3.8, "precipitationSum": 2.4, "precipitationProbabilityMax": 70, "windSpeedMax": 18, "uvIndexMax": 1, "sunrise": "2026-11-21T07:29", "sunset": "2026-11-21T16:06" } ], "airQuality": { "current": { "time": "2026-11-20T21:00", "europeanAqi": 63, "usAqi": 52, "pm25": 13.9, "pm10": 18.4 }, "hourly": [ { "time": "2026-11-20T21:00", "europeanAqi": 63, "usAqi": 52, "pm25": 13.9, "pm10": 18.4 }, { "time": "2026-11-20T22:00", "europeanAqi": 62, "usAqi": 51, "pm25": 13.5, "pm10": 18 } ] }, "unavailable": [], "missing_items": [] } ``` ### POST /api/v1/weather/sunrise $0.002 USDC. Official MET Norway Sunrise 3.0 sunrise, sunset, and solar noon for a city or coordinates. Keywords: sunrise, sunset, solar noon, MET Norway, daylight, GeoNames Inputs: city?, countryCode?, latitude?, longitude?, timezone?, temperatureUnit?, windSpeedUnit?, precipitationUnit?, forecastDays?, date? Docs: https://www.brainiac.software/api/weather/sunrise Example request: ```json { "city": "Oslo", "countryCode": "NO", "date": "2026-11-21" } ``` Example response: ```json { "status": "complete", "location": { "name": "Oslo", "countryCode": "NO", "latitude": 59.91, "longitude": 10.75, "timezone": "Europe/Oslo" }, "date": "2026-11-21", "sunrise": "2026-11-21T07:28:00+00:00", "sunset": "2026-11-21T14:36:00+00:00", "solarNoon": "2026-11-21T11:02:00+00:00", "source": "MET Norway Sunrise 3.0", "attribution": "Data from MET Norway", "license": "CC BY 4.0", "missing_items": [] } ``` ### POST /api/v1/weather/us-alerts $0.002 USDC. Active US National Weather Service watches, warnings, and advisories for a US point or city from the official NWS API. Keywords: NWS, weather alerts, warnings, watches, advisories, api.weather.gov Inputs: city?, countryCode?, latitude?, longitude?, timezone?, temperatureUnit?, windSpeedUnit?, precipitationUnit?, forecastDays? Docs: https://www.brainiac.software/api/weather/us-alerts Example request: ```json { "latitude": 38.8977, "longitude": -77.0365 } ``` Example response: ```json { "status": "complete", "location": { "name": "Washington", "countryCode": "US", "latitude": 38.8977, "longitude": -77.0365 }, "alerts": [], "source": "US National Weather Service", "sourceUrl": "https://api.weather.gov/alerts/active", "asOf": "2026-11-20T23:20:00.000Z", "missing_items": [] } ```