City weather report API
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. If both city and coordinates are sent, coordinates win. Does not include air quality or sunrise/sunset. POST /api/v1/weather/report costs $0.002 USDC on Base via x402. HTTP 2xx with status complete or partial and real data is charged; status failed, empty payloads, and HTTP 4xx/5xx are not charged. Sources: MET Norway Locationforecast 2.0 and Sunrise 3.0 (CC BY 4.0) GeoNames cities dump (CC BY 4.0) US National Weather Service alerts API Limits: Not a severe-weather warning service or health diagnosis. Air quality is not included.
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. If both city and coordinates are sent, coordinates win. Does not include air quality or sunrise/sunset. POST /api/v1/weather/report costs $0.002 USDC on Base via x402. HTTP 2xx with status complete or partial and real data is charged; status failed, empty payloads, and HTTP 4xx/5xx are not charged. Sources: MET Norway Locationforecast 2.0 and Sunrise 3.0 (CC BY 4.0) GeoNames cities dump (CC BY 4.0) US National Weather Service alerts API Limits: Not a severe-weather warning service or health diagnosis. Air quality is not included.
/api/v1/weather/reportExample request
curl -i -X POST "https://www.brainiac.software/api/v1/weather/report" \
-H 'content-type: application/json' \
-H 'Idempotency-Key: <fresh-64-character-random-hex-key>' \
--data-binary @- <<'JSON'
{
"city": "London",
"countryCode": "GB"
}
JSONExample response
{
"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": []
}An unpaid probe returns HTTP 402 with x402 payment requirements. After paying the exact USDC amount on Base, retry the identical request with a payment-signature header.
Errors: HTTP 4xx/5xx are not charged. HTTP 2xx with status complete or partial and real data is charged; failed or empty results are not charged. Invalid cursor returns HTTP 400 (uncharged).
Limits: Not a severe-weather warning service or health diagnosis. Air quality is not included. When both city and coordinates are sent, coordinates win and city is not geocoded.
FAQ
- Do I need an API key? No. Pay the listed USDC amount with x402.
- What network? Base (eip155:8453), USDC.
- Is this an official determination? No. Results are for human review against the cited sources.
Related operations
- Sunrise and sunset — $0.002 USDC
- US NWS weather alerts — $0.002 USDC
Related APIs
- Building Energy & Facilities Intelligence API
- Electricity Market & Grid Intelligence API
- Electrical Engineering & Installation Intelligence API
MET Norway City Weather Sunrise NWS Alerts API APIGroup docsHow it works