Skip to content

Latest commit

 

History

History
54 lines (30 loc) · 1.23 KB

README.md

File metadata and controls

54 lines (30 loc) · 1.23 KB

GoMTA

Go bindings to the Metropolitan Transportation Authority General Transit Feed Specification API.


🔑 Authentication

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


⭐ API Endpoints

Currently only Subway Realtime Feeds are only supported.


🚏 Stations

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


Example

// 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)
}