Introduction
This document summarizes the RCRS_Event_Data external web service of the PennDOT Road Condition Reporting System (RCRS). This service provides Statewide event and winter road condition information to outside agencies and vendors.
Audience
This document is intended for agency or vendor developers who want to obtain RCRS event information for use in external systems. It provides an introduction to using the RCRS_Event_Data service and reference material on the available parameters.
What Is Web API?
From Wikipedia.org:
A web API is an application programming interface (API) for either a web server or a web browser. It is a web development concept, usually limited to a web application's client-side (including any web frameworks being used), and thus usually does not include web server or browser implementation details such as SAPIs or web browser engine APIs unless publicly accessible by a remote web application.
Endpoints
Endpoints are important aspects of interacting with server-side web APIs, as they specify where resources lie that can be accessed by third party software. Usually the access is via a URI to which HTTP requests are posed, and from which the response is thus expected. Endpoints need to be static, otherwise the correct functioning of software that interacts with it cannot be guaranteed. If the location of a resource changes (and with it the endpoint) then previously written software will break, as the required resource can no longer be found at the same place. As API providers still want to update their web APIs, many have introduced a versioning system in the URI that points to an endpoint, for example the Clarifai API: The endpoint for the tagging functionality within the web API has the following URI: "https://api.clarifai.com/v1/tag/". The "/v1/" part of the URI specifies access to the first version of the web API. If clarifai decides to update to version two, they can do this while still maintaining support for third party software that uses the first version.
Resource vs. service
Although "web API" is sometimes considered a synonym for web service, Web 2.0 web applications have moved away from SOAP-based web services towards more cohesive collections of RESTful web resources.[5] These RESTful web APIs are accessible via standard HTTP methods by a variety of HTTP clients including browsers and mobile devices. They have advantages over web services in that they tend to be less difficult to develop and less resource intensive (and thus usually run faster) since they do not need to perform as many data conversions as required by a SOAP-based service APIs.
Requesting Access
To access PennDOT's RCRS_Event_Data service, new users are required to complete and submit a Data Feed Request Form. Once the form is submitted, we will process your request and generate the necessary credentials for accessing the data feed. These credentials will be sent to you directly. Please ensure that all required information is provided accurately to expedite the process.
Service Limitations
Currently there are no request limitations for this service. Any limitations added in the future will be included in this section.
RCRS_Event_Data Service
The RCRS_Event_Data service is a Web API service that can be accessed from any client that can make an HTTP request and process a JSON response. Each method listed below can be accessed using a standard HTTP GET request. The format of the web service requests and responses will be described in this document.
This service uses HTTP Basic Authentication for credential authentication and authorization. User credentials must be encoded in base 64 and set in the authorization header of the service request. An example for setting the authorization header is shown below.
Secure Socket Layer (SSL) must be enabled by prepending "https://" to each service request.
Methods
Method | Description |
---|---|
liveEvents | Provides Pennsylvania road events which are active in RCRS at the time of the request. |
plannedEvents | Provides Pennsylvania road events which are planned in RCRS at the time of the request. |
winterConditions | Provides Pennsylvania roadway winter conditions which are active in RCRS at the time of the request. |
liveEvents Method
The liveEvents method of the RCRS_Event_Data service returns Pennsylvania road events that are active in RCRS at the time of the request.
Properties
Properties | Type | Description |
---|---|---|
ActualDateTimeOpened | Date/Time | The date and time that the roadway was re-opened and the event was removed from the system in the format: YYYY-MM-DD HH:MM:SS. Once the roadway has been re-opened the event record will remain in the feed for 30 minutes with the ActualDateTimeOpened listed. |
DateTimeVerified | Date/Time | The date and time that the event was verified in the format: YYYY-MM-DD HH:MM. |
IsHazmat | Boolean | Event involves a hazmat material: T = True, F = False. |
HazmatPlacardID | Text | List of Hazmat Placard identifiers involved in the event. |
HazmatMaterialName | Text | List of hazmat material involved in the event. Multiple materials may be listed and when present are generally delimited with commas. |
IsFatality | Boolean | Event involves one or more fatalities: T = True, F = False. |
IsSchoolBus | Boolean | Event involves a school bus: T = True, F = False. |
IsCommercialVehicleRollover | Boolean | Event involves a commercial vehicle rollover: T = True, F = False. |
IsCrashInConstructionZone | Boolean | Event involves a crash in a construction zone: T = True, F = False. |
IsPennDOTPropertyAndOrEmployeeInvolved | Boolean | Event involves a PennDOT employee or occurs on PennDOT property: T = True, F = False. |
IsAutonomousVehicle | Boolean | Event involves an autonomous vehicle: T = True, F = False. |
IsTransitOrTourBus | Boolean | Event involves a transit or tour bus: T = True, F = False. |
IsFirstResponderWithMajorInjuryOrFatality | Boolean | Event involves a first responder with either a major injury or fatality: T = True, F = False. |
IsTrain | Boolean | Event involves a train: T = True, F = False. |
IsAmishConveyance | Boolean | Event involves an amish conveyance: T = True, F = False. |
IsAircraft | Boolean | Event involves an aircraft: T = True, F = False. |
IsBridgeStrike | Boolean | Event involves a bridge strike: T = True, F = False. |
RestrictedSpeedValue | Number | Speed restriction for event in Miles Per Hour. |
VehicleRestrictText | Text | Vehicle restrictions for event. Multiple vehicle restrictions may be returned in this element in a comma delimited list of values. Please see the Code Table section of this document for the full list of VehicleRestrictText values. |
VehicleRestrictTier | Text | Vehicle restriction tier for event. Multiple vehicle restrictions belong to one tier. Please see the Code Table section of this document for the full list of VehicleRestrictTier values. |
EventID | Number | The unique ID for the event in RCRS. |
EventClass | Number | |
EventType | Text | Text value indicating the cause of the event. Please see the Code Tables section of this document for a full list of EventType values. |
ReportOrgID | Number | The PennDOT district associated with the event. |
Facility | Text | The display name of the roadway. In the case of 4-digit, smaller county roads, the route number is not included. The facility names between Events and Winter Conditions are not in the same format. This is a product of the 511 design and may be altered in the future. |
Direction | Text | Roadway direction affected by the event. Please see the Code Tables section of this document for a full list of Direction values. |
FromLoc | Text | Text description of the starting location of the event. Since this data stream was designed for 511, there are some logic items to be aware of with the names of the beginning, ending, and incident locations for Events.
|
FromLocLatLong | Text | The Latitude and Longitude of the starting location of the event in the format: xx.xxxxxxxxxxxxx, -yy.yyyyyyyyyyyyy |
FromLocMileage | Number | Mileage to FromLoc. |
FromLocDirection | Text | Ordinal direction to FromLoc. |
ToLoc | Text | Text description of the ending location of the event. |
ToLocLatLong | Text | The Latitude and Longitude of the ending location of the event in the format: xx.xxxxxxxxxxxxx, -yy.yyyyyyyyyyyyy |
ToLocMileage | Number | Milage to ToLoc. |
ToLocDirection | Text | Ordinal direction to ToLoc. |
IncidentLoc | Text | Text description of the incident location. |
IncidentLocLatLong | Text | The Latitude and Longitude of the incident location in the format: xx.xxxxxxxxxxxxx, -yy.yyyyyyyyyyyyy |
IncidentLocMileage | Number | Milage to IncidentLoc. |
IncidentLocDirection | Text | Ordinal direction to IncidentLoc. |
DateTimeEventOccurs | Date/Time | If the event originated as a planned event, then this is the date and time that the event began in the format: YYYY-MM-DD HH:MM. |
CreateTime | Date/Time | The date and time that the event was created in RCRS in the format: YYYY-MM-DD HH:MM:SS |
LastUpdate | Date/Time | The last date and time this event was updated in RCRS in the format: YYYY-MM-DD HH:MM:SS. |
State | Text | Always the two character State abbreviation for Pennsylvania: PA |
County | Number | The county number associated with this event. The county numbers are not translated in the feed. Please see the Code Table section of this document for a full list of County values. |
CountyName | Text | The county name associated with this event. |
LaneStatus | Text | The current status of the event. Please see the Code Table section of this document for the full list of LaneStatus values. |
AffectedLanes | Text | The Lanes or Shoulders that are affected by the event. Please see the Code Table section of this document for the full list of AffectedLanes values. |
DetourInEffect | Boolean | Detour is in effect: T=True, F=False. |
IsInterstate | Boolean | Event occurs on an interstate: T=True, F=False. |
Description | Text | Text description of the overall event. |
DateTimeNotified | Date/Time | The date and time that the event was reported in the format: YYYY-MM-DD HH:MM. |
IncidentMuniName | Text | Name of township or borough in which the incident occurred. |
PoliceJurisText | Text | The police jurisdiction for the event. Please see the Code Table section of this document for the full list of PoliceJurisText values. |
Is511Event | Boolean | Is a 511 event: T = True, F = False. |
StateRouteNo | Number | The state route number associated with the event. |
CountyFrom | Number | The county code associated with the beginning location of the event. |
CountyFromName | Text | The county name associated with the beginning location of the event. |
BeginSegPoint | Number | Eight digit number containing the beginning segment and offset of the event. The first four numbers are the segment number and the last four numbers are the offset. |
CountyTo | Number | The county code associated with the ending location of the event. |
CountyToName | Text | The county name associated with the ending location of the event. |
EndSegPoint | Number | Eight digit number containing the ending segment and offset of the event. The first four numbers are the segment number and the last four numbers are the offset. |
CountyInc | Number | The county code associated with the incident location of the event. |
CountyIncName | Text | The county name associated with the incident location of the event. |
IncSegPoint | Number | Eight digit number containing the incident segment and offset of the event. The first four numbers are the segment number and the last four numbers are the offset. |
HaulerRestrictionInEffect | Boolean | Flag indicating whether event affects haulers: T = True, F = False |
IsTemporaryTrafficControlDevicesInUse | Boolean | Flag indicating whether a temporary traffic control device is in use: T = True, F = False |
IsHaulerRestriction24x7 | Boolean | Flag indicating whether the hauler restriction is in effect for the entire duration of a repetitve event: T = True, F = False |
NoPermitTravel | Boolean | Flag indicating that permitted travel is prohibited. T = True, F = False. |
MaxLengthRestriction | Number | The maximum allowable vehicle length in inches. If no value was defined then this field will default to 0. |
MaxWidthRestriction | Number | The maximum allowable vehicle width in inches. If no value was defined then this field will default to 0. |
MaxHeightRestriction | Number | The maximum allowable vehicle height in inches. If no value was defined then this field will default to 0. |
MaxWeightRestriction | Number | The maximum allowable vehicle weight in pounds. If no value was defined then this field will default to 0. |
[EventRepetitionDetails] RepetitionID | Text | The ID for the Repetitive Event. If the event is not repetitive, will reflect: "One Time Event". |
[EventRepetitionDetails] Occurs | Text | The day(s) of the week on which the event occurs. If the event is not repetitive, will reflect "N/A". Please see the Code Table section of this document for the full list of Occurs values. |
[EventRepetitionDetails] SkipHolidays | Text | Indicates whether the event will be scheduled for, and can occur on, holidays: YES/NO. If the event is not repetitive, will reflect "N/A". |
[EventRepetitionDetails] StartDate | Text | The Start Date of the Repetitive Event. If the event is not repetitive, will reflect "N/A". |
[EventRepetitionDetails] EndDate | Text | The End Date of the Repetitive Event. If the event is not repetitive, will reflect "N/A". |
[EventRepetitionDetails] DailyStartTime | Text | The Start Time for each occurrence of the Repetitive Event. If the event is not repetitive, will reflect "N/A". |
[EventRepetitionDetails] DailyEndTime | Text | The End Time for each occurrence of the Repetitive Event. If the event is not repetitive, will reflect "N/A". |
Detours | JSON | A listing of all detours that are in effect for the event. Each detour will contain a detour ID, direction, vehicle type, color ID, total distance and narrative. |
Example
HTTP Request
The following is a sample HTTP GET request using jQuery AJAX. The placeholders shown need to be replaced with the PDAuth credentials.
$.ajax({
url: 'https://eventsdata.dot.pa.gov/liveEvents',
type: 'GET',
data: '',
dataType: 'json',
beforeSend: function (xhr) {
xhr.setRequestHeader("Authorization", "Basic " + btoa(username + ":" + password));
},
success: function (result, status, XMLHttpRequest) {
//on success
},
error: function (XMLHttpRequest, status, error) {
//on error
}
});
HTTP Response
The following is a sample HTTP response from the liveEvents method.
{
"Values": [
{
"ActualDateTimeOpened": "",
"DateTimeVerified": "2019-08-27 14:31",
"IsHazmat": "F",
"HazmatPlacardID": "",
"HazmatMaterialName": "",
"IsFatality": "F",
"IsSchoolBus": "F",
"IsCommercialVehicleRollover": "F",
"IsCrashInConstructionZone": "F",
"IsPennDOTPropertyAndOrEmployeeInvolved": "F",
"IsAutonomousVehicle": "F",
"IsTransitOrTourBus": "F",
"IsFirstResponderWithMajorInjuryOrFatality": "F",
"IsTrain": "F",
"IsAmishConveyance": "F",
"IsAircraft": "F",
"IsBridgeStrike": "F",
"RestrictedSpeedValue": "",
"VehicleRestrictText": "",
"EventID": 581,
"EventClass": "3",
"EventType": "roadwork",
"ReportOrgID": "11",
"Facility": "HITE RD / TAWNEY RUN RD",
"Direction": "eastbound",
"FromLoc": "Intersection of PITTSBURGH MILLS BL in FRAZER [2TWP]",
"FromLocLatLong": "40.5662781980593,-79.7956370235785",
"FromLocMileage": "",
"FromLocDirection": "",
"ToLoc": "Intersection of MURRAY HILL RD / + BUTLER LOGAN RD in FRAZER [2TWP]",
"ToLocLatLong": "40.5705014313923,-79.7906322059793",
"ToLocMileage": "",
"ToLocDirection": "",
"IncidentLoc": "",
"IncidentLocLatLong": "",
"IncidentLocMileage": "",
"IncidentLocDirection": "",
"DateTimeEventOccurs": "2019-08-27 14:30",
"CreateTime": "2019-08-27 14:31:55",
"LastUpdate": "2019-08-27 14:31:55",
"State": "PA",
"County": "02",
"CountyName": "ALLEGHENY",
"LaneStatus": "lane restriction",
"AffectedLanes": "",
"VehicleRestrictTier": "",
"DetourInEffect": "F",
"IsInterstate": "F",
"Description": "Roadwork on HITE RD / TAWNEY RUN RD eastbound between PITTSBURGH MILLS BL and MURRAY HILL RD / + BUTLER LOGAN RD. There is a lane restriction.",
"DateTimeNotified": "2019-08-27 14:31",
"IncidentMuniName": "FRAZER [2TWP]",
"PoliceJurisText": "",
"Is511Event": "F",
"StateRouteNo": "1014",
"CountyFrom": "02",
"CountyFromName": "ALLEGHENY",
"BeginSegPoint": "00540627",
"CountyTo": "02",
"CountyToName": "ALLEGHENY",
"EndSegPoint": "00602118",
"CountyInc": "",
"CountyIncName": "",
"IncSegPoint": "",
"IsTemporaryTrafficControlDevicesInUse": "F",
"HaulerRestrictionInEffect": "F",
"IsHaulerRestriction24x7": "F",
"NoPermitTravel": "F",
"MaxLengthRestriction": 0,
"MaxWidthRestriction": 0,
"MaxHeightRestriction": 0,
"MaxWeightRestriction": 0,
"EventRepetitionDetails": {
"RepetitionID": "One Time Event",
"Occurs": "N/A",
"SkipHolidays": "N/A",
"StartDate": "N/A",
"EndDate": "N/A",
"DailyStartTime": "N/A",
"DailyEndTime": "N/A"
},
"Detours": [
{
"DetourID": 6982,
"Direction": "E",
"VehicleType": "B",
"ColorID": "4",
"TotalLength": 5.144,
"Narrative": ""
}
]
}
]
}
plannedEvents Method
The plannedEvents method of the RCRS_Event_Data service returns Pennsylvania road events that are planned in RCRS at the time of the request.
Properties
Properties | Type | Description |
---|---|---|
EventID | Number | The unique ID for the event in RCRS. |
EventClass | Number | |
EventType | Text | Text value indicating the cause of the event. Please see the Code Tables section of this document for a full list of EventType values. |
ReportOrgID | Number | The PennDOT district associated with the event. |
Facility | Text | The display name of the roadway. In the case of 4-digit, smaller county roads, the route number is not included. The facility names between Events and Winter Conditions are not in the same format. This is a product of the 511 design and may be altered in the future. |
Direction | Text | Roadway direction affected by the event. Please see the Code Tables section of this document for a full list of Direction values. |
FromLoc | Text | Text description of the starting location of the event. Since this data stream was designed for 511, there are some logic items to be aware of with the names of the beginning, ending, and incident locations for Events.
|