Realtime/SL

Get alert

One alert by feed entity id.

GET /api/alerts/:id

Alerts have no natural key in GTFS-realtime, so the id is the feed entity id, prefixed with the file it came from — for example sl-service-alerts.pb:14050001800799847. It is stable for as long as the agency keeps publishing that entity, and no longer.

Try it

Runs from your browser against the API in .

Path

Query

GET
curl equivalent
 

Parameters

Path

ParameterTypeDefaultDescription
idrequiredpathstring

Feed entity id.

Query

ParameterTypeDefaultDescription
attimestampnow

The instant to evaluate activePeriods against, as epoch seconds or ISO 8601. Sets isActive on every alert returned.

langstring

Language tag used to pick among an alert's translations. Matches an exact tag first (en-GB), then the base language (en), then an untagged translation, then whatever came first.

Inert in this capture. None of the 177 alerts tag their translations with a language, so every request falls through to the untagged translation regardless of what you pass.

Response

A single object under data, with no meta.

GET /api/alerts/sl-service-alerts.pb:14050001800799847
curl "$API_BASE/api/alerts/sl-service-alerts.pb:14050001800799847"
200 · application/json
{
  "data": {
    "id": "sl-service-alerts.pb:14050001800799847",
    "activePeriods": [
      {
        "start": {
          "epoch": 1743746928,
          "iso": "2025-04-04T06:08:48.000Z"
        },
        "end": {
          "epoch": 1817157543,
          "iso": "2027-08-01T21:59:03.000Z"
        }
      }
    ],
    "informedEntities": [
      {
        "stopId": "9022050009805001",
        "stop": {
          "stopId": "9022050009805001",
          "name": "Himlabacken",
          "latitude": 59.376235,
          "longitude": 18.048877,
          "locationType": 0,
          "parentStation": "9805",
          "platformCode": "1"
        }
      },
      {
        "stopId": "9022050009805001",
        "stop": {
          "stopId": "9022050009805001",
          "name": "Himlabacken",
          "latitude": 59.376235,
          "longitude": 18.048877,
          "locationType": 0,
          "parentStation": "9805",
          "platformCode": "1"
        }
      }
    ],
    "cause": "CONSTRUCTION",
    "effect": "UNKNOWN_EFFECT",
    "headerText": {
      "text": "Hållplats Himlabacken flyttad",
      "translations": [
        {
          "text": "Hållplats Himlabacken flyttad"
        }
      ]
    },
    "descriptionText": {
      "text": "Hållplats Himlabacken är flyttad 90 meter Ulriksdal i färdriktningen för buss linje 503 mot (Ulriksdals begravnpl-) Ulriksdals st-Ö Bergshamra och 503 mot Ö Bergshamra-Ulriksdals stn-(Ulriksdals begravnpl) från och med 2025-04-01 pga vägarbete.\nDetta planeras pågå till och med 2027-08-01.",
      "translations": [
        {
          "text": "Hållplats Himlabacken är flyttad 90 meter Ulriksdal i färdriktningen för buss linje 503 mot (Ulriksdals begravnpl-) Ulriksdals st-Ö Bergshamra och 503 mot Ö Bergshamra-Ulriksdals stn-(Ulriksdals begravnpl) från och med 2025-04-01 pga vägarbete.\nDetta planeras pågå till och med 2027-08-01."
        }
      ]
    },
    "isActive": true
  }
}

Errors

404
{ "error": "request_failed", … }

No alert carries that id.