{
  "service": "swimq",
  "description": "Swimming water quality at the monitored beaches near a place, from the authorities that sample them.",
  "usage": [
    "GET /49.29,-123.14                      -- every monitored beach within 5 km, nearest first",
    "GET /?lat=49.29&lon=-123.14&within=20   -- a radius from 1 to 50 km (latitude, longitude, lng also work)",
    "GET /sites/metrovancouver:BEB-04        -- one site's report, as an answer shows it, with firstSeenAt and its events, oldest first",
    "GET /sites/metrovancouver:BEB-04.json   -- the same, as JSON even to a browser",
    "GET /events?since=2026-09-28T00:00:00Z  -- every site's events seen after since, oldest first, 500 a page",
    "GET /sources                            -- how each source is doing: last read, last pass, newest sample, season"
  ],
  "note": "Every site is one report in the same shape, whatever its source: a verdict and the newest result. Each result is the authority's own: its indicator, its statistic, its unit and its words. Each verdict says whose it is: the authority's own posting, else the authority's own limit held to a number of the same statistic, else unknown with the reason. A result older than 14 days is cut to its day.",
  "site": {
    "verdict": "level (ok, caution, avoid or unknown, swimq's scale), its category, the word that leads the row (OK, Caution, Avoid, Unknown), and its color; label, the authority's one phrase that sets the level, and detail, its other words; basis (authority: its posting; guideline: its limit held to the number; none) and by, whose words; via, words and scale, the authority's source and its words verbatim; reasonCode when unknown: out-of-season, not-sampled, not-monitored, not-read, no-posting, unknown-word or no-result; since, when this level began, where swimq's history knows.",
    "result": "The newest result: indicator, sampledOn, the day in the site's own time zone, and current, whether it's within 14 days there; count its age from sampledOn. While current: statistic, value, qualifier and unit where the authority publishes a number, or status, its word for the result, where it publishes a word instead.",
    "forecast": "NSW Beachwatch only: today's pollution forecast, issued every morning.",
    "via": "Which source the site came from, an id in sources. Credit it and verdict.via."
  },
  "events": "What changed at a site, kept since 2026-09-28 and never cut: id, kind, at, seenAt and text, a line to show as is. Kinds: sampled (a new result, with result), worsened, improved, unknown and resumed (a new level, with from, to and the verdict in full). The first sight of a site is its baseline, not an event, and swimq not reading a source is never one. /events pages by seenAt: { since, count, more, next, events }, each with subject; ask again with next as since.",
  "sources": [
    "Metro Vancouver: 41 beaches, E. coli 30-day geometric mean, May to September",
    "Vancouver Coastal Health and Fraser Health: their posting for the Metro Vancouver beaches each posts, from their beach maps",
    "City of Hamilton Public Health Services: 8 beaches, E. coli geometric mean in CFU/100 mL and whether the beach is posted, end of May to end of August",
    "NSW Beachwatch: 246 sites, the latest enterococci result as a word and a rating, and a daily pollution forecast",
    "New York State Parks: 73 park beaches, each one's status and its latest single sample, late May to mid-September"
  ],
  "freshness": "Read from each source every hour. Answers are cached 15 minutes, a site and the events a minute.",
  "auth": "None. CORS is open, so a browser can call this directly.",
  "terms": "Free, unsupported, not for volume, and as is. Not for health decisions: the authority's own posting is the record. Send a User-Agent that names your app. https://almanac.observer/#use",
  "repository": "https://github.com/gshaw/almanac/tree/main/services/swimq"
}
