Aggregating dockless bike share data in Washington, DC from varying private dockless company's APIs (links can be found here: https://ddot.dc.gov/page/dockless-api). Data provides current location of available bikes in fleet, as provided by the 5 dockless company's APIs.
While many packages you use daily are on CRAN, additional packages can also be hosted on and installed from GitHub. You'll need to have a package called devtools
which will then allow you to install this package.
install.packages("devtools")
devtools::install_github("jchafetz/docklessapi")
To ensure you have the latest version, you can always rerun devtools::install_github("jchafetz/docklessapi")
This package is extremely easy to use and requires only one input from the user - where do you want to save your file? After loading the package, you can run this one line of code to retun a csv output containing the bike share company name, the vehicle type (bike/scooter), company's assigned bike ID, the coordinates(lat/long) and the time of the pull.
library(docklessapi)
#pull currently available bikes, saved in R
bikedata <- getDocklessdata()
#pull currently available bikes, saved as csv
getDocklessdata("~/Documents/BikeData")
If you experience any issues or have any suggestions, please add a new issue.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.