API Reference

Community Server API

The openpublictransport provider is powered by a community-hosted OpenTripPlanner 2 instance with Germany-wide GTFS data from gtfs.de.

Scheduled Maintenance — Every Sunday ~2:00 AM (Europe/Berlin)

The API is offline for approximately 80 minutes while the routing graph is rebuilt with fresh GTFS data. If your automations run on Sunday mornings, schedule them after 4:00 AM.

Endpoint

GraphQLhttps://api.openpublictransport.net/otp/gtfs/v1
AuthX-API-Key: <your-key>
MethodPOST (JSON body: {"query": "..."})
EngineOpenTripPlanner 2.9.0
TimezoneEurope/Berlin
API KeyRequired — request a free key →

Data Freshness

The server combines a weekly-rebuilt static GTFS graph with continuously polled realtime data.

Data TypeUpdate FrequencySource
Static timetablesWeekly (Sunday ~2:00 AM)gtfs.de Germany Full (CC 4.0)
Realtime delays & cancellationsEvery 30 secondsrealtime.gtfs.de GTFS-RT
Service alertsEvery 30 secondsrealtime.gtfs.de
Graph validity window~4 months per build1 month back + 3 months forward

Maintenance Schedule

Every week the server stops serving, rebuilds the routing graph with fresh GTFS data, then resumes.

ScheduleEvery Sunday, ~2:00 AM Europe/Berlin
Total downtime~80 minutes (graph build ~57 min + loading ~20 min)
Expected back~3:30 AM at the latest
ImpactAPI returns connection errors; realtime updates paused
After rebuildFresh GTFS data; realtime polling resumes within seconds

Example Queries

All queries use GraphQL POST to the endpoint above with X-API-Key header.

Search for a stop by name

{
  stops(name: "München Hbf") {
    gtfsId
    name
    lat
    lon
    parentStation { gtfsId name }
  }
}

Departures at a specific stop

{
  stop(id: "gtfsde:xxxxxxx") {
    name
    stoptimesWithoutPatterns(numberOfDepartures: 10) {
      scheduledDeparture
      realtimeDeparture
      departureDelay
      realtime
      trip {
        route { shortName longName mode }
        tripHeadsign
      }
    }
  }
}

Trip planning (A → B)

{
  plan(
    from: { lat: 48.1374, lon: 11.5755 }
    to:   { lat: 52.5200, lon: 13.4050 }
    numItineraries: 3
  ) {
    itineraries {
      duration
      legs {
        mode
        startTime
        endTime
        from { name }
        to   { name }
        trip { route { shortName } }
      }
    }
  }
}

Check graph validity range

Returns Unix timestamps — useful to verify the current graph covers your target date.

{
  serviceTimeRange {
    start
    end
  }
}

Realtime Coverage

Realtime data comes from realtime.gtfs.de, an aggregated GTFS-RT feed combining regional providers. Coverage varies by operator.

Verbund / ProviderRegion
VBBBerlin & Brandenburg
VRRRhein-Ruhr (NRW)
VRSRhein-Sieg (Köln/Bonn)
VRN / RNNRhein-Neckar
VVODresden & Chemnitz (Oberelbe)
VBNBremen, Niedersachsen, Schleswig-Holstein
NVBWBaden-Württemberg
DEFAS BayernBavaria (incl. MVV, S-Bahn München)
VAG NürnbergNürnberg city
Stadtwerke MünsterMünster city
opentransportdata.swissBaden-Württemberg / Swiss border
OVapiNetherlands / German border
DELFI SIRI feedsVarious states

Error Reference

CodeMeaning
401Invalid or missing API key — check the X-API-Key header
503 / timeoutMaintenance window active (Sunday ~2:00–3:30 AM) or graph is loading after restart (~20 min)
200 + errors[]GraphQL validation error — check field names and query structure against the schema

Self-Hosting

Run your own OTP2 instance with the same gtfs.de data. The Docker image handles GTFS download, OSM filtering, graph build, and serving automatically.

NerdySoftPaw/otp-gtfsde on GitHub