{"openapi":"3.1.0","info":{"title":"City Weather API","version":"1.0.0","description":"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. Paid with x402 exact USDC on Base. No account is required.","contact":{"email":"support@brainiac.software"},"x-guidance":"BRAINIAC.software is a pay-per-call API for software agents. No account or API key is required.\nThis root OpenAPI is a token-light discovery index. Full request/response schemas and examples are at /api/{group}/openapi.json; x-api-groups lists every group URL.\nPayment uses x402 with exact USDC on Base (8453). Unpaid GET/HEAD/POST return 402 payment terms for discovery.\nHow to call: POST JSON → verify payTo/asset/network against /api/v1/catalog and /.well-known/x402 → pay and retry with payment-signature. Settlement only on HTTP 2xx.\nIdempotency-Key: 64 hex chars. Coverage HTTP 2xx with status complete|partial and real data is charged; failed or empty results are not charged. Free lookup: GET /api/v1/results/{result_id}.\nOutputs are drafts for human review — not official determinations or legal advice."},"servers":[{"url":"https://www.brainiac.software"}],"paths":{"/api/v1/weather/report":{"post":{"operationId":"weather_report","summary":"City weather report","description":"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. Docs: https://www.brainiac.software/api/weather/report","externalDocs":{"url":"https://www.brainiac.software/api/weather/report"},"tags":["weather","forecast","MET Norway","GeoNames","city weather","weather report","temperature","wind","precipitation","no AQI"],"x-keywords":["weather report","MET Norway","forecast","GeoNames","temperature","wind","precipitation","no AQI"],"x-empty-json-probe":false,"x-probe-body":{"city":"London","countryCode":"GB"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"city":{"type":"string","minLength":1,"maxLength":120},"countryCode":{"type":"string","minLength":2,"maxLength":2},"latitude":{"type":"number","minimum":-90,"maximum":90},"longitude":{"type":"number","minimum":-180,"maximum":180},"timezone":{"type":"string","minLength":1,"maxLength":64},"temperatureUnit":{"type":"string","enum":["celsius","fahrenheit"]},"windSpeedUnit":{"type":"string","enum":["kmh","ms","mph","kn"]},"precipitationUnit":{"type":"string","enum":["mm","inch"]},"forecastDays":{"type":"integer","minimum":1,"maximum":9}},"additionalProperties":false,"minProperties":1},"example":{"city":"London","countryCode":"GB"}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"200":{"description":"JSON result. A settled 2xx includes payment-response. Settlement is only for HTTP 2xx with status complete or partial and real data; status failed or empty payloads return non-2xx and are not charged.","headers":{"payment-response":{"$ref":"#/components/headers/PaymentResponse"}},"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string"},"retrievedAt":{"type":"string"},"source":{"type":"object","properties":{"name":{"type":"string"},"attribution":{"type":"string"},"license":{"type":"string"},"licenseUrl":{"type":"string"}},"additionalProperties":true},"location":{"type":"object","properties":{"name":{"type":"string"},"country":{"type":"string"},"countryCode":{"type":"string"},"admin1":{"type":"string"},"latitude":{"type":"number"},"longitude":{"type":"number"},"elevationM":{"type":"number"},"timezone":{"type":"string"}},"additionalProperties":true},"units":{"type":"object","properties":{"temperature":{"type":"string"},"windSpeed":{"type":"string"},"precipitation":{"type":"string"}},"additionalProperties":true},"current":{"type":"object","properties":{"time":{"type":"string"},"temperature":{"type":"number"},"apparentTemperature":{"type":"number"},"relativeHumidity":{"type":"number"},"weatherCode":{"type":"number"},"weatherText":{"type":"string"},"cloudCover":{"type":"number"},"precipitation":{"type":"number"},"windSpeed":{"type":"number"},"windDirection":{"type":"number"},"windGusts":{"type":"number"},"pressureMsl":{"type":"number"}},"additionalProperties":true},"hourly":{"type":"array","items":{"type":"object","properties":{"time":{"type":"string"},"temperature":{"type":"number"},"precipitationProbability":{"type":"number"},"precipitation":{"type":"number"},"weatherCode":{"type":"number"},"windSpeed":{"type":"number"},"relativeHumidity":{"type":"number"},"cloudCover":{"type":"number"},"uvIndex":{"type":"number"}},"additionalProperties":true}},"daily":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"weatherCode":{"type":"number"},"weatherText":{"type":"string"},"temperatureMax":{"type":"number"},"temperatureMin":{"type":"number"},"precipitationSum":{"type":"number"},"precipitationProbabilityMax":{"type":"number"},"windSpeedMax":{"type":"number"},"uvIndexMax":{"type":"number"},"sunrise":{"type":"string"},"sunset":{"type":"string"}},"additionalProperties":true}},"airQuality":{"type":"object","properties":{"current":{"type":"object","properties":{"time":{"type":"string"},"europeanAqi":{"type":"number"},"usAqi":{"type":"number"},"pm25":{"type":"number"},"pm10":{"type":"number"}},"additionalProperties":true},"hourly":{"type":"array","items":{"type":"object","properties":{"time":{"type":"string"},"europeanAqi":{"type":"number"},"usAqi":{"type":"number"},"pm25":{"type":"number"},"pm10":{"type":"number"}},"additionalProperties":true}}},"additionalProperties":true},"unavailable":{"type":"array","items":{}},"missing_items":{"type":"array","items":{}}},"additionalProperties":true},"example":{"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":[]}}}},"400":{"$ref":"#/components/responses/InvalidRequest"},"402":{"$ref":"#/components/responses/PaymentRequired"},"409":{"$ref":"#/components/responses/IdempotencyConflict"},"413":{"$ref":"#/components/responses/RequestTooLarge"},"500":{"$ref":"#/components/responses/OperationFailed"},"502":{"$ref":"#/components/responses/SettlementUnknown"},"503":{"$ref":"#/components/responses/PaymentsUnavailable"}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.002"},"protocols":[{"x402":{"facilitator":"https://api.cdp.coinbase.com/platform/v2/x402"}}],"facilitator":"https://api.cdp.coinbase.com/platform/v2/x402"}}},"/api/v1/weather/sunrise":{"post":{"operationId":"weather_sunrise","summary":"Sunrise and sunset","description":"Official MET Norway Sunrise 3.0 sunrise, sunset, and solar noon for a city or coordinates. Docs: https://www.brainiac.software/api/weather/sunrise","externalDocs":{"url":"https://www.brainiac.software/api/weather/sunrise"},"tags":["weather","sunrise","sunset","MET Norway","solar noon","daylight","GeoNames"],"x-keywords":["sunrise","sunset","solar noon","MET Norway","daylight","GeoNames"],"x-empty-json-probe":false,"x-probe-body":{"city":"Oslo","countryCode":"NO","date":"2026-11-21"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"city":{"type":"string","minLength":1,"maxLength":120},"countryCode":{"type":"string","minLength":2,"maxLength":2},"latitude":{"type":"number","minimum":-90,"maximum":90},"longitude":{"type":"number","minimum":-180,"maximum":180},"timezone":{"type":"string","minLength":1,"maxLength":64},"temperatureUnit":{"type":"string","enum":["celsius","fahrenheit"]},"windSpeedUnit":{"type":"string","enum":["kmh","ms","mph","kn"]},"precipitationUnit":{"type":"string","enum":["mm","inch"]},"forecastDays":{"type":"integer","minimum":1,"maximum":9},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"additionalProperties":false,"minProperties":1},"example":{"city":"Oslo","countryCode":"NO","date":"2026-11-21"}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"200":{"description":"JSON result. A settled 2xx includes payment-response. Settlement is only for HTTP 2xx with status complete or partial and real data; status failed or empty payloads return non-2xx and are not charged.","headers":{"payment-response":{"$ref":"#/components/headers/PaymentResponse"}},"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string"},"location":{"type":"object","properties":{"name":{"type":"string"},"countryCode":{"type":"string"},"latitude":{"type":"number"},"longitude":{"type":"number"},"timezone":{"type":"string"}},"additionalProperties":true},"date":{"type":"string"},"sunrise":{"type":"string"},"sunset":{"type":"string"},"solarNoon":{"type":"string"},"source":{"type":"string"},"attribution":{"type":"string"},"license":{"type":"string"},"missing_items":{"type":"array","items":{}}},"additionalProperties":true},"example":{"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":[]}}}},"400":{"$ref":"#/components/responses/InvalidRequest"},"402":{"$ref":"#/components/responses/PaymentRequired"},"409":{"$ref":"#/components/responses/IdempotencyConflict"},"413":{"$ref":"#/components/responses/RequestTooLarge"},"500":{"$ref":"#/components/responses/OperationFailed"},"502":{"$ref":"#/components/responses/SettlementUnknown"},"503":{"$ref":"#/components/responses/PaymentsUnavailable"}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.002"},"protocols":[{"x402":{"facilitator":"https://api.cdp.coinbase.com/platform/v2/x402"}}],"facilitator":"https://api.cdp.coinbase.com/platform/v2/x402"}}},"/api/v1/weather/us-alerts":{"post":{"operationId":"weather_us_alerts","summary":"US NWS weather alerts","description":"Active US National Weather Service watches, warnings, and advisories for a US point or city from the official NWS API. Docs: https://www.brainiac.software/api/weather/us-alerts","externalDocs":{"url":"https://www.brainiac.software/api/weather/us-alerts"},"tags":["weather","NWS","weather alerts","warnings","watches","US weather","advisories","api.weather.gov"],"x-keywords":["NWS","weather alerts","warnings","watches","advisories","api.weather.gov"],"x-empty-json-probe":false,"x-probe-body":{"latitude":38.8977,"longitude":-77.0365},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"city":{"type":"string","minLength":1,"maxLength":120},"countryCode":{"type":"string","minLength":2,"maxLength":2},"latitude":{"type":"number","minimum":-90,"maximum":90},"longitude":{"type":"number","minimum":-180,"maximum":180},"timezone":{"type":"string","minLength":1,"maxLength":64},"temperatureUnit":{"type":"string","enum":["celsius","fahrenheit"]},"windSpeedUnit":{"type":"string","enum":["kmh","ms","mph","kn"]},"precipitationUnit":{"type":"string","enum":["mm","inch"]},"forecastDays":{"type":"integer","minimum":1,"maximum":9}},"additionalProperties":false,"minProperties":1},"example":{"latitude":38.8977,"longitude":-77.0365}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"200":{"description":"JSON result. A settled 2xx includes payment-response. Settlement is only for HTTP 2xx with status complete or partial and real data; status failed or empty payloads return non-2xx and are not charged.","headers":{"payment-response":{"$ref":"#/components/headers/PaymentResponse"}},"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string"},"location":{"type":"object","properties":{"name":{"type":"string"},"countryCode":{"type":"string"},"latitude":{"type":"number"},"longitude":{"type":"number"}},"additionalProperties":true},"alerts":{"type":"array","items":{}},"source":{"type":"string"},"sourceUrl":{"type":"string"},"asOf":{"type":"string"},"missing_items":{"type":"array","items":{}}},"additionalProperties":true},"example":{"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":[]}}}},"400":{"$ref":"#/components/responses/InvalidRequest"},"402":{"$ref":"#/components/responses/PaymentRequired"},"409":{"$ref":"#/components/responses/IdempotencyConflict"},"413":{"$ref":"#/components/responses/RequestTooLarge"},"500":{"$ref":"#/components/responses/OperationFailed"},"502":{"$ref":"#/components/responses/SettlementUnknown"},"503":{"$ref":"#/components/responses/PaymentsUnavailable"}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.002"},"protocols":[{"x402":{"facilitator":"https://api.cdp.coinbase.com/platform/v2/x402"}}],"facilitator":"https://api.cdp.coinbase.com/platform/v2/x402"}}}},"components":{"parameters":{"IdempotencyKey":{"name":"Idempotency-Key","in":"header","required":true,"description":"Fresh random 32-byte value encoded as 64 hexadecimal characters. Reuse unchanged only for retries of the same operation and request.","schema":{"type":"string","pattern":"^[0-9a-fA-F]{64}$"}}},"headers":{"PaymentResponse":{"description":"Present on settled 2xx only. Facilitator settlement receipt for the x402 payment (not present on 4xx/5xx, which are not charged).","schema":{"type":"string"}}},"responses":{"InvalidRequest":{"description":"Invalid JSON or request schema. Not charged (no payment-response). If this 400 is returned before the Idempotency-Key is reserved, the key is not stored — fix the body and you may reuse the key. If an operation-path 400 was stored after a payment-signature was attached, the same key + same body replays it; the same key + a different body returns 409."},"PaymentRequired":{"description":"Payment required. The JSON body is the x402 PaymentRequired object. An unpaid 402 does not store the Idempotency-Key. A 402 after payment-signature releases the key and includes prior-payment-attempt (nonce, settled false|unknown). Not charged; no payment-response. Before re-signing after a post-signature 402, check USDC authorizationState(payer, nonce) on Base."},"IdempotencyConflict":{"description":"Idempotency conflict, in-progress payment, or expired result cache. Same key with a different body after a stored result returns conflict. Reusing the key cannot trigger a second charge. Not charged when settlement did not occur."},"RequestTooLarge":{"description":"Request body exceeds the 24 MB limit. Not charged."},"SettlementUnknown":{"description":"Facilitator verify/settle transport failure (often timeout). After payment-signature this is returned as SETTLEMENT_UNKNOWN with prior-payment-attempt; the outcome is stored under the Idempotency-Key. With the shared store configured, other instances replay it instead of settling again; without it, each instance keeps its own memory. The authorization may already be settled on-chain — do not re-sign until USDC authorizationState(payer, nonce) on Base is false."},"PaymentsUnavailable":{"description":"Payment or retry-safe result storage is unavailable; the operation is not run. Not charged; no payment-response. A 503 after payment-signature releases the Idempotency-Key and includes prior-payment-attempt."},"OperationFailed":{"description":"Operation failed before settlement, so no payment is taken (no payment-response). The error is stored: reuse the same Idempotency-Key and body to retrieve it without paying again. Use a new key for a fresh attempt with a new payment-signature."}},"schemas":{"ApiError":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{}}}}}}}}