If you have the Go language installed, you can install this via the CLI:
go get github.com/gjtorikian/metrocarddump
If you don't have Go installed, you can download a prebuilt binary for your
platform, optionally renaming it to "metrocarddump" for convenience.
Usage
Run metrocarddump.
Google Chrome will pop open. Enter your account credenitals into the browser:
Click on Statement History. Do this within ten seconds, or the script will timeout!
Don't do anything.
Let the program do its thing.
When everything is done, Chrome will close, and you'll have a file called YYYYMMDD_rides.json.
Note: Unfortunately, I could not find data for some newer MTA stations, such as those off of the Second Avenue Subway. Any missing geo-coordinates will be reported at the end of the run.
Configuration
The metrocarddump bin takes arguments!
Option
Description
Default
--debug, -d
If true, prints debug statements along the way.
false
skip, -s
If true, skips stations for which a lat/long could not be found.
false
trim, -t
If true, removes all information except for lat/long (for privacy).
false
Format
The JSON returns with the following keys:
dateTime: The date and time of the ride.
location: The unintuitive format the MTA uses to define a station.
latitude: The latitude of the station. This can be 0 if the MTA has not documented this.
longitude: The longitude of the station. This can be 0 if the MTA has not documented this.
transport: Whether this was a Subway or a Bus swipe.