How to map route_id from LIRR/MNR json API feed to line name?

Skip to first unread message

Александр Кочкарёв

Sep 28, 2021, 9:06:10 AM9/28/21
to mtadeveloperresources

For example, i get an alert like this:

       "alert": {
            "active_period": [
                    "start": 1632506023,
                    "end": 1632507762
            "informed_entity": [
                    "agency_id": "LI",
                    "route_id": "5",
                    "transit_realtime.mercury_entity_selector": {
                        "sort_order": "LI:5:14"
            "header_text": { ... },
            "description_text": { ... }

And i want to match "route_id": "5" to some line name which i can see in page for Rails , like "Babylon", "City Zone", "Far Rockaway" etc.

Where can i get this mapping or route_id meaning information?

Patrick M

Sep 28, 2021, 10:02:35 AM9/28/21
to mtadeveloperresources
From the GTFS file (example here:

1 - Babylon
2 - Hempstead
3 - Oyster Bay
4 - Ronkonkoma
5 - Montauk
6 - Long Beach
7 - Far Rockaway
8 - West Hempstead
9 - Port Washington
10 - Port Jefferson
11 - Belmont
12 - City Zone

Александр Кочкарёв

Sep 29, 2021, 3:37:41 PM9/29/21
to mtadeveloperresources
Thank you so much! All is clear now.

Александр Кочкарёв

Oct 1, 2021, 12:54:42 PM10/1/21
to mtadeveloperresources
I've faced another trouble when try to match routes with lines.

I've got the latest files for LIRR and MNR from

But there is some inconsistency with site.

1)  LIRR routes.txt has next record:

"11","","Belmont Park","2","60269E","FFFFFF"

But there no "Belmont Park" line at in Rail section.
Why? Is this line active?

2) MNR
On site i see next lines:
"Pascack Valley"
"Port Jervis" (i found in api feed that it matched to route_id "NJT:6")

but they are not listed in MNR routes.txt:
10,5,,MNR Shore Line East,,2,,555555,FFFFFF
11,2,,Haverstraw Ferry,,4,,009B3A,FFFFFF
12,3,,Hudson Rail Link(Spuyten Duyvil),,3,,009B3A,FFFFFF
13,3,,Hudson Rail Link(Riverdale),,3,,009B3A,FFFFFF
14,2,,Newburgh Ferry,,4,,009B3A,FFFFFF
3,1,,New Haven,,2,,EE0034,FFFFFF
4,1,,New Canaan,,2,,EE0034,FFFFFF

What does it mean and how can i get route_id for this lines?

Will be glad to any advice.


On Tuesday, September 28, 2021 at 9:02:35 PM UTC+7 Patrick M wrote:
Reply all
Reply to author
0 new messages