Skip to content

Instantly share code, notes, and snippets.

@erickhun
Last active September 30, 2020 12:28
Show Gist options
  • Save erickhun/f0d3e8f3c3c4f70dc521c2abb43bb8a0 to your computer and use it in GitHub Desktop.
Save erickhun/f0d3e8f3c3c4f70dc521c2abb43bb8a0 to your computer and use it in GitHub Desktop.
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