Go bindings to the Metropolitan Transportation Authority General Transit Feed Specification API.
Before using this library make sure to sign up at the MTA's developer portal and get an access token from https://api.mta.info/#/landing
Currently only Subway Realtime Feeds are only supported.
Under the google_transit folder the MTA GTFS dataset is present. For general usage the stops.txt folder displays stop codes for all of the subway stops of the NYC Subway system. More info about how the GTFS files work can be found here https://developers.google.com/transit/gtfs/reference
// Initialize the client
mtaclient := NewClient("ACCESS_KEY",)
// Specify the URL
url := "https://api-endpoint.mta.info/Dataservice/mtagtfsfeeds/nyct%2Fgtfs-ace"
// Retrieve the Feed
mta := mtaclient.getFeed(url)
// Filter
x := mta.stopTimeUpdate.filter("A02N")
for _, item := range x {
fmt.Println(item)
}