mta_esi.php?key=<key> and mta_esi.php?key=<key>&feed_id=2 both return L train data only

263 views
Skip to first unread message

ma...@nervous.org

unread,
Jan 20, 2014, 3:02:27 PM1/20/14
to mtadevelop...@googlegroups.com
Hello! Today I started experimenting with the NYCT subway GTFS-realtime feed.

It looks like the URLs http://datamine.mta.info/mta_esi.php?key=<key>&feed_id=2 and http://datamine.mta.info/mta_esi.php?key=<key> are both returning the same protocol buffer binary data. After processing, I'm only seeing info for the L train, not for the 123456 trains as the documentation on http://datamine.mta.info/list-of-feeds states. 

I am using PHP's file_get_contents() to fetch the data, although I am having the same result using wget on both URLs.

Am I missing something really obvious? Is the 123456 data offline for now?

In any case, thanks for making this data available.

Joa

unread,
Jan 28, 2014, 10:47:18 PM1/28/14
to mtadevelop...@googlegroups.com

Bump.

Same finding here: parsing the PB file using the compiled-to-Java protocol buffer code (with the NYCT extensions registered), appears to contain data for the L line only. Both PB files obtained with feed_id=2 and w/o feed_id seem to be identical.

Emil Vaughan

unread,
Jan 29, 2014, 10:58:41 AM1/29/14
to mtadevelop...@googlegroups.com
Very strange. I've just checked, and everything's working OK for me (L trains from one URL, 1-6 from the other). I'm using:





--
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/groups/opt_out.

Joa

unread,
Feb 1, 2014, 10:54:16 AM2/1/14
to mtadevelop...@googlegroups.com

In an effort to isolate the problem, using CURL, I found the following.

1. Call for the L feed as follows, and access is denied:
$ http://datamine.mta.info/mta_esi.php?feed_id=2&key=<key>
Swap GET parameters to:
$ http://datamine.mta.info/mta_esi.php?key=<key>&feed_id=2
and the content is delivered. Heads-up, there's a problem with the server side implementation?! The sequence of the GET parameters should be interchangeable.

2. As found when parsing with the GTFS-RT parser, the returned contents of both feeds are identical, verified as follows:
$ curl -o l.tmp http://datamine.mta.infmta_esi.php?key=<mykey>&feed_id=2
$ curl -o onetwo.tmp http://datamine.mta.info/mta_esi.php?key=<mykey>
$ diff l.tmp onetwo.tmp
There are edge cases where the feeds advance their content in between the two calls to download the feeds, but by and large, they are the same when executed quickly.

... Strange. Do we need two different keys, because the server side routes the calls based on keys, not by feed_id? I can only speculate at this point...



On Monday, January 20, 2014 12:02:27 PM UTC-8, ma...@nervous.org wrote:

Matt Caywood

unread,
Feb 19, 2014, 11:59:22 AM2/19/14
to mtadevelop...@googlegroups.com

In our testing using PHP, we are getting the same results as Joa.

Both feeds appear to contain data for the L line only. Both the one with feed_id=2 and w/o feed_id seem to be identical.

There seems to be an ongoing problem here. Can someone from MTA, or anyone who has this working, comment?

harvest li

unread,
Mar 11, 2014, 6:21:00 PM3/11/14
to mtadevelop...@googlegroups.com
I still have this issue today. Following 2 urls returns the same result, which has line L data only

John Doll

unread,
Jul 18, 2014, 11:51:23 AM7/18/14
to mtadevelop...@googlegroups.com
Has this not been resolved yet?

I'm still seeing the same problem and re-ordering the arguments for 2,3,4,5 or 6 does not help get passed the "You have no access" error.

John Doll

unread,
Jul 18, 2014, 12:06:14 PM7/18/14
to mtadevelop...@googlegroups.com
OK, I should clarify my own mistake. I thought you could add &feed=3 to get the 3 line.

So getting back to the topic of this thread, with and without &feed=2 I only get data for the L line.

Has this really been broken all this time, any ETA for a fix? am I doing something wrong?

Jeremy Baron

unread,
Jul 18, 2014, 12:10:02 PM7/18/14
to mtadevelop...@googlegroups.com

On Jul 18, 2014 12:06 PM, "John Doll" <johnd...@ragingcoders.com> wrote:
> OK, I should clarify my own mistake. I thought you could add &feed=3 to get the 3 line.
>
> So getting back to the topic of this thread, with and without &feed=2 I only get data for the L line.
>
> Has this really been broken all this time, any ETA for a fix? am I doing something wrong?

Try feed_id instead of feed. Try all variants of param order. (?foo=1&bar=2 vs. ?bar=2&foo=1)

-Jeremy

John Doll

unread,
Jul 18, 2014, 1:43:40 PM7/18/14
to mtadevelop...@googlegroups.com
Thanks, it would seem that the param documented is wrong, it is feed_id and feed

These work:

Reply all
Reply to author
Forward
0 new messages