Closed jlwin closed 1 year ago
Call a bike did a website relaunch in the first quarter this year.
In Berlin they are also known as "Lidl Bike" now - but the system is the same (websites and apps are only clones on the same backend: https://www.lidl-bike.de/de vs https://www.callabike-interaktiv.de/de). The concept of "stations" still exists, but you can but don't have to return the bike at one, it's a free float system now.
I looked into the new website a bit. Here is a request of the new website (as curl):
Response looks like this:
You only really need to POST
to https://www.callabike-interaktiv.de/rpc
with payload similar to {"method":"Map.listBikes","params":[{"lat":"52.519444","long":"13.406667","maxItems":100,"radius":1000000}],"id":1491583441141}
(You can test with Postman or a similar REST client). maxItems seems to be 100, lat and long seem to be required.
The Lidl Bike "Rückgabezone" (stations) are broken on the website. Right now it mixes bikes and stations together as one data type. The app is better, I will look into this shortly.
Can someone describe how the old website worked? From looking at the file you could call one URL to get ALL stations of a city, that contained a list of the bikes. Correct?
PS: DB Rent GmbH is now also known as Deutsche Bahn Connect GmbH https://www.callabike-interaktiv.de/de/impressum
The mobile app uses two totally different APIs. One for bikes and one for "Rückgabezonen" (stations).
1) To get bikes POST
to https://xml.dbcarsharing-buchung.de/hal2_cabserver/hal2_cabserver_3.php
with headers
SOAPAction = https://xml.dbcarsharing-buchung.de/hal2_cabserver/CABSERVER.listFreeBikes
Content-Type = text/xml; charset=utf-8
and payload
<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns="https://xml.dbcarsharing-buchung.de/hal2_cabserver/"><soap:Body><CABSERVER.listFreeBikes><CommonParams><UserData><User>t_h2a_lidl_ios</User><Password>Br71cR@2xp</Password></UserData><LanguageUID>1</LanguageUID><RequestTime>2017-04-07T18:57:33.GMT+02:00</RequestTime><Version>2</Version></CommonParams><SearchPosition><Longitude>13.405459</Longitude><Latitude>52.530190</Latitude></SearchPosition><maxResults>100</maxResults><searchRadius>392</searchRadius></CABSERVER.listFreeBikes></soap:Body></soap:Envelope>
This returns this nice XML:
<?xml version="1.0" encoding="ISO-8859-1"?>
<SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<CABSERVER.listFreeBikesResponse xmlns="http://schemas.xmlsoap.org/soap/envelope/">
<CABSERVER.listFreeBikesResponse>
<Locations xmlns="">
<Description xmlns="">Gormannstr. / Torstr.</Description>
<Position xmlns="">
<Longitude xmlns="">13.405468000000000</Longitude>
<Latitude xmlns="">52.529167000000000</Latitude>
</Position>
<Distance xmlns="">113.75405315270646</Distance>
<isOutside xmlns="">false</isOutside>
<FreeBikes xmlns="">
<Number xmlns="">14790</Number>
<canBeRented xmlns="">true</canBeRented>
<canBeReturned xmlns="">false</canBeReturned>
<Version xmlns="">5</Version>
<MarkeID xmlns="">3914</MarkeID>
<MarkeName xmlns="">LIDL-BIKE</MarkeName>
<isPedelec xmlns="">false</isPedelec>
</FreeBikes>
</Locations>
<Locations xmlns="">
<Description xmlns="">Choriner Str. / Lottumstr.</Description>
<Position xmlns="">
<Longitude xmlns="">13.406347000000000</Longitude>
<Latitude xmlns="">52.531567000000000</Latitude>
</Position>
<Distance xmlns="">164.4762791914432</Distance>
<isOutside xmlns="">false</isOutside>
<FreeBikes xmlns="">
<Number xmlns="">15489</Number>
<canBeRented xmlns="">true</canBeRented>
<canBeReturned xmlns="">false</canBeReturned>
<Version xmlns="">5</Version>
<MarkeID xmlns="">3914</MarkeID>
<MarkeName xmlns="">LIDL-BIKE</MarkeName>
<isPedelec xmlns="">false</isPedelec>
</FreeBikes>
</Locations>
<Locations xmlns="">
<Description xmlns="">Gormannstr. / Linienstr.</Description>
<Position xmlns="">
<Longitude xmlns="">13.404971000000000</Longitude>
<Latitude xmlns="">52.528324000000000</Latitude>
</Position>
<Distance xmlns="">210.09937368936966</Distance>
<isOutside xmlns="">false</isOutside>
<FreeBikes xmlns="">
<Number xmlns="">17273</Number>
<canBeRented xmlns="">true</canBeRented>
<canBeReturned xmlns="">false</canBeReturned>
<Version xmlns="">5</Version>
<MarkeID xmlns="">3914</MarkeID>
<MarkeName xmlns="">LIDL-BIKE</MarkeName>
<isPedelec xmlns="">false</isPedelec>
</FreeBikes>
</Locations>
<Locations xmlns="">
<Description xmlns="">10509 U-Bhf. Rosenthaler Platz / Weinbergsweg</Description>
<Position xmlns="">
<Longitude xmlns="">13.401697800000000</Longitude>
<Latitude xmlns="">52.530384600000000</Latitude>
</Position>
<Distance xmlns="">255.34318535008654</Distance>
<isOutside xmlns="">false</isOutside>
<FreeBikes xmlns="">
<Number xmlns="">14713</Number>
<canBeRented xmlns="">true</canBeRented>
<canBeReturned xmlns="">false</canBeReturned>
<Version xmlns="">5</Version>
<MarkeID xmlns="">3914</MarkeID>
<MarkeName xmlns="">LIDL-BIKE</MarkeName>
<isPedelec xmlns="">false</isPedelec>
</FreeBikes>
<FreeBikes xmlns="">
<Number xmlns="">15143</Number>
<canBeRented xmlns="">true</canBeRented>
<canBeReturned xmlns="">false</canBeReturned>
<Version xmlns="">5</Version>
<MarkeID xmlns="">3914</MarkeID>
<MarkeName xmlns="">LIDL-BIKE</MarkeName>
<isPedelec xmlns="">false</isPedelec>
</FreeBikes>
<FreeBikes xmlns="">
<Number xmlns="">15958</Number>
<canBeRented xmlns="">true</canBeRented>
<canBeReturned xmlns="">false</canBeReturned>
<Version xmlns="">5</Version>
<MarkeID xmlns="">3914</MarkeID>
<MarkeName xmlns="">LIDL-BIKE</MarkeName>
<isPedelec xmlns="">false</isPedelec>
</FreeBikes>
<FreeBikes xmlns="">
<Number xmlns="">16391</Number>
<canBeRented xmlns="">true</canBeRented>
<canBeReturned xmlns="">false</canBeReturned>
<Version xmlns="">5</Version>
<MarkeID xmlns="">3914</MarkeID>
<MarkeName xmlns="">LIDL-BIKE</MarkeName>
<isPedelec xmlns="">false</isPedelec>
</FreeBikes>
<FreeBikes xmlns="">
<Number xmlns="">16559</Number>
<canBeRented xmlns="">true</canBeRented>
<canBeReturned xmlns="">false</canBeReturned>
<Version xmlns="">5</Version>
<MarkeID xmlns="">3914</MarkeID>
<MarkeName xmlns="">LIDL-BIKE</MarkeName>
<isPedelec xmlns="">false</isPedelec>
</FreeBikes>
...
</CABSERVER.listFreeBikesResponse>
</CABSERVER.listFreeBikesResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
(Could be the same service as the website as this is also limited to 100 results...)
GET
from https://mobility.2denker.de/zones?lat=52.530193&lon=13.405443&dist=784&tags=call-a-bike
with header Authorization
with value Basic bW9iaWxpdHk6MmRtb2JpbGl0eQ==
. Here you get this nice JSON:
[
{
"id": "8799dba2-a8e0-41de-b2f0-b16781201c26",
"name": "call-a-bike berlin",
"tags": [
"call-a-bike"
],
"location": {
"coordinates": [
[
[
13.3661247,
52.5430285
],
[
13.3659745,
52.5429388
],
[
13.3658244,
52.5430236
],
[
13.3652598,
52.5426598
],
[
13.3657935,
52.5423091
],
[
13.3580017,
52.5388311
],
[
13.3562851,
52.538022
],
[
13.3555126,
52.5376957
],
[
13.3539891,
52.5373302
],
[
13.3519506,
52.5371736
],
[
13.343668,
52.536273
],
[
13.3333683,
52.5350462
],
[
13.3283794,
52.534511
],
[
13.3267915,
52.5342434
],
...
]
],
"type": "Polygon"
}
}
]
Somehow this is combined in the app to display the "free" bikes and the ones that are "in a station" differently.
To get the "Rückgabezonen"(stations) you GET from https://mobility.2denker.de/zones?lat=52.530193&lon=13.405443&dist=784&tags=call-a-bike with header Authorization with value Basic bW9iaWxpdHk6MmRtb2JpbGl0eQ==. Here you get this nice JSON:
The part inside location
looks like a geojson defining the boundaries of the system, see:
Click details for the data, can be tested at http://geojsonlint.com
Found a couple of interesting fields on their app:
private static final double BERLIN_FERNSEHTURM_LAT = 52.52093D;
private static final double BERLIN_FERNSEHTURM_LONG = 13.409723D;
private static final int BERLIN_RADIUS_IN_M = 25000;
private static final int CAB_MARKER_ID = 1312;
private static final int KONRAD_MARKER_ID = 1768;
private static final int LIDLBIKE_MARKER_ID = 3914;
private static final int STADTRADHH_MARKER_ID = 1672;
...
Log.d("markerId", "MARKERID " + paramSoapObject);
switch (Integer.valueOf(paramSoapObject).intValue())
{
default:
return CABServiceHelper.STATION_FLAVOR.CALLABIKE;
case 1312:
return CABServiceHelper.STATION_FLAVOR.CALLABIKE;
case 1672:
return CABServiceHelper.STATION_FLAVOR.STADTRADHH;
case 1768:
return CABServiceHelper.STATION_FLAVOR.KONRAD;
}
return CABServiceHelper.STATION_FLAVOR.LIDLBIKE;
}
return CABServiceHelper.STATION_FLAVOR.STADTRADHH;
Also (I might be wrong on this), differentiation between station and bike is checking for the virtStationRadius
field, and defaulting always to STATION_FLAVOR.LIDLBIKE. From the following interpreted gibberish:
super.readFromResponse(paramSoapObject);
Log.d("cab", "rentlocation " + paramSoapObject.toString());
Object localObject = new float[2];
Location.distanceBetween(52.52093D, 13.409723D, this.posLat, this.posLong, (float[])localObject);
if (localObject[0] < 25000.0F) {
this.locationFlavor = CABServiceHelper.STATION_FLAVOR.LIDLBIKE;
}
this.freeBikes = new ArrayList(0);
localObject = paramSoapObject.getPropertyList("FreeBikes").iterator();
while (((Iterator)localObject).hasNext())
{
SoapObject localSoapObject = (SoapObject)((Iterator)localObject).next();
this.freeBikes.add(new Bike(localSoapObject));
if (this.locationFlavor == null) {
this.locationFlavor = extractMarkerIdFromSoap(localSoapObject);
}
Log.d("cab", "rent flavor " + this.locationFlavor);
}
if ((SoapPrimitive)paramSoapObject.getPropertyOrNull("virtStationRadius") != null) {}
for (boolean bool = true;; bool = false)
{
this.isReturnLocation = bool;
return;
}
Good thing about this, we can use the web services and not the private app endpoints, and still understand the data based on the assumptions from the app.
There are other SOAP actions available and 'documented' at https://xml.dbcarsharing-buchung.de/hal2_cabserver/hal2_cabserver_3.php
The Lidl Bike "Rückgabezone" (stations) are broken on the website. Right now it mixes bikes and stations together as one data type. The app is better, I will look into this shortly.
See previous comment on app
Can someone describe how the old website worked? From looking at the file you could call one URL to get ALL stations of a city, that contained a list of the bikes. Correct?
Correct.
Hey guys, thanks a lot for looking into this!
I think finding a solution with the "callabike-interaktiv.de" domain instead of the "lidl-bike.de" domain to ensure to fix this problem for all german stations sustainably would be the best solution. (Since we don't know how long Lidl will be "sponsoring" the call a bikes in Berlin.)
I assume the old version of the website was also returning a list of all the station. You can see the returned code on citybik.es: https://api.citybik.es/v2/networks/stadtrad?fields=stations with the outdated timestamp from 22.02.2017.
Hello. I added a pull request for this issue a few days ago. Please have a look.
additional info: I just found these sites that also provide the information about the available bikes per station for Hamburg:
http://suche.transparenz.hamburg.de/dataset/stadtrad-stationen-hamburg3 (not realtime)
http://www.geoportal-hamburg.de/Geoportal/geo-online/?mdid=D18F375E-FA5F-4998-AFF8-557969F44479
Please note that return zones exist only in selected cities (e.g. Berlin, Munich, Cologne) of the Call-a-Bike system. In most cities, specifically Hamburg StadtRAD for example, bikes can only be returned at fixed stations.
Changed the name of the issue to reflect the update by https://github.com/eskerda/pybikes/pull/246#discussion_r119306174
swoker 2 days ago Hi, I'm from the IT of Deutsche Bahn Connect who's the operator of Call a Bike. Feel free to use our Open Data API directly! That is probably way easier than parsing our website :) http://data.deutschebahn.com/dataset/flinkster-api
Have fun and feel free to contact me for further questions!
Now the question is: How does one most easily get the required data?
Docs are here: https://developer.deutschebahn.com/store/apis/info?name=Flinkster_API_NG&version=v1&provider=DBOpenData https://s3.eu-central-1.amazonaws.com/download-data.deutschebahn.com/static/apis/flinkster/Schnittstellenspezifikation_FlinksterApiNG.pdf (German only)
on it :)
index of networks (paginates)
curl --header "Authorization: Bearer <API TOKEN>" https://api.deutschebahn.com/flinkster-api-ng/v1/areas\?providernetwork\=2\&limit\=10 | json_reformat | less
{
"href": "https://api.deutschebahn.com/flinkster-api-ng/v1/areas?providernetwork=2&limit=10",
"offset": 0,
"limit": 10,
"size": 781,
"items": [
{
"href": "https://api.deutschebahn.com/flinkster-api-ng/v1/areas/0015564117E946653C8EA4DCF6C8C288A789782A",
"uid": "0015564117E946653C8EA4DCF6C8C288A789782A",
"name": "Niddastraße / Weserstraße",
"expand": "provider",
"provider": {
"href": "https://api.deutschebahn.com/flinkster-api-ng/v1/providers/call_a_bike"
},
"providerAreaId": 272652000,
"providerNetworkIds": [
2
],
"type": "station",
"geometry": {
"position": {
"type": "Point",
"coordinates": [
8.66734,
50.11095
]
}
},
"address": {
"street": "Niddastraße",
"zip": 60329,
"city": "Frankfurt am Main",
"district": "Bahnhofsviertel"
},
"rentalObjectTypes": [
"bike"
],
"_links": [
{
"rel": "self",
"verb": "GET",
"href": "https://api.deutschebahn.com/flinkster-api-ng/v1/areas/0015564117E946653C8EA4DCF6C8C288A789782A"
}
]
},
{
"href": "https://api.deutschebahn.com/flinkster-api-ng/v1/areas/00CDE3D431E2F159047EA62E75CF557243E29F0A",
"uid": "00CDE3D431E2F159047EA62E75CF557243E29F0A",
"name": "DB Schenker / HOLM",
"expand": "provider",
"provider": {
"href": "https://api.deutschebahn.com/flinkster-api-ng/v1/providers/call_a_bike"
},
"providerAreaId": 230666000,
"providerNetworkIds": [
2
],
"type": "station",
"geometry": {
"position": {
"type": "Point",
"coordinates": [
8.591024,
50.05634
]
}
},
"address": {
"street": "DB Schenker",
"zip": 60000,
"city": "Flugh. Frankfurt",
"district": "Innenstadt"
},
"rentalObjectTypes": [
"bike"
],
"_links": [
{
"rel": "self",
"verb": "GET",
"href": "https://api.deutschebahn.com/flinkster-api-ng/v1/areas/00CDE3D431E2F159047EA62E75CF557243E29F0A"
}
]
},
{
"href": "https://api.deutschebahn.com/flinkster-api-ng/v1/areas/00F5FD38BF09E55554B39115D674BEFD4CE9B601",
"uid": "00F5FD38BF09E55554B39115D674BEFD4CE9B601",
"name": "Messehallen / Marktstraße",
"expand": "provider",
"provider": {
"href": "https://api.deutschebahn.com/flinkster-api-ng/v1/providers/stadtrad_hamburg"
},
"providerAreaId": 131888000,
"providerNetworkIds": [
2
],
"type": "station",
"geometry": {
"position": {
"type": "Point",
"coordinates": [
9.975346,
53.558518
]
}
},
"address": {
"street": "Messehallen",
"zip": 22767,
"city": "Hamburg",
"district": "Innenstadt"
},
"rentalObjectTypes": [
"bike"
],
"_links": [
{
"rel": "self",
"verb": "GET",
"href": "https://api.deutschebahn.com/flinkster-api-ng/v1/areas/00F5FD38BF09E55554B39115D674BEFD4CE9B601"
}
]
},
{
"href": "https://api.deutschebahn.com/flinkster-api-ng/v1/areas/021B5A9CEFE1DEC1AD5701584456DEAB29020530",
"uid": "021B5A9CEFE1DEC1AD5701584456DEAB29020530",
"name": "Überseering/Mexikoring",
"expand": "provider",
"provider": {
"href": "https://api.deutschebahn.com/flinkster-api-ng/v1/providers/stadtrad_hamburg"
},
"providerAreaId": 213687000,
"providerNetworkIds": [
2
],
"type": "station",
"geometry": {
"position": {
"type": "Point",
"coordinates": [
10.024745,
53.601619
]
}
},
"address": {
"street": "Überseering",
"zip": 22297,
"city": "Hamburg",
"district": "Winterhude"
},
"rentalObjectTypes": [
"bike"
],
"_links": [
{
"rel": "self",
"verb": "GET",
"href": "https://api.deutschebahn.com/flinkster-api-ng/v1/areas/021B5A9CEFE1DEC1AD5701584456DEAB29020530"
}
]
},
{
"href": "https://api.deutschebahn.com/flinkster-api-ng/v1/areas/02710A933A00B819018B039694F2ABE2BF55B292",
"uid": "02710A933A00B819018B039694F2ABE2BF55B292",
"name": "7250 Pragsattel",
"expand": "provider",
"provider": {
"href": "https://api.deutschebahn.com/flinkster-api-ng/v1/providers/call_a_bike"
},
"providerAreaId": 208768000,
"providerNetworkIds": [
2
],
"type": "station",
"geometry": {
"position": {
"type": "Point",
"coordinates": [
9.182408,
48.810089
]
}
},
"address": {
"street": "Pragsattel",
"zip": 70673,
"city": "Stuttgart",
"district": "Feuerbach"
},
"rentalObjectTypes": [
"bike",
"pedelec"
],
"_links": [
{
"rel": "self",
"verb": "GET",
"href": "https://api.deutschebahn.com/flinkster-api-ng/v1/areas/02710A933A00B819018B039694F2ABE2BF55B292"
}
]
},
{
"href": "https://api.deutschebahn.com/flinkster-api-ng/v1/areas/02FC62AD0AEF4659BEB64E12A9C06DDF9B9ED6FB",
"uid": "02FC62AD0AEF4659BEB64E12A9C06DDF9B9ED6FB",
"name": "Goebenstraße/Eppendorfer Weg",
"expand": "provider",
"provider": {
"href": "https://api.deutschebahn.com/flinkster-api-ng/v1/providers/stadtrad_hamburg"
},
"providerAreaId": 131641000,
"providerNetworkIds": [
2
],
"type": "station",
"geometry": {
"position": {
"type": "Point",
"coordinates": [
9.963063,
53.577579
]
}
},
"address": {
"street": "Goebenstraße",
"zip": 20253,
"city": "Hamburg",
"district": "Innenstadt"
},
"rentalObjectTypes": [
"bike"
],
"_links": [
{
"rel": "self",
"verb": "GET",
"href": "https://api.deutschebahn.com/flinkster-api-ng/v1/areas/02FC62AD0AEF4659BEB64E12A9C06DDF9B9ED6FB"
}
]
},
{
"href": "https://api.deutschebahn.com/flinkster-api-ng/v1/areas/033BC555BB22CC36381010F8B6B83957B97A5E2F",
"uid": "033BC555BB22CC36381010F8B6B83957B97A5E2F",
"name": "Heidelberger Straße 49",
"expand": "provider",
"provider": {
"href": "https://api.deutschebahn.com/flinkster-api-ng/v1/providers/call_a_bike"
},
"providerAreaId": 245490000,
"providerNetworkIds": [
2
],
"type": "station",
"geometry": {
"position": {
"type": "Point",
"coordinates": [
8.64694,
49.862313
]
}
},
"address": {
"street": "Heidelberger Straße",
"zip": 64000,
"city": "Darmstadt",
"district": "Innenstadt"
},
"rentalObjectTypes": [
"bike"
],
"_links": [
{
"rel": "self",
"verb": "GET",
"href": "https://api.deutschebahn.com/flinkster-api-ng/v1/areas/033BC555BB22CC36381010F8B6B83957B97A5E2F"
}
]
},
{
"href": "https://api.deutschebahn.com/flinkster-api-ng/v1/areas/0361C28D7154AA72CAD6BD792695F6B88900C4C7",
"uid": "0361C28D7154AA72CAD6BD792695F6B88900C4C7",
"name": "Herthastraße / Einkaufszentrum Bramfeld",
"expand": "provider",
"provider": {
"href": "https://api.deutschebahn.com/flinkster-api-ng/v1/providers/stadtrad_hamburg"
},
"providerAreaId": 243620000,
"providerNetworkIds": [
2
],
"type": "station",
"geometry": {
"position": {
"type": "Point",
"coordinates": [
10.075913,
53.611878
]
}
},
"address": {
"street": "Herthastraße",
"zip": 22179,
"city": "Hamburg",
"district": "Wandsbek"
},
"rentalObjectTypes": [
"bike"
],
"_links": [
{
"rel": "self",
"verb": "GET",
"href": "https://api.deutschebahn.com/flinkster-api-ng/v1/areas/0361C28D7154AA72CAD6BD792695F6B88900C4C7"
}
]
},
{
"href": "https://api.deutschebahn.com/flinkster-api-ng/v1/areas/042E0036F4C3053249A048E81EDB2E51F434E53A",
"uid": "042E0036F4C3053249A048E81EDB2E51F434E53A",
"name": "Koppelstraße/Lokstedter Grenzstraße",
"expand": "provider",
"provider": {
"href": "https://api.deutschebahn.com/flinkster-api-ng/v1/providers/stadtrad_hamburg"
},
"providerAreaId": 213792000,
"providerNetworkIds": [
2
],
"type": "station",
"geometry": {
"position": {
"type": "Point",
"coordinates": [
9.943525,
53.593587
]
}
},
"address": {
"street": "Koppelstraße",
"zip": 22527,
"city": "Hamburg",
"district": "Stellingen"
},
"rentalObjectTypes": [
"bike"
],
"_links": [
{
"rel": "self",
"verb": "GET",
"href": "https://api.deutschebahn.com/flinkster-api-ng/v1/areas/042E0036F4C3053249A048E81EDB2E51F434E53A"
}
]
},
{
"href": "https://api.deutschebahn.com/flinkster-api-ng/v1/areas/049AEDF4C22DE432E1C76EE2C8685A337DB484D0",
"uid": "049AEDF4C22DE432E1C76EE2C8685A337DB484D0",
"name": "Eschersheimer Landstraße / Grüneburgweg",
"expand": "provider",
"provider": {
"href": "https://api.deutschebahn.com/flinkster-api-ng/v1/providers/call_a_bike"
},
"providerAreaId": 227484000,
"providerNetworkIds": [
2
],
"type": "station",
"geometry": {
"position": {
"type": "Point",
"coordinates": [
8.675602,
50.121755
]
}
},
"address": {
"street": "Eschersheimer Landstraße",
"zip": 60000,
"city": "Frankfurt am Main",
"district": "Innenstadt"
},
"rentalObjectTypes": [
"bike"
],
"_links": [
{
"rel": "self",
"verb": "GET",
"href": "https://api.deutschebahn.com/flinkster-api-ng/v1/areas/049AEDF4C22DE432E1C76EE2C8685A337DB484D0"
}
]
}
]
}
Info about a network, note the expand
to avoid having to call each object
curl --header "Authorization: Bearer <API TOKEN>" https://api.deutschebahn.com/flinkster-api-ng/v1/bookingproposals\?providernetwork\=2\&lat\=50.11095\&lon\=8.66734\&expand\=rentalobject\&limit\=10 | json_reformat
{
"href": "https://api.deutschebahn.com/flinkster-api-ng/v1/bookingproposals?providernetwork=2&lat=50.11095&lon=8.66734&expand=rentalobject&limit=10",
"offset": 0,
"limit": 10,
"size": 118,
"items": [
{
"expand": "area,rentalobject,price",
"rentalObject": {
"href": "https://api.deutschebahn.com/flinkster-api-ng/v1/providernetworks/2/rentalobjects/7CFC3138B71C7CFDE11A74E97C9F315F767F0470",
"uid": "7CFC3138B71C7CFDE11A74E97C9F315F767F0470",
"name": "Fahrrad",
"description": "Fahrrad",
"providerRentalObjectId": 165186,
"rentalModel": "freefloatingWithStation",
"type": "bike",
"provider": {
"href": "https://api.deutschebahn.com/flinkster-api-ng/v1/providers/call_a_bike"
},
"category": {
"href": "https://api.deutschebahn.com/flinkster-api-ng/v1/providernetworks/2/categories/50000"
},
"attributes": {
"licenseplate": 11691
},
"equipment": null
},
"area": {
"href": "https://api.deutschebahn.com/flinkster-api-ng/v1/areas/0015564117E946653C8EA4DCF6C8C288A789782A"
},
"position": {
"type": "Point",
"coordinates": [
8.66734,
50.11095
]
},
"distance": 0.0,
"price": {
"href": "https://api.deutschebahn.com/flinkster-api-ng/v1/providernetworks/2/prices?provider=call_a_bike&category=50000"
},
"_links": [
{
"rel": "AppBookingLink",
"verb": "GET",
"href": "callabike://rentbike?bike=11691&commissionPartner=dbnavigator"
}
]
},
{
"expand": "area,rentalobject,price",
"rentalObject": {
"href": "https://api.deutschebahn.com/flinkster-api-ng/v1/providernetworks/2/rentalobjects/5883C4AE83BF6E562CF14BBDC1F79D42035DE680",
"uid": "5883C4AE83BF6E562CF14BBDC1F79D42035DE680",
"name": "Fahrrad",
"description": "Fahrrad",
"providerRentalObjectId": 165202,
"rentalModel": "freefloatingWithStation",
"type": "bike",
"provider": {
"href": "https://api.deutschebahn.com/flinkster-api-ng/v1/providers/call_a_bike"
},
"category": {
"href": "https://api.deutschebahn.com/flinkster-api-ng/v1/providernetworks/2/categories/50000"
},
"attributes": {
"licenseplate": 11707
},
"equipment": null
},
"area": {
"href": "https://api.deutschebahn.com/flinkster-api-ng/v1/areas/0015564117E946653C8EA4DCF6C8C288A789782A"
},
"position": {
"type": "Point",
"coordinates": [
8.66734,
50.11095
]
},
"distance": 0.0,
"price": {
"href": "https://api.deutschebahn.com/flinkster-api-ng/v1/providernetworks/2/prices?provider=call_a_bike&category=50000"
},
"_links": [
{
"rel": "AppBookingLink",
"verb": "GET",
"href": "callabike://rentbike?bike=11707&commissionPartner=dbnavigator"
}
]
},
{
"expand": "area,rentalobject,price",
"rentalObject": {
"href": "https://api.deutschebahn.com/flinkster-api-ng/v1/providernetworks/2/rentalobjects/1E1BA83BC850B59D178FB1A855382D10F7A2F975",
"uid": "1E1BA83BC850B59D178FB1A855382D10F7A2F975",
"name": "Fahrrad",
"description": "Fahrrad",
"providerRentalObjectId": 163544,
"rentalModel": "freefloatingWithStation",
"type": "bike",
"provider": {
"href": "https://api.deutschebahn.com/flinkster-api-ng/v1/providers/call_a_bike"
},
"category": {
"href": "https://api.deutschebahn.com/flinkster-api-ng/v1/providernetworks/2/categories/50000"
},
"attributes": {
"licenseplate": 10050
},
"equipment": null
},
"area": {
"href": "https://api.deutschebahn.com/flinkster-api-ng/v1/areas/0015564117E946653C8EA4DCF6C8C288A789782A"
},
"position": {
"type": "Point",
"coordinates": [
8.66734,
50.11095
]
},
"distance": 0.0,
"price": {
"href": "https://api.deutschebahn.com/flinkster-api-ng/v1/providernetworks/2/prices?provider=call_a_bike&category=50000"
},
"_links": [
{
"rel": "AppBookingLink",
"verb": "GET",
"href": "callabike://rentbike?bike=10050&commissionPartner=dbnavigator"
}
]
},
{
"expand": "area,rentalobject,price",
"rentalObject": {
"href": "https://api.deutschebahn.com/flinkster-api-ng/v1/providernetworks/2/rentalobjects/A054211033FF35529AF069422C8DC317B2337FBD",
"uid": "A054211033FF35529AF069422C8DC317B2337FBD",
"name": "Fahrrad",
"description": "Fahrrad",
"providerRentalObjectId": 163538,
"rentalModel": "freefloatingWithStation",
"type": "bike",
"provider": {
"href": "https://api.deutschebahn.com/flinkster-api-ng/v1/providers/call_a_bike"
},
"category": {
"href": "https://api.deutschebahn.com/flinkster-api-ng/v1/providernetworks/2/categories/50000"
},
"attributes": {
"licenseplate": 10044
},
"equipment": null
},
"area": {
"href": "https://api.deutschebahn.com/flinkster-api-ng/v1/areas/0015564117E946653C8EA4DCF6C8C288A789782A"
},
"position": {
"type": "Point",
"coordinates": [
8.66734,
50.11095
]
},
"distance": 0.0,
"price": {
"href": "https://api.deutschebahn.com/flinkster-api-ng/v1/providernetworks/2/prices?provider=call_a_bike&category=50000"
},
"_links": [
{
"rel": "AppBookingLink",
"verb": "GET",
"href": "callabike://rentbike?bike=10044&commissionPartner=dbnavigator"
}
]
},
{
"expand": "area,rentalobject,price",
"rentalObject": {
"href": "https://api.deutschebahn.com/flinkster-api-ng/v1/providernetworks/2/rentalobjects/FBE444587734D250B44F82009E3F9CD4CB4A7425",
"uid": "FBE444587734D250B44F82009E3F9CD4CB4A7425",
"name": "Fahrrad",
"description": "Fahrrad",
"providerRentalObjectId": 165206,
"rentalModel": "freefloatingWithStation",
"type": "bike",
"provider": {
"href": "https://api.deutschebahn.com/flinkster-api-ng/v1/providers/call_a_bike"
},
"category": {
"href": "https://api.deutschebahn.com/flinkster-api-ng/v1/providernetworks/2/categories/50000"
},
"attributes": {
"licenseplate": 11711
},
"equipment": null
},
"area": {
"href": "https://api.deutschebahn.com/flinkster-api-ng/v1/areas/0015564117E946653C8EA4DCF6C8C288A789782A"
},
"position": {
"type": "Point",
"coordinates": [
8.66734,
50.11095
]
},
"distance": 0.0,
"price": {
"href": "https://api.deutschebahn.com/flinkster-api-ng/v1/providernetworks/2/prices?provider=call_a_bike&category=50000"
},
"_links": [
{
"rel": "AppBookingLink",
"verb": "GET",
"href": "callabike://rentbike?bike=11711&commissionPartner=dbnavigator"
}
]
},
{
"expand": "area,rentalobject,price",
"rentalObject": {
"href": "https://api.deutschebahn.com/flinkster-api-ng/v1/providernetworks/2/rentalobjects/8D884741780E34927B9E16E3850D9635C593A62A",
"uid": "8D884741780E34927B9E16E3850D9635C593A62A",
"name": "Fahrrad",
"description": "Fahrrad",
"providerRentalObjectId": 163561,
"rentalModel": "freefloatingWithStation",
"type": "bike",
"provider": {
"href": "https://api.deutschebahn.com/flinkster-api-ng/v1/providers/call_a_bike"
},
"category": {
"href": "https://api.deutschebahn.com/flinkster-api-ng/v1/providernetworks/2/categories/50000"
},
"attributes": {
"licenseplate": 10067
},
"equipment": null
},
"area": {
"href": "https://api.deutschebahn.com/flinkster-api-ng/v1/areas/0015564117E946653C8EA4DCF6C8C288A789782A"
},
"position": {
"type": "Point",
"coordinates": [
8.66734,
50.11095
]
},
"distance": 0.0,
"price": {
"href": "https://api.deutschebahn.com/flinkster-api-ng/v1/providernetworks/2/prices?provider=call_a_bike&category=50000"
},
"_links": [
{
"rel": "AppBookingLink",
"verb": "GET",
"href": "callabike://rentbike?bike=10067&commissionPartner=dbnavigator"
}
]
},
{
"expand": "area,rentalobject,price",
"rentalObject": {
"href": "https://api.deutschebahn.com/flinkster-api-ng/v1/providernetworks/2/rentalobjects/E61B20ECEF95029D545EA460E3E94FB43C6CC6F1",
"uid": "E61B20ECEF95029D545EA460E3E94FB43C6CC6F1",
"name": "Fahrrad",
"description": "Fahrrad",
"providerRentalObjectId": 163673,
"rentalModel": "freefloatingWithStation",
"type": "bike",
"provider": {
"href": "https://api.deutschebahn.com/flinkster-api-ng/v1/providers/call_a_bike"
},
"category": {
"href": "https://api.deutschebahn.com/flinkster-api-ng/v1/providernetworks/2/categories/50000"
},
"attributes": {
"licenseplate": 10179
},
"equipment": null
},
"area": {
"href": "https://api.deutschebahn.com/flinkster-api-ng/v1/areas/0015564117E946653C8EA4DCF6C8C288A789782A"
},
"position": {
"type": "Point",
"coordinates": [
8.66734,
50.11095
]
},
"distance": 0.0,
"price": {
"href": "https://api.deutschebahn.com/flinkster-api-ng/v1/providernetworks/2/prices?provider=call_a_bike&category=50000"
},
"_links": [
{
"rel": "AppBookingLink",
"verb": "GET",
"href": "callabike://rentbike?bike=10179&commissionPartner=dbnavigator"
}
]
},
{
"expand": "area,rentalobject,price",
"rentalObject": {
"href": "https://api.deutschebahn.com/flinkster-api-ng/v1/providernetworks/2/rentalobjects/D331C48AD99E20158BF167B45882783E5C13CF1F",
"uid": "D331C48AD99E20158BF167B45882783E5C13CF1F",
"name": "Fahrrad",
"description": "Fahrrad",
"providerRentalObjectId": 164306,
"rentalModel": "freefloatingWithStation",
"type": "bike",
"provider": {
"href": "https://api.deutschebahn.com/flinkster-api-ng/v1/providers/call_a_bike"
},
"category": {
"href": "https://api.deutschebahn.com/flinkster-api-ng/v1/providernetworks/2/categories/50000"
},
"attributes": {
"licenseplate": 10812
},
"equipment": null
},
"area": {
"href": "https://api.deutschebahn.com/flinkster-api-ng/v1/areas/0015564117E946653C8EA4DCF6C8C288A789782A"
},
"position": {
"type": "Point",
"coordinates": [
8.66734,
50.11095
]
},
"distance": 0.0,
"price": {
"href": "https://api.deutschebahn.com/flinkster-api-ng/v1/providernetworks/2/prices?provider=call_a_bike&category=50000"
},
"_links": [
{
"rel": "AppBookingLink",
"verb": "GET",
"href": "callabike://rentbike?bike=10812&commissionPartner=dbnavigator"
}
]
},
{
"expand": "area,rentalobject,price",
"rentalObject": {
"href": "https://api.deutschebahn.com/flinkster-api-ng/v1/providernetworks/2/rentalobjects/5D45A98C11EDD129FB704E99C2AE82D16D030659",
"uid": "5D45A98C11EDD129FB704E99C2AE82D16D030659",
"name": "Fahrrad",
"description": "Fahrrad",
"providerRentalObjectId": 165357,
"rentalModel": "freefloatingWithStation",
"type": "bike",
"provider": {
"href": "https://api.deutschebahn.com/flinkster-api-ng/v1/providers/call_a_bike"
},
"category": {
"href": "https://api.deutschebahn.com/flinkster-api-ng/v1/providernetworks/2/categories/50000"
},
"attributes": {
"licenseplate": 11862
},
"equipment": null
},
"area": {
"href": "https://api.deutschebahn.com/flinkster-api-ng/v1/areas/0015564117E946653C8EA4DCF6C8C288A789782A"
},
"position": {
"type": "Point",
"coordinates": [
8.66734,
50.11095
]
},
"distance": 0.0,
"price": {
"href": "https://api.deutschebahn.com/flinkster-api-ng/v1/providernetworks/2/prices?provider=call_a_bike&category=50000"
},
"_links": [
{
"rel": "AppBookingLink",
"verb": "GET",
"href": "callabike://rentbike?bike=11862&commissionPartner=dbnavigator"
}
]
},
{
"expand": "area,rentalobject,price",
"rentalObject": {
"href": "https://api.deutschebahn.com/flinkster-api-ng/v1/providernetworks/2/rentalobjects/14A312E821FA93A9207189A0B19EEC2E9F3FABC0",
"uid": "14A312E821FA93A9207189A0B19EEC2E9F3FABC0",
"name": "Fahrrad",
"description": "Fahrrad",
"providerRentalObjectId": 163727,
"rentalModel": "freefloatingWithStation",
"type": "bike",
"provider": {
"href": "https://api.deutschebahn.com/flinkster-api-ng/v1/providers/call_a_bike"
},
"category": {
"href": "https://api.deutschebahn.com/flinkster-api-ng/v1/providernetworks/2/categories/50000"
},
"attributes": {
"licenseplate": 10233
},
"equipment": null
},
"area": {
"href": "https://api.deutschebahn.com/flinkster-api-ng/v1/areas/0015564117E946653C8EA4DCF6C8C288A789782A"
},
"position": {
"type": "Point",
"coordinates": [
8.66734,
50.11095
]
},
"distance": 0.0,
"price": {
"href": "https://api.deutschebahn.com/flinkster-api-ng/v1/providernetworks/2/prices?provider=call_a_bike&category=50000"
},
"_links": [
{
"rel": "AppBookingLink",
"verb": "GET",
"href": "callabike://rentbike?bike=10233&commissionPartner=dbnavigator"
}
]
}
],
"_links": [
{
"rel": "AppleAppStore",
"verb": "GET",
"href": "https://itunes.apple.com/de/app/call-a-bike/id420360589"
},
{
"rel": "GooglePlayStore",
"verb": "GET",
"href": "https://play.google.com/store/apps/details?id=de.bahn.callabike&hl=de"
}
]
}
Actually, I see no clear way (yet) to get a list of services. After paginating through all resources on /areas
and generating a geojson, this is the result: https://gist.github.com/eskerda/29eb7eec27fb662a2eb81c9d365e0ba7
The idea is to get all relevant lat/lngs to generate a list of services. Resources on /areas produce either station
or operationarea
. Is this the right way to get all call-a-bike services on the system? Maybe we need a little help @swoker
Thanks!
@eskerda Looks good so far, even though I'm surprised that we have operationareas in Mannheim and other cities.
We do have different systems all over Germany. Currently we have these 3 major systems:
The last system is not yet fully included in the APIng, which is probably how the confusion started :/
As a user of the Lidlbike app in Berlin I can confirm the confusion with the non marked stations (temporarily also missing from the app).
Hi all,
I'm new to this project but I would like to help you integrate this new Flinkster API to pybikes. I forked the project, and now I'm not sure where and how to start. Can you give me some hints on what to do, now @eskerda ? How can I help best?
Yours Graphity
So will this eventually be fixed or did it run into a dead end?
It seems to me that the BASE_URL is defect. I am using citybik.es to get the Stadtrad (Call a Bike in Hamburg, Germany) data but the data is not being refreshed since the end of fabruary. I tried to find out, where the problem was but could not really fix this by now. I guess the BASE__URL in https://github.com/eskerda/pybikes/blob/master/pybikes/callabike.py is not correct anymore. I had a small old script where I used that same URL for testing purpose which was working back then but does not work anymore since the URL is not providing the data anymore. It would be great if someone could have a look into this and find the correct current URL that provides the data! Thanks a lot in advance! :-)