News for hackers. Stuff that matters.
Re:NYC Subway Data REST API by rkuykendall-com on Saturday April 19, 2014 @10:32PM (#7615572)
App request: Android app, I enter "my" subway stops and the direction I take them ( Ex: The 1 train, uptown, from 116th ), the App simply shows me how many minutes until the next train.

I want something I can quickly open and glance at to know when I should leave, or if I should be sprinting to the station to save myself 20m late at night.

1 minute mock up:

http://rkuykendall.com/uploads/subway-app-mock-up.jpg

Re:NYC Subway Data REST API by jasonmc on Saturday April 19, 2014 @11:30PM (#7615732)
The Transit app is pretty close to what you want; I use it all the time. It includes live times on lines that support it. https://play.google.com/store/apps/details?id=com.thetransit...
Re:NYC Subway Data REST API by aerialfish on Saturday April 19, 2014 @11:26PM (#7615717)
The arrival times listed on the website are likely just timetable times. Until the MTA releases real time data, I wouldn't depend too heavily on scheduled train times (especially during rush hour).
Re:NYC Subway Data REST API by jansanchez on Sunday April 20, 2014 @12:38AM (#7615872)
The MTA already provides real time data for the numbered lines [1] and some buses [2].

[1] http://datamine.mta.info/ [2] http://bustime.mta.info/wiki/Developers/Index

Re:NYC Subway Data REST API by mpcadosch on Sunday April 20, 2014 @12:42AM (#7615878)
They do, but it's GTFS format...
Re:NYC Subway Data REST API by beggi on Sunday April 20, 2014 @01:43AM (#7615993)
What's so horrifying about the GTFS format?
Re:NYC Subway Data REST API by UVB-76 on Sunday April 20, 2014 @10:20AM (#7616838)
Doesn't the Citymapper app [1] do this for New Yorkers? Does all this and more for Londoners.

[1] https://citymapper.com/nyc/

Re:NYC Subway Data REST API by Fishkins on Sunday April 20, 2014 @02:01PM (#7617772)
Yeah, Citymapper works well for me since I live near two different numbered line stops (ones that actually have live times). I can decide which station to go to ahead of time. I also have it push alerts to me when there are delays on my most common train lines.
Re:NYC Subway Data REST API by lobster_johnson on Sunday April 20, 2014 @03:48PM (#7618241)
Citymapper may have the real-time stuff, and the UI is good, but it seems the suggested routes are suboptimal.

An example: From 220 Schermerhorn St, Brooklyn to 1 East 28th Street, Manhattan to arrive by 10 AM on Monday:

* Google [1] correctly lists 5+6 (28 mins), 4+5 (26 mins) and Q+R (27 mins) at the best options.

* Citymapper [2] choices are C+5+6, C+4+5, A+4+6 and Q+N, all of which take 35+ mins and require an additional transfer.

It looks to me like Citymapper heavily weights the distance to the first station; the Nevins St station, which Citymapper doesn't consider, is two blocks away from the point of origin, and from there you can take 4+5 instead of the C+4+5. If you move the origin slightly closer to that station, it then figures correctly.

At any rate, with Google you can tell it to favour fewer transfers, Citymapper has no such option as far as I can see.

[1] http://bit.ly/RC5tO5

[2] http://bit.ly/1hfqEu3

Re:NYC Subway Data REST API by mattwad on Sunday April 20, 2014 @10:53AM (#7616934)
based on experience, i'm pretty sure Google maps will take train times into account. but you have to give it the endpoints of your journey and it doesn't actually show the times.
Re:NYC Subway Data REST API by artursapek on Saturday April 19, 2014 @10:47PM (#7615602)
What would really be interesting to play with is the real-time location of each train. The MTA must have it. I wish they would publish it somehow.

I'd love to build a city-wide visualization of the train traffic that shows where it's backing up, where it's flowing smoothly, etc. It probably wouldn't be very useful for me as an NYC commuter, but purely as a visualization it would really be something.

Re:NYC Subway Data REST API by kchoudhu on Saturday April 19, 2014 @11:29PM (#7615726)
They do have real time information for the A-division (numbered trains). The B-division trains are, however, a dogs breakfast with no central monitoring or dispatch. There are plans afoot to spend a couple of billion dollars to perform a dispatch upgrade for BDiv -- but given the generally strapped nature of the MTA, I wouldn't hold my breath for the information to be made available anytime soon.
Re:NYC Subway Data REST API by jrockway on Sunday April 20, 2014 @11:19AM (#7617031)
Sort of. The 7 is A division and has no data, and the L is B division and has data.

Plus, who needs realtime train position data when you can just listen for those helpful manual announcements like "An uptown express train is approaching W 4th St."

Re:NYC Subway Data REST API by m_c on Sunday April 20, 2014 @04:51AM (#7616273)
London makes this information available, allowing the sort of visualisation you suggest [1]. As you say, it's interesting but not that practical from a commuter's perspective.

[1] http://traintimes.org.uk/map/tube/

Re:NYC Subway Data REST API by artursapek on Sunday April 20, 2014 @09:28AM (#7616715)
Wow. Thanks for sharing that.
Re:NYC Subway Data REST API by paul_f on Sunday April 20, 2014 @07:47AM (#7616518)
Agree! Seems this is the most important thing and I'm surprised it's not available. Without it, this api doesn't seem to add much value.
Re:NYC Subway Data REST API by rkuykendall-com on Saturday April 19, 2014 @11:04PM (#7615658)
Could you just do this with arrival estimates? It would take some work, but I think it's possible.
Re:NYC Subway Data REST API by mikeyouse on Sunday April 20, 2014 @12:07AM (#7615811)
You could definitely just interpolate between arrival times for stations. Add in a little historical averaging for the same routes (maybe broken out by hour / day of week) and I bet you could get pretty close to accurate.
Re:NYC Subway Data REST API by Ryel on Saturday April 19, 2014 @10:38PM (#7615587)
I've tried almost every NYC subway/bus app and I've finally given up. They're all fairly useless IMO. I'd rather just wait 5 minutes for the next train than bother with any of the current apps.

That being said, I wish Google would take on the challenge and include subway info.

- If somebody made a NYC transit app that I actually felt comfortable relying on... I would love push notifications ASAP of when my frequented trains/buses are down. I always forget to check the night before so please just tell me and make it relevant.

-Also I really want a detailed map of NYC that I can view offline but it needs to be lightning fast.

After all the frustration dealing with those apps, a couple months ago I finally decided to buy a paper map of NYC and start memorizing all that I can. I feel a bit more liberated and a little more like a NYC aficionado (snob).

Re:NYC Subway Data REST API by mpcadosch on Saturday April 19, 2014 @11:02PM (#7615653)
Hi guys, my initial project was to build a visualization like the one @artursapek describes, and ended up making this API because the MTA doesn't have one.

Totally agree that it would be really cool.

I made this nycpulse.herokuapp.com, but it could be so much cooler.

Re:NYC Subway Data REST API by parm289 on Saturday April 19, 2014 @11:03PM (#7615656)
Any plans to open source the code?
Re:NYC Subway Data REST API by mpcadosch on Saturday April 19, 2014 @11:13PM (#7615684)
Re:NYC Subway Data REST API by parm289 on Sunday April 20, 2014 @12:56PM (#7617484)
Awesome, thanks.
Re:NYC Subway Data REST API by JulianWasTaken on Saturday April 19, 2014 @11:25PM (#7615716)
Nice work.

I'm not sure how I interpret that arrivals say that a train arrives at my station at 8:42:30 and 8:43:00 (within 30 seconds of each other. Also I've never seen a train arrive at either of those times :). So I wonder how accurate the arrival times are in general.

(P.S. It'd be nice if arrivals was sorted in the response, not sure if that's an artifact of the way this is parsed from the data source or not).

Re:NYC Subway Data REST API by mpcadosch on Saturday April 19, 2014 @11:39PM (#7615758)
Thanks :) Which station are you?

I couldn't find one with a 30 second interval.

Re:NYC Subway Data REST API by JulianWasTaken on Sunday April 20, 2014 @09:36AM (#7616741)
Re:NYC Subway Data REST API by parm289 on Saturday April 19, 2014 @11:05PM (#7615661)
For those of you on iOS looking for a polished transit app with support for multiple cities, I highly recommend Transit.[0] It allows you to quickly map trips as well as easily save data for offline access.

[0]: http://thetransitapp.com

Re:NYC Subway Data REST API by mpcadosch on Saturday April 19, 2014 @11:33PM (#7615743)
"The arrival times listed on the website are likely just timetable times. Until the MTA releases real time data"

@aerialfish you are correct, this data is taken from timetables, as the MTA does not release real-time data. But it is probably very close

Re:NYC Subway Data REST API by jansanchez on Sunday April 20, 2014 @12:40AM (#7615876)
They do for the numbered lines: http://datamine.mta.info/
Re:NYC Subway Data REST API by Buetol on Saturday April 19, 2014 @11:41PM (#7615765)
App request too: I would like an application that wake me up 5 minutes before my stop.
Re:NYC Subway Data REST API by jarjar500 on Monday April 21, 2014 @03:46PM (#7623225)
currently working on this. :)
Re:NYC Subway Data REST API by mpcadosch on Saturday April 19, 2014 @11:31PM (#7615736)
As promised, open source: https://github.com/mimouncadosch/MTA-API

Feel free to make it better :)

Re:NYC Subway Data REST API by mpweiher on Sunday April 20, 2014 @06:39AM (#7616425)
How is GTFs "..not particularly useful for developers"? I played around with it a little and found it to be perfectly usable/useful comma-separated values.
Re:NYC Subway Data REST API by dalek2point3 on Sunday April 20, 2014 @10:46AM (#7616911)
+! GTFS is super awesome and most apps I know rely on it. Its consistent format that is adopted by transit systems across the globe. couldnt get more developer friendly than that. If you developed with this RESTful API, it would be hard to adapt your app to use the feed for a different city.
Re:NYC Subway Data REST API by fsk on Sunday April 20, 2014 @10:30AM (#7616866)
It has everything but what I was looking for, a notification of when a line is delayed.
Re:NYC Subway Data REST API by kbar13 on Saturday April 19, 2014 @10:27PM (#7615559)
is this open source?
Re:NYC Subway Data REST API by mpcadosch on Saturday April 19, 2014 @11:08PM (#7615667)
It's not yet, but will be soon :)