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:"22") {
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: "Complex Studentesc::45.748078,21.236596",
toPlace: "Iulius Town::45.766413, 21.227519",
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: "Shopping City::45.725141,21.200891",
toPlace: "Dumbravita::45.786172,21.237509",
transportModes: {mode: BICYCLE}
) {
itineraries{
walkDistance
duration
legs {
mode
startTime
endTime
from {
lat
lon
name
}
to {
lat
lon
name
}
distance
legGeometry {
length
points
}
}
}
}
}
{
plan(
fromPlace: "Giroc::45.699270,21.235142",
toPlace: "Ghiroda::45.764336,21.295344",
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: "45.744620,21.246866"
toPlace: "45.751619,21.216655"
transportModes: [{mode: BICYCLE}]
optimize: SAFE
) {
itineraries {
legs {
mode
duration
distance
legGeometry {
points
}
}
}
}
}