If you are not yet familiar with GraphQL and GraphiQL it is highly recommended to review those pages at first.
The Routing API provides a few bicycle related query types:
Note: For more details about these query types you can use the Documentation Explorer provided in GraphiQL.
Note: City bike API data is realtime and it is always up to date.
Note: If the examples provided with an ID do not return what is expected then the ID in question may not be in use any more and you should try again with an existing ID.
{
bikeRentalStations {
name
stationId
}
}
{
bikeRentalStation(id:"070") {
stationId
name
bikesAvailable
spacesAvailable
lat
lon
allowDropoff
}
}
{
bikeParks {
bikeParkId
name
}
}
{
bikePark(id: "906") {
bikeParkId
name
spacesAvailable
lat
lon
}
}
Bike rental can be used by adding qualifier RENT to transportModes
argument
mode
in the results does not include information about qualifiers{
plan(
fromPlace: "Kamppi, Helsinki::60.168992,24.932366",
toPlace: "Kasarmitori, Helsinki::60.165246,24.949128",
numItineraries: 1,
transportModes: [{mode: BICYCLE, qualifier: RENT}, {mode: WALK}],
) {
itineraries{
walkDistance
duration
legs {
mode
startTime
endTime
from {
lat
lon
name
bikeRentalStation {
stationId
name
}
}
to {
lat
lon
name
bikeRentalStation {
stationId
name
}
}
distance
legGeometry {
length
points
}
}
}
}
}
{
plan(
fromPlace: "Kamppi, Helsinki::60.168992,24.93236",
toPlace: "Pisa, Espoo::60.175294,24.68485",
transportModes: {mode: BICYCLE}
) {
itineraries{
walkDistance
duration
legs {
mode
startTime
endTime
from {
lat
lon
name
}
to {
lat
lon
name
}
distance
legGeometry {
length
points
}
}
}
}
}
{
plan(
fromPlace: "Herttoniemenranta::60.18778,25.02987",
toPlace: "Itäkeskus::60.21109,25.08094",
numItineraries: 1,
transportModes: [{mode: BICYCLE, qualifier: PARK}, {mode: WALK}, {mode: TRANSIT}],
) {
itineraries{
walkDistance
duration
legs {
mode
startTime
endTime
from {
lat
lon
name
stop {
gtfsId
code
name
}
}
to {
lat
lon
name
bikePark {
bikeParkId
name
}
stop {
gtfsId
code
name
}
}
trip {
routeShortName
tripHeadsign
}
distance
legGeometry {
length
points
}
}
}
}
}
optimize: SAFE
can be used to set preference for safer routes, i.e. avoid crossing streets and use bike paths when possible{
plan(
fromPlace: "60.15978,24.91842"
toPlace: "60.18204,24.92756"
transportModes: [{mode: BICYCLE}]
optimize: SAFE
) {
itineraries {
legs {
mode
duration
distance
legGeometry {
points
}
}
}
}
}