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:
| Parameter | Description |
|---|---|
startc_wgs84=lon,lat | Start coordinate (e.g. 13.377846,52.516265), mandatory |
zielc_wgs84=lon,lat | Destination coordinate, mandatory |
viac_wgs84=lon,lat | Via coordinate, optional |
startname=name | Name of the start point, optional |
zielname=name | Name of the destination, optional |
pref_seen=1 | Mandatory, must be set to 1 |
pref_speed=speed | Preferred speed in km/h, optional, default is 20 km/h |
pref_cat=cat | Preferred 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=quality | Preferred road surface: Q2 (avoid cobblestones), Q0 (only very good surfaces) |
pref_ampel=yes | Avoid traffic lights |
pref_green=level | Prefer green routes: GR1 (prefer), GR2 (strongly prefer) |
pref_unlit=NL | Avoid unlit streets |
pref_ferry=use | Use ferries |
pref_fragezeichen=yes | Also use paths of unknown quality |
lang=language | Supported 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:
| Name | Parameter | Description |
|---|---|---|
| GPS route | output_as=gpx-route | GPX route with waypoints for GPS navigation, up to 256 points |
| GPS track | output_as=gpx-track | GPX track with up to 1024 points, no navigation |
| Google Earth (KML) | output_as=kml-track | View the route in Google Earth or Garmin BaseCamp |
| XML | output_as=xml | Route with waypoints and descriptions in XML format |
| JSON | output_as=json | Route with waypoints and descriptions in JSON format |
| YAML | output_as=yaml | Route with waypoints and descriptions in YAML format |
Example
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.