Requesting Transcom Events



To request data from from the data manager API we use a Falcor route, this is accomplished by appending a url encoded json graph address to the api.


For Example


Getting the Length of Data which Matches your Query


Here I am querying the Transcom Events Dataset (https://npmrds.transportny.org/datasources/source/956) for events which are in June 2025 in Region 1. Because this API lets you query data in similar ways to SQL, we don't know in advance how many data records the response will return so first we need to find that out.


https://graph.availabs.org/graph?paths=%5B%5B%22uda%22%2C%22npmrds2%22%2C%22viewsById%22%2C1947%2C%22options%22%2C%22%7B%5C%22groupBy%5C%22%3A%5B%5D%2C%5C%22filter%5C%22%3A%7B%5C%22month_year%5C%22%3A%5B%5C%2206-2025%5C%22%5D%2C%5C%22region_name%5C%22%3A%5B%5C%22Region%201%20-%20Capital%20District%5C%22%5D%7D%2C%5C%22exclude%5C%22%3A%7B%7D%2C%5C%22normalFilter%5C%22%3A%5B%5D%7D%22%2C%22length%22%5D%5D&method=get

the response to this request is:

{"jsonGraph":{"uda":{"npmrds2":{"viewsById":{"1947":{"options":{"{\"groupBy\":[],\"filter\":{\"month_year\":[\"06-2025\"],\"region_name\":[\"Region 1 - Capital District\"]},\"exclude\":{},\"normalFilter\":[]}":{"length":1262}}}}}}}}

which simply tells you the number of values that match this query is 1262.



while this looks complicated this is really just

https://graph.availabs.org/graph?paths=

plus a url encoded (https://www.urlencoder.org/) version of

[["uda","npmrds2","viewsById",1947,"options","{\"groupBy\":[],\"filter\":{\"month_year\":[\"06-2025\"],\"region_name\":[\"Region 1 - Capital District\"]},\"exclude\":{},\"normalFilter\":[]}","length"]]


Lets take a look at this object a little closer:


[[
"uda", //this is the route for our Universal Data Adapater (uda) which can pull data from many databases
"npmrds2", // this indicates the database being pulled from, in this case npmrds2 (which corresponds to data manager
"viewsById",1947, // this corresponse to the view Id of the data set being pulled
"options", // the options route takes string encoded json object as specified in the data manager api
"{\"groupBy\":[],\"filter\":{\"month_year\":[\"06-2025\"],\"region_name\":[\"Region 1 - Capital District\"]},\"exclude\":{},\"normalFilter\":[]}",
"length" // instead of requesting columns from the data here we are just requesting that datas length.
]]


Getting the Data from a View which Matches your Query


The following path requests

https://graph.availabs.org/graph?paths=%5B%5B%22uda%22%2C%22npmrds2%22%2C%22viewsById%22%2C1947%2C%22options%22%2C%22%7B%5C%22groupBy%5C%22%3A%5B%5D%2C%5C%22orderBy%5C%22%3A%7B%5C%22cost%5C%22%3A%5C%22desc%20nulls%20last%5C%22%7D%2C%5C%22filter%5C%22%3A%7B%5C%22month_year%5C%22%3A%5B%5C%2206-2025%5C%22%5D%2C%5C%22region_name%5C%22%3A%5B%5C%22Region%201%20-%20Capital%20District%5C%22%5D%7D%2C%5C%22exclude%5C%22%3A%7B%7D%2C%5C%22normalFilter%5C%22%3A%5B%5D%2C%5C%22meta%5C%22%3A%7B%7D%7D%22%2C%22dataByIndex%22%2C%7B%22from%22%3A0%2C%22to%22%3A4%7D%2C%5B%22event_id%20as%20event_id%22%2C%22reporting_organization%20as%20reporting_organization%22%2C%22event_class%20as%20event_class%22%2C%22start_date_time%20as%20start_date_time%22%2C%22close_date%20as%20close_date%22%2C%22facility%20as%20facility%22%2C%22event_duration%20as%20event_duration%22%2C%22event_type%20as%20event_type%22%2C%22lanes_total_count%20as%20lanes_total_count%22%2C%22lanes_affected_count%20as%20lanes_affected_count%22%2C%22lanes_detail%20as%20lanes_detail%22%2C%22lanes_status%20as%20lanes_status%22%2C%22description%20as%20description%22%2C%22direction%20as%20direction%22%2C%22event_location_latitude%20as%20event_location_latitude%22%2C%22event_location_longitude%20as%20event_location_longitude%22%2C%22recoverytime%20as%20recoverytime%22%2C%22f_system%20as%20f_system%22%2C%22vehicle_delay%20as%20vehicle_delay%22%2C%22cost%20as%20cost%22%5D%5D%5D&method=get


Let's take a close look at the object which is getting sent to the api here

[[
"uda",
"npmrds2",
"viewsById",1947,
"options",
"{\"groupBy\":[],\"orderBy\":{\"cost\":\"desc nulls last\"},\"filter\":{\"month_year\":[\"06-2025\"],\"region_name\":[\"Region 1 - Capital District\"]},\"exclude\":{},\"normalFilter\":[],\"meta\":{}}",
"dataByIndex",{"from":0,"to":4},
["event_id as event_id","reporting_organization as reporting_organization","event_class as event_class","start_date_time as start_date_time","close_date as close_date","facility as facility","event_duration as event_duration","event_type as event_type","lanes_total_count as lanes_total_count","lanes_affected_count as lanes_affected_count","lanes_detail as lanes_detail","lanes_status as lanes_status","description as description","direction as direction","event_location_latitude as event_location_latitude","event_location_longitude as event_location_longitude","recoverytime as recoverytime","f_system as f_system","vehicle_delay","cost as cost"]]]

This returns

{
"jsonGraph": {
"uda": {
"npmrds2": {
"viewsById": {
"1947": {
"options": {
"{\"groupBy\":[],\"orderBy\":{\"cost\":\"desc nulls last\"},\"filter\":{\"month_year\":[\"06-2025\"],\"region_name\":[\"Region 1 - Capital District\"]},\"exclude\":{},\"normalFilter\":[],\"meta\":{}}": {
"dataByIndex": {
"0": {
"event_id as event_id": "ORI1237917919",
"reporting_organization as reporting_organization": "NYSDOT TMC - Albany",
"event_class as event_class": "Incident",
"start_date_time as start_date_time": {
"$type": "atom",
"value": "2025-06-25T17:01:58.000Z"
},
"close_date as close_date": {
"$type": "atom",
"value": "2025-06-25T17:14:16.000Z"
},
"facility as facility": "I-90",
"event_duration as event_duration": "0 - 00:13",
"event_type as event_type": "Disabled vehicle",
"lanes_total_count as lanes_total_count": 4,
"lanes_affected_count as lanes_affected_count": {
"$type": "atom",
"value": null
},
"lanes_detail as lanes_detail": "right shoulder",
"lanes_status as lanes_status": "closed",
"description as description": "NYSDOT TMC - Albany: Disabled vehicle on I-90 westbound Exit 6; US 9 (Albany) right shoulder closed HT 103",
"direction as direction": "westbound",
"event_location_latitude as event_location_latitude": {
"$type": "atom",
"value": null
},
"event_location_longitude as event_location_longitude": {
"$type": "atom",
"value": null
},
"recoverytime as recoverytime": {
"$type": "atom",
"value": null
},
"f_system as f_system": 1,
"vehicle_delay as vehicle_delay": "4072.8296476032688",
"cost as cost": "78062"
},
"1": {
"event_id as event_id": "ORI1237904893",
"reporting_organization as reporting_organization": "NYSDOT TMC - Albany",
"event_class as event_class": "Incident",
"start_date_time as start_date_time": {
"$type": "atom",
"value": "2025-06-12T13:00:12.000Z"
},
"close_date as close_date": {
"$type": "atom",
"value": "2025-06-12T18:30:08.000Z"
},
"facility as facility": "I-87 Northway",
"event_duration as event_duration": "0 - 05:30",
"event_type as event_type": "Construction",
"lanes_total_count as lanes_total_count": 3,
"lanes_affected_count as lanes_affected_count": {
"$type": "atom",
"value": null
},
"lanes_detail as lanes_detail": "both shoulder",
"lanes_status as lanes_status": "closed",
"description as description": "NYSDOT TMC - Albany: Construction , mowing on I-87 Northway both directions Twin Bridges; Town of Halfmoon; Town of Colonie Line (Colonie) to Saratoga-Warren County Line (Queensbury) both shoulder of 3 lanes closed until 2:30 PM & herbicide application",
"direction as direction": "both directions",
"event_location_latitude as event_location_latitude": {
"$type": "atom",
"value": null
},
"event_location_longitude as event_location_longitude": {
"$type": "atom",
"value": null
},
"recoverytime as recoverytime": {
"$type": "atom",
"value": null
},
"f_system as f_system": 1,
"vehicle_delay as vehicle_delay": "3444.78123082084",
"cost as cost": "66627"
},
"2": {
"event_id as event_id": "ORI1237917870",
"reporting_organization as reporting_organization": "NYSDOT TMC - Albany",
"event_class as event_class": "Incident",
"start_date_time as start_date_time": {
"$type": "atom",
"value": "2025-06-25T16:17:21.000Z"
},
"close_date as close_date": {
"$type": "atom",
"value": "2025-06-25T17:42:57.000Z"
},
"facility as facility": "I-90",
"event_duration as event_duration": "0 - 01:25",
"event_type as event_type": "Crash",
"lanes_total_count as lanes_total_count": 3,
"lanes_affected_count as lanes_affected_count": 2,
"lanes_detail as lanes_detail": "2 Left lanes",
"lanes_status as lanes_status": "closed",
"description as description": "NYSDOT TMC - Albany: Crash on I-90 westbound on Patroon Island Bridge; Albany and Rensselaer County Line (Albany) 2 Left lanes of 3 lanes closed",
"direction as direction": "westbound",
"event_location_latitude as event_location_latitude": {
"$type": "atom",
"value": null
},
"event_location_longitude as event_location_longitude": {
"$type": "atom",
"value": null
},
"recoverytime as recoverytime": {
"$type": "atom",
"value": null
},
"f_system as f_system": 1,
"vehicle_delay as vehicle_delay": "1728.6422458826478",
"cost as cost": "33323"
},
"3": {
"event_id as event_id": "ORI1237918696",
"reporting_organization as reporting_organization": "NYSDOT TMC - Albany",
"event_class as event_class": "Incident",
"start_date_time as start_date_time": {
"$type": "atom",
"value": "2025-06-26T08:00:08.000Z"
},
"close_date as close_date": {
"$type": "atom",
"value": null
},
"facility as facility": "NY 146",
"event_duration as event_duration": "0 - 02:32",
"event_type as event_type": "Construction",
"lanes_total_count as lanes_total_count": 3,
"lanes_affected_count as lanes_affected_count": {
"$type": "atom",
"value": null
},
"lanes_detail as lanes_detail": "right shoulder",
"lanes_status as lanes_status": "closed",
"description as description": "NYSDOT TMC - Albany: Construction , street sweeping on NY 146 both directions Plank Road and Blue Barns Rd (Clifton Park) right shoulder of 3 lanes closed until 3:00 PM",
"direction as direction": "both directions",
"event_location_latitude as event_location_latitude": {
"$type": "atom",
"value": null
},
"event_location_longitude as event_location_longitude": {
"$type": "atom",
"value": null
},
"recoverytime as recoverytime": {
"$type": "atom",
"value": null
},
"f_system as f_system": 3,
"vehicle_delay as vehicle_delay": "1513.7154258136104",
"cost as cost": "25835"
},
"4": {
"event_id as event_id": "ORI1237903520",
"reporting_organization as reporting_organization": "NYSDOT TMC - Albany",
"event_class as event_class": "Incident",
"start_date_time as start_date_time": {
"$type": "atom",
"value": "2025-06-11T13:00:10.000Z"
},
"close_date as close_date": {
"$type": "atom",
"value": "2025-06-11T19:00:27.000Z"
},
"facility as facility": "NY 5",
"event_duration as event_duration": "0 - 06:00",
"event_type as event_type": "Construction",
"lanes_total_count as lanes_total_count": 2,
"lanes_affected_count as lanes_affected_count": {
"$type": "atom",
"value": null
},
"lanes_detail as lanes_detail": "All lanes",
"lanes_status as lanes_status": "open",
"description as description": "NYSDOT TMC - Albany: Construction , bridge inspection on NY 5 both directions under I-90 (Albany) All lanes of 2 lanes open until 3:00 PM various lane closures",
"direction as direction": "both directions",
"event_location_latitude as event_location_latitude": {
"$type": "atom",
"value": null
},
"event_location_longitude as event_location_longitude": {
"$type": "atom",
"value": null
},
"recoverytime as recoverytime": {
"$type": "atom",
"value": null
},
"f_system as f_system": 3,
"vehicle_delay as vehicle_delay": "1640.8068948133216",
"cost as cost": "23887"
}
}
}
}
}
}
}
}
}
}


If we want congestion data we change our columns


[["uda","npmrds2","viewsById",1947,"options","{\"groupBy\":[],\"orderBy\":{\"cost\":\"desc nulls last\"},\"filter\":{\"month_year\":[\"06-2025\"],\"region_name\":[\"Region 1 - Capital District\"]},\"exclude\":{},\"normalFilter\":[],\"meta\":{}}","dataByIndex",{"from":0,"to":4},["event_id","congestion_data"]]]


this creates this link:


https://graph.availabs.org/graph?paths=%5B%5B%22uda%22%2C%22npmrds2%22%2C%22viewsById%22%2C1947%2C%22options%22%2C%22%7B%5C%22groupBy%5C%22%3A%5B%5D%2C%5C%22orderBy%5C%22%3A%7B%5C%22cost%5C%22%3A%5C%22desc%20nulls%20last%5C%22%7D%2C%5C%22filter%5C%22%3A%7B%5C%22month_year%5C%22%3A%5B%5C%2206-2025%5C%22%5D%2C%5C%22region_name%5C%22%3A%5B%5C%22Region%201%20-%20Capital%20District%5C%22%5D%7D%2C%5C%22exclude%5C%22%3A%7B%7D%2C%5C%22normalFilter%5C%22%3A%5B%5D%2C%5C%22meta%5C%22%3A%7B%7D%7D%22%2C%22dataByIndex%22%2C%7B%22from%22%3A0%2C%22to%22%3A4%7D%2C%5B%22event_id%22%2C%22congestion_data%22%5D%5D%5D&method=get