Global Rail Platform

API Reference

LopoRail Public API — version 0.5.27. Every endpoint, its parameters and responses, rendered for humans.

Authentication Send your API key as “Authorization: Bearer <key>”. Create a key on the portal. /stations, /boards, /info, /status and /providers work without a key at the free rate limit.

Base URL: https://loporail.com/wp-json/loporail/v1

Endpoints

GET /stations

Search stations

Search stations by name, CRS code, or slug. Returns paginated results.

Parameter In Required Type
search query string
limit query integer
offset query integer

Responses: 200 Successful response · 401 · 403 · 429

GET /stations/{crs}

Get station by CRS code

Get full station details by 3-letter CRS code.

Parameter In Required Type
crs path ✓ string

Responses: 200 Station details · 404

GET /stations/tocs/{toc}

Get stations by TOC

Get all stations operated by a specific Train Operating Company.

Parameter In Required Type
toc path ✓ string

Responses: 200 Stations list

GET /boards/{crs}

Get live departure/arrival board

Get real-time departure or arrival board for a station.

Parameter In Required Type
crs path ✓ string
type query string (departures | arrivals | both)
limit query integer
window query integer
provider query string

Responses: 200 Live board data

GET /ppm/{provider}

Get PPM/Performance metrics

Get Public Performance Measure (PPM) data for a train operator.

Parameter In Required Type
provider path ✓ string

Responses: 200 PPM data

GET /positions/{provider}

Get real-time vehicle positions

Get live vehicle/train positions for a provider.

Parameter In Required Type
provider path ✓ string

Responses: 200 Vehicle positions

GET /info

API information

Get API version, status, and endpoint discovery.

Responses: 200 API info

GET /providers

Coverage & provider directory

Worldwide static station-directory scope plus the live feed sources and their verified per-source capabilities. Live coverage is not worldwide; this endpoint reports the true scope rather than an inferred one.

Responses: 200 Coverage summary and provider list

GET /openapi

Get OpenAPI specification

Download the full OpenAPI 3.x specification for this API.

Responses: 200 OpenAPI document

GET /geo/nearby

Stations within a radius of a point

Parameter In Required Type
lat query ✓ number
lng query ✓ number
radius query number

Responses: 200 Nearby stations

GET /geo/reverse

Nearest station/place to a point

Parameter In Required Type
lat query ✓ number
lng query ✓ number

Responses: 200 Nearest place

GET /status

Public API status

Responses: 200 Status + 24h metrics

GET /status/sla

Machine-readable SLA

Responses: 200 Availability + error budget

GET /postman

Postman collection

Responses: 200 Postman v2.1 collection

GET /sdk/{lang}

Starter SDK source

Parameter In Required Type
lang path ✓ string (javascript | python | php)

Responses: 200 SDK source

GET /boards/embed/{crs}

Embeddable live board (B2B)

Third-party embed variant of the live board. Origin allow-list and embed key are enforced by a security gate; no PII is returned. An HTML wrapper is served at /boards/embed/{crs}/ for iframing.

Parameter In Required Type
crs path ✓ string
type query string (departures | arrivals | both)
limit query integer
embed_key query string

Responses: 200 Board payload with meta.embed = true · 403

GET /machinery/verify

Verify rolling stock (B2B asset verification)

Look up rolling stock in the LopoRail vehicle directory by UIC class, manufacturer, operator, power type or free text. Metered by API tier; returns confidence-scored matches with technical specs.

Parameter In Required Type
uic_class query string
manufacturer query string
operator query string
power_type query string
q query string
limit query integer
page query integer

Responses: 200 Paginated matches from the vehicle directory · 401 · 429

POST /ai/livery/predict

Predict a train livery from a photo

Classifies a photo against the LopoRail livery registry using a CIE-Lab colour-dominance pipeline (CIEDE2000 ΔE matching). Returns ranked livery predictions with confidence and matched colours. The upload is fingerprinted in memory and never stored.

Responses: 200 Ranked predictions with dominant colours · 401 · 503 Prediction service unavailable

GET /ai/livery/analytics

Livery inference analytics

Aggregate accuracy, confidence distribution, latency percentiles and per-network correction rates for livery inference. Used by Mission Control; fields are optional so clients degrade per-field.

Responses: 200 Analytics payload (fields optional)

POST /assistant/draft

Draft a support reply

Drafts a reply for a HUMAN to edit and send. Never sends. Provider is OpenAI-compatible (DeepSeek by default); returns 503 while no provider is configured.

Responses: 200 Draft reply · 422 Blocked by the safety gate · 503 Assistant unavailable (no provider configured)

POST /assistant/summarise

Summarise a support thread

Summarises a conversation with optional key points. Never sends.

Responses: 200 Summary and key points · 503 Assistant unavailable (no provider configured)

Help keep this directory complete.

Know a line, place or listing we’re missing — or spotted a mistake? Add it in a minute.

ESC
Go to
↑↓ to move ↵ to open Esc to close
Advertise Sponsorship

Report a problem

Tell us what is not working or looks broken. We attach the page and your browser automatically — no need to describe the technical side.

Routed to the right desk.

Mastodon Lemmy Pixelfed