Hacker News new | past | comments | ask | show | jobs | submit login
NYC Subway Data REST API (nycpulse.herokuapp.com)
96 points by mpcadosch on April 20, 2014 | hide | past | favorite | 37 comments



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


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...


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


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


They do, but it's GTFS format...


What's so horrifying about the GTFS format?


Doesn't the Citymapper app [1] do this for New Yorkers? Does all this and more for Londoners.

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


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.


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


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.


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.


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.


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."


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/


Wow. Thanks for sharing that.


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.


Could you just do this with arrival estimates? It would take some work, but I think it's possible.


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.


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


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.


Any plans to open source the code?



Awesome, thanks.


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


Thanks :) Which station are you?

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



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


"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


They do for the numbered lines: http://datamine.mta.info/


App request too: I would like an application that wake me up 5 minutes before my stop.


currently working on this. :)


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.


+! 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.


As promised, open source: https://github.com/mimouncadosch/MTA-API

Feel free to make it better :)


It has everything but what I was looking for, a notification of when a line is delayed.


is this open source?


It's not yet, but will be soon :)




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: