Weather Alerts API

Warn players without repeating the storm.

Games can read the same public-safe weather notice shown across Mudhaven, compare its stable revision, and announce each new alert once.

GET
01

Endpoint

Read the hosting-area state

GEThttps://mudhaven.net/api/v1/weather/alerts

No token is required. The feed describes weather affecting Mudhaven's hosting area—not the game owner or player's location.

curl --fail-with-body --silent --show-error \
  https://mudhaven.net/api/v1/weather/alerts
02

State machine

Handle all four statuses

active

An alert is available. Announce it only when its revision is new.

clear

A fresh successful monitor found no eligible active alert.

suppressed

Staff paused public weather messaging. This is not an all-clear.

unavailable

Current monitoring cannot be confirmed. This is not an all-clear.

03

Response

Active alert example

{
  "ok": true,
  "status": "active",
  "active": true,
  "fresh": true,
  "revision": "64-character-sha256-revision",
  "message": "Severe weather is affecting Mudhaven's hosting area.",
  "alert": {
    "kind": "automatic",
    "tone": "danger",
    "label": "Hosting-area weather warning",
    "event": "Severe Thunderstorm Warning",
    "headline": "Severe Thunderstorm Warning issued until 1:00PM EDT by NWS",
    "message": "Severe weather is affecting Mudhaven's hosting area.",
    "severity": "Severe",
    "urgency": "Immediate",
    "certainty": "Observed",
    "starts_at": "2026-08-11T12:00:00-04:00",
    "expires_at": "2026-08-11T13:00:00-04:00",
    "source_url": "https://api.weather.gov/alerts/example"
  },
  "generated_at": "2026-08-11T12:01:00-04:00",
  "recommended_poll_seconds": 300
}
04

Announcement logic

Compare revisions before broadcasting

if payload.status == "active" and payload.revision != last_revision:
    broadcast(payload.alert.headline)
    broadcast(payload.alert.message)
    last_revision = payload.revision

Poll no faster than recommended_poll_seconds, normally 300 seconds. Keep the old revision after a timeout, invalid JSON, suppression, or unavailable response. A game may optionally announce an active-to-clear transition once.

05

Dream Maker

BYOND announcement example

var/const/MUDHAVEN_WEATHER_URL = "https://mudhaven.net/api/v1/weather/alerts"
var/mudhaven_weather_revision = null

/proc/check_mudhaven_weather()
    set waitfor = FALSE

    var/list/response = world.Export(MUDHAVEN_WEATHER_URL)
    if(!islist(response) || !response["CONTENT"])
        return

    var/list/payload = json_decode(file2text(response["CONTENT"]))
    if(!islist(payload) || payload["status"] != "active")
        return

    var/revision = payload["revision"]
    if(!revision || revision == mudhaven_weather_revision)
        return

    var/list/alert = payload["alert"]
    if(!islist(alert))
        return

    mudhaven_weather_revision = revision
    var/headline = alert["headline"]
    var/message = alert["message"]
    world << "<b>Hosting weather:</b> [html_encode(headline)] — [html_encode(message)]"
06

Privacy boundary

Public notice, private location

The response may contain safe banner copy, alert classification, official times, and an HTTPS weather.gov link. It never contains the monitoring ZIP code, coordinates, geometry, area description, official instructions, suppression reason, provider failure details, response bodies, or credentials.

Staff notices use the same contract.

A manual staff weather notice has alert.kind = manual and takes priority over an automatic alert until it expires or staff clears it.