Overview & Authentication
The Skogviken TIOS API is a Node.js/Express service backed by MongoDB. It tracks live train positions, timetables, station arrivals/departures, disruptions, announcements, GSM-R radio numbers, and station staffing status for the Skogviken TIOS network.
Base URL
https://api.tios.sk.polartracks.no
Protected endpoints accept either the master API key or a scoped API token. Public endpoints do not require authentication. The /status health check is public, as are read endpoints such as arrivals and departures.
For master-key access, pass the API key in the key request header:
key: <YOUR_API_KEY>
Scoped tokens use the standard bearer authorization header:
Authorization: Bearer <YOUR_TOKEN>
Bearer tokens can only access resources/actions granted in their permissions. Missing, expired, revoked, or invalid credentials receive 401 Unauthorized; a valid token without the required permission receives 403 Forbidden. Token management endpoints require the master key and do not accept bearer tokens.
Permission examples
trains:readgrants read access to train endpoints.fido:writegrants write access to FIDO endpoints.*:readgrants read access across resources;*grants all access.
Unauthenticated health check. Returns { "status": "OK" } with HTTP 200 when the API process is responding.
Response Conventions
- All responses are JSON (
Content-Type: application/json), except204 No Contentresponses, which have no body. - GET endpoints return
200 OKwith the requested object, or an array for list endpoints. Lists with no matches return[], not an error. Single-item lookups return404when the item doesn't exist. - POST create endpoints return
201 Createdwith the new object; PATCH/PUT return the updated object; DELETE returns204 No Content. - Documents stored in MongoDB include
_idand__v. Some endpoints also add anidstring copy of_id. - Dates are UTC ISO 8601 strings (e.g.
2026-10-08T06:00:00.000Z) unless an endpoint says it returns Norway local time. Scheduled times indefaultRouteare{ "hours", "minutes" }objects in Norway local time. - Errors are
{ "error": "message" }; see Error Responses. - Request bodies must be sent as JSON with
Content-Type: application/json.
Rate Limits
All endpoints, including public ones, are rate limited per one-minute window. The limit depends on how the request is authenticated:
| Caller | Limit | Counted per |
|---|---|---|
Master API key (key header) | No limit | – |
| Valid bearer token | 200 requests / minute | Token |
| No credentials (or invalid, expired, or revoked token) | 20 requests / minute | IP address |
When the limit is exceeded, the API responds with 429 Too Many Requests and the body:
{ "error": "Too many requests" }
Every response includes the standard RateLimit-Limit, RateLimit-Remaining, and RateLimit-Reset headers so clients can track their remaining quota. Counters are held in memory and reset when the API restarts.