BBBike @ World - Routing API Documentation

BBBike is a route planner for cyclists in Berlin. Thanks to the OpenStreetMap project, it is now available for many other cities around the world!

API access

The API runs on https://api.bbbike.org/api/0.2/

All API calls require the query string parameter appid=<your appid>.

The appid identifies your application and is mandatory. It is assigned by the BBBike developers. Please contact us to get an appid! The examples on this page use the test appid guest.

Routing API

BBBike has a simple routing API. You can get the route as a GPS route or GPS track (GPX), for Google Earth (KML), or as XML, JSON or YAML.

The city name follows the prefix, e.g. for the original BBBike data of Berlin: https://api.bbbike.org/api/0.2/bbbike/, and for Hamburg: https://api.bbbike.org/api/0.2/Hamburg/

The usual URL parameters follow the city name:

ParameterDescription
startc_wgs84=lon,latStart coordinate (e.g. 13.377846,52.516265), mandatory
zielc_wgs84=lon,latDestination coordinate, mandatory
viac_wgs84=lon,latVia coordinate, optional
startname=nameName of the start point, optional
zielname=nameName of the destination, optional
pref_seen=1Mandatory, must be set to 1
pref_speed=speedPreferred speed in km/h, optional, default is 20 km/h
pref_cat=catPreferred street category: N1, N2 (prefer / strongly prefer side streets), H1, H2 (prefer / strongly prefer main streets), N_RW, N_RW1 (side streets and main streets with cycle paths)
pref_quality=qualityPreferred road surface: Q2 (avoid cobblestones), Q0 (only very good surfaces)
pref_ampel=yesAvoid traffic lights
pref_green=levelPrefer green routes: GR1 (prefer), GR2 (strongly prefer)
pref_unlit=NLAvoid unlit streets
pref_ferry=useUse ferries
pref_fragezeichen=yesAlso use paths of unknown quality
lang=languageSupported values: de, en, es, fr, ru

To get the result in another format instead of HTML, add the parameter output_as with one of these values:

NameParameterDescription
GPS routeoutput_as=gpx-routeGPX route with waypoints for GPS navigation, up to 256 points
GPS trackoutput_as=gpx-trackGPX track with up to 1024 points, no navigation
Google Earth (KML)output_as=kml-trackView the route in Google Earth or Garmin BaseCamp
XMLoutput_as=xmlRoute with waypoints and descriptions in XML format
JSONoutput_as=jsonRoute with waypoints and descriptions in JSON format
YAMLoutput_as=yamlRoute with waypoints and descriptions in YAML format

Example

https://api.bbbike.org/api/0.2/bbbike/?appid=guest;startc_wgs84=13.377846%2C52.516265;startname=Brandenburger%20Tor;zielc_wgs84=13.404294%2C52.535019;zielname=Zionskirche;pref_seen=1;pref_speed=20;pref_cat=;pref_quality=;pref_specialvehicle=;scope=;output_as=kml-track

For a list of all parameters and valid values, please look at the HTML search form or contact us.

Street name and POI search API

The JSON API for street name and point of interest (POI) suggestions works the same way as on the website.

Examples

Search for street names:
https://api.bbbike.org/api/0.2/cgi/api.cgi?appid=guest;namespace=dbac;city=bbbike;query=wash

Street names or POI with coordinates:
https://api.bbbike.org/api/0.2/cgi/street-coord.cgi?appid=guest;namespace=3;city=bbbike;query=washing

Reverse geocoding:
https://api.bbbike.org/api/0.2/bbbike/?appid=guest;api=revgeocode;lon=13.352005;lat=52.538919

Find the BBBike city for a location:
https://api.bbbike.org/api/0.2/cgi/location.cgi?appid=guest;lng=13.411399;lat=52.523405

The same, with coordinates and pretty-printed:
https://api.bbbike.org/api/0.2/cgi/location.cgi?appid=guest;ns=coords;pretty=1;lng=13.411399;lat=52.523405

Note: replace the value of the city parameter with the city you are looking for (bbbike is the original BBBike data for Berlin).

Misc

Last but not least, please visit bbbike.org and read the documentation. Thanks!

If you want to write a mobile app for BBBike, please contact us in advance. We can give you an introduction to the API.