ubahnverleih / WoBike

Documentation of Bike Sharing APIs 🚴🛴🛵
958 stars 131 forks source link

LimeBike API 404 Error #9

Closed mvs202 closed 6 years ago

mvs202 commented 6 years ago

It looks like LimeBike has shut off their API, or at least this endpoint. web-production.lime.bike is returning 404 errors ("The page you were looking for doesn't exist.")

dschep commented 6 years ago

I can confirm this:

$ curl 'https://web-production.lime.bike/api/public/v1/views/bikes?map_center_latitude=38.9037808&map_center_longitude=-77.0362137&user_latitude=38.9037808&u ser_longitude=-77.0362137'
<!DOCTYPE html>
<html>
<head>
  <title>The page you were looking for doesn't exist (404)</title>
  <meta name="viewport" content="width=device-width,initial-scale=1">
  <style>
  body {
    background-color: #EFEFEF;
    color: #2E2F30;
    text-align: center;
    font-family: arial, sans-serif;
    margin: 0;
  }

  div.dialog {
    width: 95%;
    max-width: 33em;
    margin: 4em auto 0;
  }

  div.dialog > div {
    border: 1px solid #CCC;
    border-right-color: #999;
    border-left-color: #999;
    border-bottom-color: #BBB;
    border-top: #B00100 solid 4px;
    border-top-left-radius: 9px;
    border-top-right-radius: 9px;
    background-color: white;
    padding: 7px 12% 0;
    box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
  }

  h1 {
    font-size: 100%;
    color: #730E15;
    line-height: 1.5em;
  }

  div.dialog > p {
    margin: 0 0 1em;
    padding: 1em;
    background-color: #F7F7F7;
    border: 1px solid #CCC;
    border-right-color: #999;
    border-left-color: #999;
    border-bottom-color: #999;
    border-bottom-left-radius: 4px;
    border-bottom-right-radius: 4px;
    border-top-color: #DADADA;
    color: #666;
    box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
  }
  </style>
</head>

<body>
  <!-- This file lives in public/404.html -->
  <div class="dialog">
    <div>
      <h1>The page you were looking for doesn't exist.</h1>
      <p>You may have mistyped the address or the page may have moved.</p>
    </div>
    <p>If you are the application owner check the logs for more information.</p>
  </div>
</body>
</html>
ubahnverleih commented 6 years ago

looks like, they killed the "public" API path. In the app you need to register to show bikes, and communication need authorization – using https://web-production.lime.bike/api/rider/v1/views/ endpoint

dschep commented 6 years ago

Thanks for the info @ubahnverleih. Do you know if I can mitmproxy like ofo or do they use cert pinning like spin?

ubahnverleih commented 6 years ago

looks like you can mitmproxy, but it looks like they ratelimit, if you do to much requests. – share if you find any public API. Looks like transitApp uses a private API for lime bike, but i guess they combine the services on serverside

lafncow commented 6 years ago

This may be a violation of Seattle's permitting requirements. I encourage anyone interested to contact Joel Miller, Seattle's Bike Share Program Manager: joel.miller@seattle.gov

dschep commented 6 years ago

Yup @lafncow, I believe it's a violation of DC's program as well :angry:

dschep commented 6 years ago

Response from dockless.bikeshare@dc.gov

Hi Daniel,

Our "permit" requirement during the demonstration period requires the following:

Permit holder shall provide a publicly accessible application program interface that shows at a minimum the current location of any dockless bicycles available for rental at all times. Data must be in General Bikeshare Feed Specification format.

We will note your complaint regarding the other operators and follow up with them regarding their APIs.

Glad to hear you're working on an app!

Thanks,

Jonathan

"the other operators" is in reference to Ofo, LimeBike, MoBike and Spin (JUMP/SocialBicycles being the one that already offers docs). So hopefully we'll get 1st party API docs for those 4 providers.

lafncow commented 6 years ago

Response from LimeBike is below. "Next year" is 2019, not 2018:

Thank you for reaching out to LimeBike Customer Support, I apologize for the delayed response. I forwarded your question to our technical support team and was informed that we are working a public API and will publish the API next year. stay tuned for LimeBike updates by visiting our website at wwww.limebike.com

If you have any additional questions please don't hesitate to reach out to Customer Support we are more than happy to help.

Happy Riding!

-Josephine LimeBike

eamondo2 commented 6 years ago

Just as an FYI, there can be some luck had by pulling access tokens from intercepted limebike app traffic. Confirmed can send arbitrary gps coordinates, returns information on bikes in area. Limebike is using certificate pinning in their most recent versions, so you will need to recompile with a helper tool: https://github.com/levyitay/AddSecurityExceptionAndroid

PierrickP commented 6 years ago

@eamondo2 Thanks ! I tried with lime and obike but i can't make it works :\

dschep commented 6 years ago

At least for DC, DDOT gave us a present!!! https://twitter.com/DDOTDC/status/960885111066636289

curl  -iH "Authorization: Bearer limebike-PMc3qGEtAAXqJa" -X GET https://lime.bike/api/partners/v1/bikes?region=Washington%20DC%20Proper
alulsh commented 6 years ago

The new LimeBike API (possibly a preview due to the bearer token?) is exciting and I got it to work in this Node.js script.

Sharing this for the benefit of others - I sadly ran into CORS errors when trying to use this in client side JavaScript. The LimeBike API end point lacks an Access-Control-Allow-Origin header and the CORS preflight request fails. This was a bit disappointing for me since my project is intentionally all client side so it can run on GitHub Pages. Having an API in general though is a step in the right direction! 🎉

mvs202 commented 6 years ago

I got limebike to work in my PHP proxy script (which I call on/from my own site) with this cURL function call:

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://lime.bike/api/partners/v1/bikes?region=Washington%20DC%20Proper",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => array("Authorization: Bearer limebike-PMc3qGEtAAXqJa"),
));
dschep commented 6 years ago

@alulsh have you tried out solutions like https://crossorigin.me https://cors-anywhere.herokuapp.com/ or http://cors-proxy.htmldriven.com/ ? (Tho I haven't checked if they have headers support which you'd need)

I use a proxy for https://share.bikehero.io (sadly AFAICT, JUMP is the only DC provider with CORS on their API) you can check out my proxy here: https://github.com/dschep/dc-bike-finder/blob/master/bikefinder/handlers.py#L44-L53 It runs on AWS lambda so it's been really cheap for me so far at low volume traffic.

eamondo2 commented 6 years ago

I was able to get it to work, wrote a project for bike sampling as well. https://github.com/eamondo2/bikeMapping You need to intercept traffic to get the bearer token, and you need to overwrite the app's settings for ssl cert trusts, as they sign it internally. mitmproxy works perfectly. It has a timeout, and unfortunately you can't get live traffic data, or get info on each bike's individual info. If anyone has ideas on how to analyze the API further, it would be appreciated. I still want ot use it to create a pseudo-live traffic map of my area, something for path weighting.

grantdmckenzie commented 6 years ago

Noticed limebike 'scooters' popped up in DC virtually overnight. The API shared through DDOT's tweet still only returns bikes. Anyone had any success finding the scooter API?

dschep commented 6 years ago

@grantdmckenzie the API does return scooters too, but with no way to differentiate. See these screenshots of the official app and share.bikehero.io which uses the API DDOT provided (can't speak to the reverse engineered API any more tho) screenshot_20180317-121152 screenshot_20180317-121054

grantdmckenzie commented 6 years ago

Thanks @dschep Can confirm that they are tagged as 'bikes' in the json type property. Also doesn't appear to be any clear difference in the structure of the IDs or plate #s (from my sample set of 2 outside my house at least). e.g, LRCX6MJO3HMKS 942454 JQV5PUAQ2ETG7 109426

*side note, based on your screenshot we are about one block away from each other :)

dschep commented 6 years ago

Lol, I had to scroll over a bit to find scooters, but yeah, I'm only a few blocks east on q :smile: so hi neighbor :wave:

PierrickP commented 6 years ago

Do someone know all lime's region ? There are cities on the website, but we the the right string like "Washington%20DC%20Proper" (%20 is a space). probably stupid question, what is "proper" on washington ?

grantdmckenzie commented 6 years ago

@PierrickP I haven't been able to make any of the other regions work with the authorization code. I believe it is restricted just to DC given DC's 'open' regulations (I know this is not the case for Seattle). 'Proper' in this case just refers to the DC boundary rather than the larger DMV area. I'm assuming this is to allow them to expand their market area in the future should they want to do so.

dschep commented 6 years ago

+1 to @grantdmckenzie's reasoning. Tho I don't think it's about them being able to expand. They already have service in Montgomery County (directly north of DC). It is indeed more likely to be with respect that DC requires an open API. Their open API ONLY returns bikes in DC's boundaries, even tho there definitely are bikes right across the border too. As such, I wouldn't hold out too much hope that there are any other regions that work with that API unless other jurisdictions start adding open API requirements too.

PierrickP commented 6 years ago

@grantdmckenzie @dschep snap... Thanks

MixMasterT commented 6 years ago

Has anyone else here looked into the citybikes api (http://api.citybik.es/v2/). I want to find a way to feed limebike data into their system!

PierrickP commented 6 years ago

@MixMasterT I made the documentation #30

citybik.es use PyBikes and PyBikes only implement stations based bikes. On my side, i made the citybik.es of free floatings bike sharing (and in JavaScript). See multicycles.org and https://github.com/PierrickP/multicycles/

tyler-richardett commented 6 years ago

@grantdmckenzie @dschep I recently reached out to DDOT about the type of vehicle not being included in their public API. Turns out that was in violation of the contract. It's included now.

dschep commented 6 years ago

Ooh, thanks for that info @tyler-richardett!

Georgeppll commented 6 years ago

Does anyone know an API for a scooter sharing app or something else?

dschep commented 6 years ago

@Georgeppll the lime api returns both scooters and bikes i think.

Leschonander commented 6 years ago

I got the lime bike API to work with Requests in Python. Code below

import requests as re

headers = {
    'Authorization': 'Bearer limebike-PMc3qGEtAAXqJa',
}

params = (
    ('region', 'Washington DC Proper'),
)

response = re.get('https://lime.bike/api/partners/v1/bikes', headers = headers, params = params)
data = json.loads(response.text)
print(data)
Georgeppll commented 6 years ago

Thank you, I'll try.

On Sunday 19/08/2018 at 23:21:16, Leschonander wrote:

I got the lime bike API to work with Requests in Python. Code below

import requests as re

headers = { 'Authorization': 'Bearer limebike-PMc3qGEtAAXqJa', }

params = ( ('region', 'Washington DC Proper'), )

response = re.get('https://lime.bike/api/partners/v1/bikes', headers = headers, params = params) data = json.loads(response.text) print(data)—

You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

cookieguru commented 5 years ago

I can confirm that the partners API works well in Seattle using the same key but Seattle in place of the Washington DC Proper region parameter.

The API is returning that there are 10 scooters available:

{
    "attributes": {
        "latitude": "47.52745",
        "longitude": "-122.391773",
        "plate_number": "357900",
        "vehicle_type": "scooter"
    },
    "id": "NNERWMNUI5C37",
    "type": "bikes"
},

I checked three of them and there weren't any on the entire block, unless they were indoors. Scooters are banned in Seattle, so this is a bit odd.

We do have cars, and the API seems accurate for those:

{
    "attributes": {
        "latitude": "47.648125",
        "longitude": "-122.402283",
        "plate_number": "376861",
        "vehicle_type": "car"
    },
    "id": "RUMTG6CKQCMB2",
    "type": "bikes"
},

As with the bikes, the plate number is the ID printed underneath the QR code, and not the license plate.

Sadly, no way to differentiate the pedal bikes vs the e-assist bikes.

fiddyschmitt commented 5 years ago

It appears that Seattle and Washington DC Proper are both supported now. Will Brisbane (Australia) be supported soon?

bcbeta commented 5 years ago

The lime API documented in the readme is once again returning "The page you were looking for doesn't exist."

screen shot 2019-01-05 at 8 37 57 am
bcbeta commented 5 years ago

it looks like the new url is- https://web-production.lime.bike/api/rider/v1/views/map?ne_lat=39.74219108230314&ne_lng=-104.9658931419253&sw_lat=39.72879224618626&sw_lng=-104.97393976897&user_latitude=39.73504638671875&user_longitude=-104.9699164729487&zoom=16

grantdmckenzie commented 5 years ago

Hi @davem2020 Not sure what endpoint you were hitting but both Seattle and DC proper appear to still be working for me. The latest API endpoints for DC are here: https://ddot.dc.gov/page/dockless-api

bcbeta commented 5 years ago

This is for the rider API described here- https://github.com/ubahnverleih/WoBike/blob/master/Lime.md which works across the country and not just in DC and Seattle. It looks like Lime changed the parameters in the past couple of days.

bcbeta commented 5 years ago

In the JSON field "type_name" I am now seeing "manual" in addition to electric and scooter. Does Lime have non-electric pedal bikes?

cookieguru commented 5 years ago

@davem2020 http://www.lmgtfy.com/?q=lime+manual+bike

bcbeta commented 5 years ago

Funny there must be about 3 of these in the entire country. This is the first time my app's query has found them.

cookieguru commented 5 years ago

@davem2020 I think there are three on my block.

bcbeta commented 5 years ago

@cookieguru which city? This is the first I've found them in Denver and lots of queries in SoCal never returned them either.

cookieguru commented 5 years ago

@davem2020 Scroll up...

grantdmckenzie commented 5 years ago

@davem2020 Lime used to be exclusively pedal-power. Good presentation on the decline of dockless pedal-power bikes here: https://ggwash.org/view/69307/who-killed-dcs-dockless-pedal-bicycles

grantdmckenzie commented 5 years ago

Not sure how active this thread still is, but thought I would try... Has anyone else noticed that the change to the API implemented new ID values for the bike_id attribute (and dropped the place attribute). What is concerning is that these bike_id values (e.g., 5e7a71b8-4ca5-497e-baf5-942d24b76587) appear to be a hash that changes every so often and does not reliably represents the same vehicle across multiple days. Can anyone else confirm this? Any thoughts on how often these values refresh? Can't find any documentation.

rrozek commented 5 years ago

Read here @grantdmckenzie https://github.com/ubahnverleih/WoBike/issues/91

johnnyh0826 commented 5 years ago

Does Lime have an API that is working?

W1MMER commented 4 years ago

@johnnyh0826 The Lime API that is included in the documentation works fine.