ubahnverleih / WoBike

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

Bird returns made-up data #242

Open LewisHein5 opened 2 years ago

LewisHein5 commented 2 years ago

Even when closely following the instructions in Bird.md and using the User-agent as instructed the query to nearby returns location data that is in a straight diagonal line to the NE from the given latitude and longitude.

image

Here is the code used:

using HTTP
using JSON

latitude = 41.317332
longitude = -105.579342

searchRadius = 5000

locationDict = Dict("latitude" => "$latitude",
                    "longitude" => "$longitude",
                    "altitude" => "7200",
                    "accuracy" => "10",
                    "speed" => "-1",
                    "heading" => "-1")

locationsReqHeader = Dict("Authorization" => "Bearer $accessToken",
                          "Device-id" => devID,
                          "User-agent" => userAgent,
                          "Platform" => "ios",
                          "legacyrequest" => "false",
                          "App-Version" => appVersion,
                          "Location" => JSON.json(locationDict))

locationsReqURL = "https://api-bird.prod.birdapp.com/bird/nearby?latitude=$latitude&longitude=$longitude&radius=$searchRadius"

birdLocationsRequest = HTTP.request("GET", locationsReqURL, locationsReqHeader)

Code to obtain a new token has been omitted for brevity.

User-agent and appVersion are defined as follows:

appVersion = "4.190.0.4"
userAgent = "Bird/$appVersion(co.bird.ride; build:3; iOS 14.3.0) Alamofire/5.2.2"
LewisHein5 commented 2 years ago

Also, this seems to be the same issue as #192 so I guess that issue is back?

BastelPichi commented 1 year ago

Works for me with the ua in the readme.