GlennTatum / GoMTA

Metropolitan Transportation Authority General Transit Feed Specification API written in Go

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

Metropolitan Transportation Authority General Transit Feed Specification API written in Go

License:GNU General Public License v3.0


Languages

Language:Go 93.2%Language:Shell 6.8%