Developer Documentation

LobbyTrain API

Integrate real-time train data into your applications. Our API supports multi-display architecture - manage multiple displays with individual configurations.

RESTful API
Real-time Data
Secure & Reliable

Quick Start

1

Get API Key

API access is available on the Premium plan. Generate your API key in the portal.

2

Make Request

Include your API key in the X-API-Key header and make requests to our endpoints.

3

Get Data

Receive JSON responses with train data, configurations, and weather information.

Authentication

All API requests require authentication using an API key. Include your key in the X-API-Key header:

X-API-Key: lt_live_xxxxxxxxxxxx

API keys are available exclusively for Premium plan subscribers.Upgrade to Premium

Code Examples

# List all displays
curl -X GET "https://www.lobbytrain.com/api/v1/displays" \
  -H "X-API-Key: lt_live_your_api_key_here"

# Get trains for a specific display
curl -X GET "https://www.lobbytrain.com/api/v1/displays/{displayId}/trains" \
  -H "X-API-Key: lt_live_your_api_key_here"

# Get departures by station
curl -X GET "https://www.lobbytrain.com/api/v1/departures/DB/8011160?results=20" \
  -H "X-API-Key: lt_live_your_api_key_here"

API Endpoints

All endpoints use the base URL https://www.lobbytrain.com/api/v1

Displays

GET/api/v1/displays

List all displays for your hotel

Response

{
  "success": true,
  "displays": [
    {
      "id": "d1a2b3c4-5678-90ab-cdef-1234567890ab",
      "name": "Lobby Main Display",
      "hotelName": "Grand Hotel Vienna",
      "displayMode": "tv",
      "stationId": "8011160",
      "trainType": "departures",
      "isActive": true,
      "lastSeenAt": "2024-01-15T09:55:00Z",
      "createdAt": "2024-01-01T00:00:00Z"
    }
  ]
}
GET/api/v1/displays/{displayId}

Get detailed configuration for a specific display

Parameters

NameTypeRequiredDescription
displayIdstringYesUnique display identifier (UUID)

Response

{
  "success": true,
  "display": {
    "id": "d1a2b3c4-5678-90ab-cdef-1234567890ab",
    "name": "Lobby Main Display",
    "hotelName": "Grand Hotel Vienna",
    "displayMode": "tv",
    "stationId": "8011160",
    "provider": "DB",
    "trainType": "departures",
    "logoUrl": "https://...",
    "theme": {
      "primary": "#B91C1C",
      "secondary": "#F59E0B"
    },
    "refreshInterval": 300,
    "timeFormat": "24h",
    "timezone": "Europe/Vienna",
    "showWeather": true,
    "languages": ["de", "en"],
    "isActive": true
  }
}
GET/api/v1/displays/{displayId}/trains

Get trains for a specific display based on its configured station

Parameters

NameTypeRequiredDescription
displayIdstringYesUnique display identifier (UUID)
typestringNoOverride train type: "departures" or "arrivals"

Response

{
  "success": true,
  "data": [
    {
      "tripId": "1|123456|0|80|15012024",
      "line": {
        "name": "ICE 501",
        "product": "nationalExpress",
        "operator": "DB Fernverkehr"
      },
      "departure": {
        "scheduled": "2024-01-15T10:00:00Z",
        "platform": "3",
        "delay": 0
      },
      "destination": {
        "name": "Frankfurt Hbf"
      },
      "status": "on-time"
    }
  ],
  "station": "Berlin Hbf",
  "stationId": "8011160",
  "trainType": "departures",
  "displayId": "d1a2b3c4-...",
  "displayName": "Lobby Main Display",
  "cachedAt": "2024-01-15T09:55:00Z"
}
GET/api/v1/displays/{displayId}/analytics

Get analytics data for a specific display

Parameters

NameTypeRequiredDescription
displayIdstringYesUnique display identifier (UUID)
startDatestringNoStart date (ISO format, default: 7 days ago)
endDatestringNoEnd date (ISO format, default: today)

Response

{
  "success": true,
  "analytics": {
    "displayId": "d1a2b3c4-...",
    "displayName": "Lobby Main Display",
    "displayMode": "tv",
    "period": {
      "startDate": "2024-01-08",
      "endDate": "2024-01-15"
    },
    "metrics": {
      "totalViews": 1234,
      "totalSearches": 89,
      "totalInteractions": 256,
      "uptimePercentage": 99.2,
      "errorCount": 3
    },
    "dailyStats": [...]
  }
}

Trains

GET/api/v1/departures/{provider}/{stationId}

Get train departures by provider and station ID

Parameters

NameTypeRequiredDescription
providerstringYesProvider code: DB, OEBB, or SBB
stationIdstringYesStation ID (e.g., 8011160 for Berlin Hbf)
resultsnumberNoNumber of results (default: 20, max: 50)

Response

{
  "success": true,
  "data": [
    {
      "tripId": "1|123456|0|80|15012024",
      "line": {
        "name": "ICE 501",
        "product": "nationalExpress",
        "operator": "DB Fernverkehr"
      },
      "departure": {
        "scheduled": "2024-01-15T10:00:00Z",
        "platform": "3",
        "delay": 0
      },
      "destination": {
        "name": "Frankfurt Hbf"
      },
      "status": "on-time"
    }
  ],
  "station": "Berlin Hbf",
  "provider": "DB",
  "type": "departures",
  "cachedAt": "2024-01-15T09:55:00Z"
}
GET/api/v1/arrivals/{provider}/{stationId}

Get train arrivals by provider and station ID

Parameters

NameTypeRequiredDescription
providerstringYesProvider code: DB, OEBB, or SBB
stationIdstringYesStation ID (e.g., 8011160 for Berlin Hbf)
resultsnumberNoNumber of results (default: 20, max: 50)

Response

{
  "success": true,
  "data": [
    {
      "tripId": "1|654321|0|80|15012024",
      "line": {
        "name": "ICE 502",
        "product": "nationalExpress",
        "operator": "DB Fernverkehr"
      },
      "arrival": {
        "scheduled": "2024-01-15T10:30:00Z",
        "platform": "5",
        "delay": 5
      },
      "origin": {
        "name": "Munich Hbf"
      },
      "status": "delayed"
    }
  ],
  "station": "Berlin Hbf",
  "provider": "DB",
  "type": "arrivals",
  "cachedAt": "2024-01-15T09:55:00Z"
}

Stations

GET/api/v1/stations/search

Search for stations by name

Parameters

NameTypeRequiredDescription
querystringYesSearch query (min 2 characters)
providerstringNoFilter by provider: DB, OEBB, or SBB
limitnumberNoNumber of results (default: 10, max: 50)

Response

{
  "success": true,
  "data": [
    {
      "id": "8011160",
      "name": "Berlin Hbf",
      "provider": "DB",
      "location": {
        "latitude": 52.525,
        "longitude": 13.369
      }
    },
    {
      "id": "8010205",
      "name": "Berlin Ostbahnhof",
      "provider": "DB",
      "location": {
        "latitude": 52.510,
        "longitude": 13.434
      }
    }
  ]
}

Providers

GET/api/v1/providers

List all available train data providers

Response

{
  "success": true,
  "providers": [
    {
      "code": "DB",
      "name": "Deutsche Bahn",
      "country": "Germany",
      "features": ["departures", "arrivals", "realtime"]
    },
    {
      "code": "OEBB",
      "name": "ÖBB",
      "country": "Austria",
      "features": ["departures", "arrivals", "realtime"]
    },
    {
      "code": "SBB",
      "name": "SBB",
      "country": "Switzerland",
      "features": ["departures", "arrivals", "realtime"]
    }
  ]
}

Analytics

GET/api/v1/analytics

Get analytics overview for all displays of your hotel

Parameters

NameTypeRequiredDescription
startDatestringNoStart date (ISO format, default: 7 days ago)
endDatestringNoEnd date (ISO format, default: today)

Response

{
  "success": true,
  "analytics": {
    "hotelId": "h1a2b3c4-...",
    "period": {
      "startDate": "2024-01-08",
      "endDate": "2024-01-15"
    },
    "summary": {
      "totalDisplays": 3,
      "activeDisplays": 3,
      "totalViews": 4521,
      "totalSearches": 312,
      "totalInteractions": 876,
      "averageUptime": 98.7
    },
    "displays": [
      {
        "displayId": "d1a2b3c4-...",
        "displayName": "Lobby Main Display",
        "displayMode": "tv",
        "metrics": {...}
      }
    ]
  }
}

Rate Limits

Request Limits

  • 100 requests per minute
  • 10,000 requests per day
  • Burst limit: 20 requests per second

Rate Limit Headers

Rate limit information is included in response headers:

X-RateLimit-Limit: 100

X-RateLimit-Remaining: 95

X-RateLimit-Reset: 1705312800

Error Codes

CodeStatusDescription
200OKRequest successful
400Bad RequestInvalid parameters or malformed request
401UnauthorizedMissing or invalid API key
403ForbiddenAPI access not included in your plan
404Not FoundHotel or resource not found
429Too Many RequestsRate limit exceeded
500Server ErrorInternal server error

Ready to Start Building?

Get your API key today and start integrating LobbyTrain data into your applications.