This is the source code for both the GBFS tracking app and API server hosted at api.raccoon.bike
Many bike share systems worldwide provide real-time access to system information via the GBFS specification. For more information about GBFS, see the GBFS github repo. GBFS provides the number of bikes and docks at each station and the number of available floating bikes, but it does not provide trip information. By monitoring the number of available bikes in a system and tracking changes over time this tool estimates the number of trips in a system each hour. For a more detailed explanation of how a previous implementation of this tool works, see this blog post.
It's important to keep in mind that the trip counts infered by this tracker are estimates only and may vary substantially from official counts.
The original version queried both station_status.json and free_bikes.json and saved free bike trips by creating a "station" called "free_bikes". This does not accurately represent how GBFS feeds work in theory or practice. The station_status and free_bike feeds can be independant or overlapping in different situations.
Now we treat the station_status and free_bikes feeds independently and require the user to specify "station" or "free_bike" feed parameter the when querying system activity. We leave to the user to determine whether it's appropriate to combine both feeds when computing total trips in a system.
In GBFS v3.0 the free_bike_status.json feed is rename vehicle_status.json
We are now tracking vehicle types when available, in both station_status and free_bike_status feeds. Specify the vehicle parameter with the relevant vehicle_id to filter trips by vehicle type.
Vehicle types for each system can be accessed via the "vehicle" endpoint
To access the data collected by the tracker, we provide the following HTTP endpoints. All endpoints return JSON text.
systems
Returns a list of systems being tracked along with some system metadata.
Example: https://api.raccoon.bike/systems
stations
Returns a list of stations for a given system along with station metadata.
Parameters: system: the system name (as specified in the systems endpoint)
Example: https://api.raccoon.bike/stations?system=bike_share_toronto
vehicles
Returns a list of vehicle types for a given system.
Parameters: system: the system name (as specified in the systems endpoint)
Example: https://api.raccoon.bike/stations?system=bike_share_toronto
activity
Returns trip activity data
Parameters:
This software is licensed under the MIT license.
Data provided by the BikeRaccoonAPI is licensed under the Creative Commons BY 4.0 license. You are free to:
You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use. You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits.