Skip to content

Metropolitan Transportation Authority General Transit Feed Specification API written in Go

License

Notifications You must be signed in to change notification settings

GlennTatum/GoMTA

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published