The INRIX DangerousRoads API provides danger information on road segments that are contained within a specified geographic area. INRIX XD Segments (XDS) of FRC 1, 2 or 3 will be returned.
Specifically the following apis exist: GetDangerInBox, GetDangerInRadius, GetDangerInGeography, GetDangerOfSegments
Description: Gets danger rating for roads in a specified region.
dangerousroads-api.inrix.com/v1/dangerousroads
GETGets danger rating for roads in a specified region.
Parameters
= required
Name
Located In
Type
Description
accesstoken
Query
String
A valid access token provided from the GET appToken API response. Alternatively, the accesstoken can be added to the request header instead of a url parameter using format 'Authorization: Bearer xxxx.xxx.xxxx'.
box
Query
String
“box” specifies two latitude and longitude pairs (using the WGS 84 datum) that outline a bounding box. The first lat/long pair should be the northwestern most point, and the second pair the southeastern most point. Format- [lat1]|[long1],[lat2]|[long2]. Either box or point and radius parameters are required.
point
Query
String
Used to select a region based on a point and radius. If used, other Location parameters cannot be used. Format- [lat]|[long]. Either box or point and radius or geoId parameters are required.
radius
Query
Double
Used to select a region based on a point and radius in meters. If used, other Location parameters cannot be used. Either box or point and radius or geoId parameters are required.
geoId
Query
Integer
Used to select a region based on a geography. “geoid” specifies the ID of the specified geography. For more information on how to obtain the ID, see GetGeography. When using a custom GeoId (previously created with CreateGeography), the first call will create cached files. Once these have been created the call will return the correct information. Using Geographies with a large area (e.g. countries) is not recommended. Either box or point and radius or geoId parameters are required.
ids
Query
String
The predefined comma-delimited list of INRIX XD Segment IDs for which to get data. For example 123456789,1122334455,987654321. Segments without danger data and invalid segments will not be returned.
units
Query
Integer
Use 0 for English units, 1 for metric. Default is 0.
DangerOutputFields
Query
Integer
The danger fields to be returned in the response. If this DangerOutputFields is not specified, defaults to 'Segments'.
Value
Description
Segments
Returns a danger rating between 1-5 for each segment
Average
Returns the average danger rating for all segments of FRC 1,2,3 in the specified region. Incompatible with dangerList parameter.
DangerList
Query
Integer
If specified when DangerOutPutFields='Segments', instead of returning all segments, the specified top amount will be returned. For example, if '10' was entered, the top 10 most dangerous road segments in the chosen region would be returned. Default is 0, which returns all segments.
flowType
Query
Integer
Specifies the flow type to be returned. Default is 0.
Value
Description
0
Returns an accident count for all vehicle types.
1
Returns a generalized risk score for all vehicle types.
2
Returns an accident count for trucks.
3
Returns a generalized risk score for trucks.
roadTime
Query
Integer
Specifies the time/type of danger to be returned. Default is 0
Value
Description
0
Returns a risk score accounting for all times
1
Returns a risk score for weekdays only
2
Returns a risk score for weekends only
3
Returns a risk score for peak (rush hour) only
4
Returns a risk score for off peak only
5
Instead of returning a risk score from 1-5, returns the number of accidents per million vehicle miles travelled.
{"copyright":"Copyright INRIX Inc. 2020","createdDate":"2020-10-12T00:52:43Z","responseId":"dc0963eb-ba0a-4e2b-9b14-871adf197a7e","result":{"dangerousRoads":[{"code":"1187605399","rating":1},{"code":"1187622219","rating":2}]}}