Deprecated. Please use the latest version of this API.
This API returns data in the Friendly Public Transport Format 1.0.1
.
The public endpoint is VBB has blocked our API servers' IP addresses, so we can't provide a public endpoint for now. If you use JavaScript to process the data, use 2.vbb.transport.rest
. Use vbb-client@3
to talk to this API from JavaScript.vbb-hafas
directly, otherwise host your vbb-rest
instance for now.
GET /stations?query=…
GET /stations
GET /stations/nearby
GET /stations/all
GET /stations/:id
GET /stations/:id/departures
GET /lines
GET /lines/:id
GET /shapes/:id
GET /journeys
GET /journeys/legs/:ref
GET /locations
GET /radar
GET /maps/:type
GET /logos/:type
Passes all parameters into vbb-stations-autocomplete
.
query
: Required.completion
:true
/false
– Default istrue
fuzzy
:true
/false
– Default isfalse
Content-Type
: application/json
curl 'https://your-api-endpoint/stations?query=jungfernheide'
# note the typo
curl 'https://your-api-endpoint/stations?query=mehrigndamm&fuzzy=true'
Passes all parameters into vbb-stations
.
id
: Filter by ID.name
: Filter by name.coordinates.latitude
: Filter by latitude.coordinates.longitude
: Filter by longitude.weight
: Filter by weight.
Content-Type
: application/json
curl 'https://your-api-endpoint/stations?weight=9120&coordinates.latitude=52.493575'
Dumps full.json
from vbb-stations
.
Content-Type
: application/json
curl 'https://your-api-endpoint/stations/all'
latitude
: Required.longitude
: Required.results
: How many stations shall be shown? Default:8
.distance
: Maximum distance in meters. Default:null
.stations
: Show stations around. Default:true
.poi
: Show points of interest around. Default:false
.
Content-Type
: application/json
curl 'https://your-api-endpoint/stations/nearby?latitude=52.52725&longitude=13.4123'
Content-Type
: application/json
curl 'https://your-api-endpoint/stations/900000013102'
Returns departures at a station. To maintain backwards compatibility, this route has two modes of operation (see below).
Note: As stated in the Friendly Public Transport Format 1.0.1
, the returned departure
and arrival
times include the current delay.
Content-Type
: application/json
If you provide a station ID with the nextStation
parameter, hafas-departures-in-direction
will be used to filter by direction. Only departures with this station as their next stop will be returned.
You may then add these parameters:
when
: A UNIX timestamp or anything parsable byparse-messy-time
. Default: now.results
: The number of results. Lower means faster. Default:10
.maxQueries
: The maximum number of queries against VBB. Default:10
.
If you do not use nextStation
, departures(…)
from vbb-hafas
(which uses departures(…)
from hafas-client
) will be used to get departures in all directions.
You may then add these parameters:
when
: A UNIX timestamp or anything parsable byparse-messy-time
. Default: now.duration
: Show departures for the nextn
minutes. Default:10
.
# at U Kottbusser Tor, in direction U Görlitzer Bahnhof
curl 'https://your-api-endpoint/stations/900000013102/departures?nextStation=900000014101&results=3'
# at U Kottbusser Tor, without direction
curl 'https://your-api-endpoint/stations/900000013102/departures?when=tomorrow%206pm'
Passes all parameters into vbb-lines
:
id
: Filter by ID.name
: Filter by name.operator
: Filter by operator id. Seeagency.txt
.variants
: Wether to return stations of the line. Default:false
.mode
: Filter by mode of transport as in Friendly Public Transport Format1.0.1
.product
: See the products inhafas-client
.
Content-Type
: application/x-ndjson
curl 'https://your-api-endpoint/lines?operator=796&variants=true'
Content-Type
: application/json
curl 'https://your-api-endpoint/lines/531'
Content-Type
: application/json
Output from require('vbb-shapes')(id)
.
curl 'https://your-api-endpoint/shapes/1269'
Output from require('vbb-hafas').journeys(…)
. Start location and end location must be either in station format or in POI/address format (you can mix them).
Note: As stated in the Friendly Public Transport Format 1.0.1
, the returned departure
and arrival
times include the current delay.
from
: Required. Station ID (e.g.900000023201
).to
: Required. Station ID (e.g.900000023201
).
from.latitude
/to.latitude
: Required. Latitude (e.g.52.543333
).from.longitude
/to.longitude
: Required. Longitude (e.g.13.351686
).from.name
/to.name
: Name of the locality (e.g.Atze Musiktheater
).from.id
/to.id
: Required. POI ID (e.g.9980720
).
from.latitude
/to.latitude
: Required. Latitude (e.g.52.543333
).from.longitude
/to.longitude
: Required. Longitude (e.g.13.351686
).from.address
/to.address
: Required. Address (e.g.Voltastr. 17
).
-
when
: A UNIX timestamp or anything parsable byparse-messy-time
. Default: now. -
results
: Maximum number of results. Default:5
. -
via
: Station ID. Default:null
. -
passedStations
: Return stations on the way? Default:false
. -
transfers
: Maximum number of transfers. Default:5
. -
transferTime
: Minimum time in minutes for a single transfer. Default:0
. -
accessibility
: Possible values:partial
,complete
. Default:none
. -
bike
: Return only bike-friendly journeys. Default:false
. -
tickets
: Return information about available tickets. Default:false
. -
transferInfo
: Try to add transfer information fromvbb-change-positions
to journey legs? more details Default:false
. -
suburban
: Include S-Bahn trains? Default:true
. -
subway
: Include U-Bahn trains? Default:true
. -
tram
: Include trams? Default:true
. -
bus
: Include buses? Default:true
. -
ferry
: Include ferries? Default:true
. -
express
: Include IC/ICE/EC trains? Default:true
. -
regional
: Include RE/RB/ODEG trains? Default:true
.
Content-Type
: application/json
curl 'https://your-api-endpoint/journeys?from=900000017104&to=900000017101'
curl 'https://your-api-endpoint/journeys?from=900000023201&to.name=ATZE%20Musiktheater&to.latitude=52.543333&to.longitude=13.351686'
curl 'https://your-api-endpoint/journeys?from=…&to=…&results=3&bus=false&tickets=true'
Output from require('hafas-client').journeyLeg(…)
.
lineName
: Required. Line name of the part's mode of transport, e.g.RE7
.when
: A UNIX timestamp or anything parsable byparse-messy-time
. Default: now.
Content-Type
: application/json
# this won't work, get a new ref from /journeys first
curl 'https://your-api-endpoint/journeys/legs/1|32082|1|86|26062017?lineName=RE7'
Output from require('hafas-client').locations(…)
.
query
: Required. (e.g.Alexanderplatz
)results
: How many stations shall be shown? Default:10
.stations
: Show stations? Default:true
.poi
: Show points of interest? Default:true
.addresses
: Show addresses? Default:true
.
Content-Type
: application/json
curl 'https://your-api-endpoint/locations?query=Alexanderplatz'
curl 'https://your-api-endpoint/locations?query=Pestalozzistra%C3%9Fe%2082%2C%20Berlin&poi=false&stations=false'
north
: Required. Northern latitude.west
: Required. Western longtidue.south
: Required. Southern latitude.east
: Required. Eastern longtidue.results
: How many vehicles shall be shown? Default:256
.duration
: Compute frames for how many seconds? Default:30
.frames
: Number of frames to compute. Default:3
.
Content-Type
: application/json
curl 'https://your-api-endpoint/radar?north=52.52411&west=13.41002&south=52.51942&east=13.41709'
Redirects to PDF public transport maps. type
may be one of these:
type |
Description |
---|---|
bvg |
Day, Berlin ABC, S-Bahn & U-Bahn |
bvg-tram |
Day & Night, Berlin ABC, Trams |
bvg-night |
Night, Berlin ABC, S-Bahn & U-Bahn |
bvg-refugees |
Day, Berlin-ABC, S-Bahn & U-Bahn, Translations |
vbb |
Day, Berlin & Brandenburg, RE & RB trains |
brb |
Day, Brandenburg an der Havel |
cb |
Day & Night, Cottbus |
cb-night |
Night, Cottbus |
ff |
Day, Frankfurt Oder |
p |
Day, Potsdam |
p-night |
Night, Potsdam |
curl -L -o bvg-tram-map.pdf 'https://your-api-endpoint/maps/bvg-tram'
Serves the logos from derhuers/vbb-logos#v2
.
curl -L -o tram.svg 'https://your-api-endpoint/logos/tram.svg'