Programmatic access to data such as serviceStatus.txt?

156 views
Skip to first unread message

clevercommute

unread,
Nov 21, 2021, 12:31:32 PM11/21/21
to mtadeveloperresources
We have some legacy code which queried 
http://web.mta.info/status/serviceStatus.txt to capture overall Service Status for LIRR and Metro North. 
is that still supported? Is there a better way to get Status for each line? 

kennet...@gmail.com

unread,
Nov 23, 2021, 10:03:20 PM11/23/21
to mtadeveloperresources
Looks like its still supported and actually recommended here: https://api.mta.info/#/staticFeeds

Sam Salkin

unread,
Dec 1, 2021, 9:59:26 AM12/1/21
to mtadeveloperresources
We don't support the legacy serviceStatus feed and strongly recommend adopting the GTFS alerts feed. This disaggregates lines from their trunk and provides planned and unplanned disruptions in the same feed.  With the changes we're making to add a consistent headline/details, the legacy feed will likely not present information the correct way.

--Sam

clevercommute

unread,
Jun 13, 2022, 9:49:05 PM6/13/22
to mtadeveloperresources

When I send this request to lirr-alerts api I get below line status which does not match Metropolitan Transportation Authority info for LIRR. 

Am I misunderstanding something about how this is supposed to work?


suspended
multiple impacts
part suspended
trains rerouted
delays
service change
local to express
express to local
stations skipped
some delays
slow speeds
planned work
good service
on or close
boarding change
weekday service
special schedule
extra service
planned - substitute buses
planned - part suspended
planned - stations skipped
reduced service
special event
no scheduled service
planned - boarding change
saturday schedule
station notice
sunday schedule
weekend schedule

1$headers = ['x-api-key: ______________________]; 
3 4$curl = curl_init(); 
6 curl_setopt( $curl, CURLOPT_URL, $apiUrl ); 
7 curl_setopt( $curl, CURLOPT_RETURNTRANSFER, 1 ); 
8 curl_setopt( $curl, CURLOPT_HTTPHEADER, $headers); 
10 try { 
11 $results = json_decode(curl_exec($curl), true, 512, JSON_THROW_ON_ERROR); 
12 } catch (JsonException $e) { 
13 echo $e; 
14 exit(); 
15 }
Reply all
Reply to author
Forward
0 new messages