API
The API provides an updated overview of all the stations, their meta data and bike availability.
Client Identification
In order to use the API, you'll need a client identifier. This is a unique string identifying your application. In order to get one register as a developer and create a new client.
To identify your application, send the custom Client-Identifier header along with all requests to the api.
API Endpoints
The root url for all endpoints are https://oslobysykkel.no/api/v1
GET /stations
Get data for all stations currently in operation.
CURL request
curl -H "Client-Identifier: IDENTIFIER" \ https://oslobysykkel.no/api/v1/stations
Response
{ "stations":[ { "id": 210, "title": "Birkelunden", "subtitle": "langs Seilduksgata", "number_of_locks": 10, "center": { "latitude": 59.925622, "longitude": 10.760822 }, "bounds": [ { "latitude": 59.92559918218687, "longitude": 10.760778486728668 }, { "latitude": 59.925603214545724, "longitude": 10.76099306344986 }, { "latitude": 59.9256529469314, "longitude": 10.760995745658873 }, { "latitude": 59.9257161203949, "longitude": 10.760791897773741 }, { "latitude": 59.9256919263167, "longitude": 10.760748982429503 }, { "latitude": 59.92568117338741, "longitude": 10.76061487197876 }, { "latitude": 59.92559918218687, "longitude": 10.760778486728668 } ] }, { "id": 191, "title": "Jakob kirke", "subtitle": "langs Torggata", "number_of_locks": 9, "center": { "latitude": 59.917879, "longitude": 10.754906 }, "bounds": [ { "latitude": 59.91771363912163, "longitude": 10.7547327876091 }, { "latitude": 59.91789110461389, "longitude": 10.755239725112913 }, { "latitude": 59.9180309252425, "longitude": 10.755076110363005 }, { "latitude": 59.917846738329786, "longitude": 10.754566490650177 }, { "latitude": 59.91771363912163, "longitude": 10.7547327876091 } ] } ] }
GET /stations/availability
Get the current number of bikes at each station. Use the /stations-endpoint to match up availability data with titles and location information.
The data changes quite often, and the time it was last updated and the refresh rate(in seconds) are included in the response.
CURL request
curl -H "Client-Identifier: IDENTIFIER" \ https://oslobysykkel.no/api/v1/stations/availability
Response
{ "stations": [ { "id": 210, "availability": { "bikes": 7, "locks": 3 } }, { "id": 191, "availability": { "bikes": 2, "locks": 7 } } ], "updated_at": "2016-09-09T09:50:33+00:00", "refresh_rate": 10.0 }
GET /status
Get operational status for the stations
CURL request
curl -H "Client-Identifier: IDENTIFIER" \ https://oslobysykkel.no/api/v1/status
Response
{ "status": { "all_stations_closed": false, "stations_closed": [] } }