Skip to content

Instantly share code, notes, and snippets.

@erickhun

erickhun/youbikes-count.sh

Last active Sep 30, 2020
Embed
What would you like to do?
Number of YouBike in Taipei, Taiwan
# As for 30th september 2020, the city open API gives us:
# Number of YouBike docks in Taipei (does not reflect the number of YouBikes)
curl -sS 'https://ptx.transportdata.tw/MOTC/v2/Bike/Station/Taipei?$format=JSON' | jq -r '[.[].BikesCapacity] | add '
# 16192 docks
# Number of YouBike Stations in Taipei
$ curl -sS 'https://ptx.transportdata.tw/MOTC/v2/Bike/Station/Taipei?$format=JSON' | jq -r ' . | length '
# 399 stations
# Number of YouBike docks in New Taipei City (does not reflect the number of YouBikes)
curl -sS 'https://ptx.transportdata.tw/MOTC/v2/Bike/Station/NewTaipei?$format=JSON' | jq -r '[.[].BikesCapacity] | add '
# 26032 docks
# Number of YouBike Stations in New Taipei City
curl -sS 'https://ptx.transportdata.tw/MOTC/v2/Bike/Station/NewTaipei?$format=JSON' | jq -r ' . | length '
# 630 stations
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.