Warnings API

Returns a paginated list of unique warnings, ordered newest first.

GET/api/warningsPublic
Overview

This endpoint reads the warnings table, sorts rows bycreated_at (descending), deduplicates by id, then returns a page of results. Each item includes a display-ready date andtime derived from the warning's onset/effective time, and thearea.

Query parameters
NameTypeDefaultDescription
limitinteger50Page size. The server caps it at 100 max. (No minimum clamp is applied.)
offsetinteger0Number of items to skip (pagination). The server clamps this to 0 min.
Response schema
{
  "warnings": [
    {
      "id": "string",
      "date": "DD.MM.YYYY", // derived from onset/effective time
      "time": "HH:mm",      // derived from onset/effective time
      "area": "string"
    }
  ],
  "pagination": {
    "total": number,
    "limit": number,
    "offset": number,
    "hasMore": boolean
  }
}
Examples
curl "https://www.liukasbotti.fi/api/warnings?limit=50&offset=0"
Behavior details
  • Ordering by created_at (newest first), then deduplication by id using a server-side map.
  • date/time come from the warning's onset/effective time.
  • area falls back to an empty string if not present in the row.
Errors
StatusExample bodyWhen
500
{ "error": "Failed to fetch warnings" }
Unexpected server error.