Accessing LIRR track postings and issues with realtime API key

654 views
Skip to first unread message

dwi...@gmail.com

unread,
Mar 17, 2017, 5:08:35 PM3/17/17
to mtadeveloperresources
Hello,

I'd like to get API access to the track postings for the LIRR.  

I requested and received an API key but am getting an "Access Denied' message when trying to access the real time feed here:  https://mnorth.prod.acquia-sites.com/wse/LIRR/gtfsrt/realtime/{key}/json

It seems others have experienced the same problem - is there a solution?  Is the realtime feed even the right place to get track postings?

I saw a few references in this group to the Train Time API - is that different than the realtime feed?  If so, can someone provide me with the URL?  Every link I find on the MTA site ends up at http://datamine.mta.info/list-of-feeds which lists the realtime feed for the LIRR.

Thanks!
-Doug

Patrick O'Hara

unread,
Mar 17, 2017, 5:38:33 PM3/17/17
to MTA Developer Resources Google Group, Serheo Shatunov, Michael Helbig

To get to the LIRR GTFS-RT feed you have to e-mail your API key to Mr. Larsen…see: https://groups.google.com/d/msg/mtadeveloperresources/slwHaNqAE18/gE-m6RaRGp8J.  I have no idea why this requirement isn’t posted someplace clearly on the site with all the information…

If you’re looking for track information, you won’t find it on the LIRR’s GTFS-RT Feed.  You will have to use the TrainTime API Feeds for that, which is different (the Departures feed would be the best bet).

I don’t have a clue where the documentation pages went…previous posts to this group have been ignored.  But here is the important information for that feed:

Feed location: https://traintime.lirr.org/api/Departure

URL parameters:

·         loc= - the three-letter station code you want the countdown items for (let me know if you need the list of three letter codes)


Feed results:

·         LOC: - the three-letter code for that station

·         TIME: - the date and time the feed was returned at in mm/dd/yyyy hh:mm:ss format (24-hr time)

·         TRAINS: - countdown items for each arriving train

o   SCHED: - the scheduled date and time the train is supposed to arrive at the station.  In mm/dd/yyyy hh:mm:ss format (24-hr time)

o   TRAIN_ID: - the train number.  These are typically 1-4 digit train numbers you can find in the timetables or as the train_id’s in the GTFS feeds, though since this feed shows inserts, they can be up to 8 alphanumeric characters long.

o   DEST: - the three-letter station code of the final stop on that train

o   STOPS: - the three-letter station codes of all remaining stops that train is supposed to make.  If the countdown is showing at the final destination, the field will be blank for “discharge only” trains.  NOTE: Hillside stops are not shown in this field.

o   DIR: - the direction the train is travelling (E = eastbound, W = westbound)

o   HSF: - indicates whether or not the train will stop at Hillisde (true = train stops, false = train does not stop)

o   TRACK: - the track and platform the train is supposed to depart from.  May be blank at terminals when the track is not yet posted.

o   JAM: - indicates whether or not the train will stop at Jamaica (ture = train stops, false = train will pass through Jamaica but not stop, null = train won’t pass through Jamaica).

o   ETA: - the estimated arrival time of that train, updated to account for all reported schedule deviations.  Returned in mm/dd/yyyy hh:mm:ss format (24-hr time).  The difference between this time and the SCHED time is how late or early the train is.

o   CD: ­ - the number of seconds between now and the time the train is supposed to arrive (a countdown field)


You would append ?loc=NYK to that URL to see the upcoming departures at NY-Penn Station, ?loc=ATL for Brklyn-Atlatnic Term, ?loc=HVL for Hicksville, and so on…  There is no one feed that displays this information for all trains running at once for some reason, so you will have to pull the feeds for each station you want to show departures for individually.

Hope this helps!

…patrick…

--
You received this message because you are subscribed to the Google Groups "mtadeveloperresources" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mtadeveloperreso...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Serheo Shatunov

unread,
Mar 17, 2017, 7:48:14 PM3/17/17
to mtadeveloperresources
He doesn't respond the email. May be the letters in the spam folder or he checks the mailbox ones a month. But I don't see predictable way to activate the key.

dwi...@gmail.com

unread,
Mar 17, 2017, 10:43:37 PM3/17/17
to mtadeveloperresources, ssha...@gmail.com, mike....@gmail.com
Patrick,

Thanks for the Train Time API link, that's what I was looking for.  I requested access from Mr. Larsen - I'll wait and see if I hear back next week.

Thanks,
-Doug

To unsubscribe from this group and stop receiving emails from it, send an email to mtadeveloperresources+unsub...@googlegroups.com.

Michael B. Justice

unread,
Mar 18, 2017, 11:34:02 AM3/18/17
to mtadevelop...@googlegroups.com
I haven't tackled Long Island yet. Can you send or link to the list of station codes?

MJ
To unsubscribe from this group and stop receiving emails from it, send an email to mtadeveloperreso...@googlegroups.com.

Patrick O'Hara

unread,
Mar 19, 2017, 7:27:13 PM3/19/17
to MTA Developer Resources Google Group

See the attached file.

…patrick…


To unsubscribe from this group and stop receiving emails from it, send an email to mtadeveloperreso...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "mtadeveloperresources" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mtadeveloperreso...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

LIRR 3-letter codes and stop_ids.xlsx

Michael B. Justice

unread,
Mar 20, 2017, 2:34:58 AM3/20/17
to mtadevelop...@googlegroups.com
Thank you for sharing.
MJ

Mark Novak

unread,
Mar 20, 2017, 5:52:37 AM3/20/17
to mtadeveloperresources
Thank you Patrick!
Reply all
Reply to author
Forward
0 new messages