INRIX IQ logo

Overview

The Segment Speeds api returns the speeds for the road segments including any lane specific speeds such as HOV or multi-lane speeds.


Description: Gets Segment speeds in a specified region.

segment-api.inrix.com/v1/segments/speed

GET Gets Segment speeds 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'.
quadkey Query Integer A Bing Maps Tile System quadkey to generate a resulting tile which represents the described area. The minimum quadkey length is 7 digits. For more information about this format, see Bing Maps Tile System. Either quadkey, box, point and radius, geoId or ids parameters are required.
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]. There is a limit of 2 degrees between the minimum and maximum latitude and longitude values you can specify. If used, other Location parameters cannot be used. Either quadkey, box, point and radius, geoId or ids parameters are required.
point Query String Used to select a region based on a point and radius in meters. If used, other Location parameters cannot be used. Format- [lat]|[long]. Either quadkey, box, point and radius, geoId or ids parameters are required.
radius Query Double Used to select a region based on a point and radius. If the Units parameter is set to Metric, the radius is measured in kilometers; if Units is set to US (the default), the radius is measured in miles. The maximum radius you can specify is 100 miles (160 kilometers). If used, other Location parameters cannot be used. Either quadkey, box, point and radius, geoId or ids 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. Using Geographies with a large area (e.g. countries) is not recommended. Either quadkey, box, point and radius, geoId or ids parameters are required.
ids Query String Used to select segments based on ID. “ids” is a comma-separated list of segment IDs. The maximum number of IDs you can list in a single request is 1000. If used, other Location parameters cannot be used. Either quadkey, box, point and radius, geoId or ids parameters are required.
units Query Integer Use 0 for English units, 1 for metric. The default is 0.
SpeedOutputFields Query String The traffic speed fields to be returned in the response. This parameter can specify a single field, or multiple fields in a comma-separated list such as “Reference,Speed”. If this parameter is not specified, the default is Speed and Average.
Value Description
All Return all fields
Reference Reference speed field only
Speed Measured speed field only
Average Historical average speed field only
TTM Time required to travel across the segment
SpeedBucket Speed bucket or the the level of congestion
Multilane Multilane speeds for the segment such as HOV where available
SpeedFilter Query Integer This parameter specifies the only speeds that should be shown are those speeds where the change is more or less than the percentage difference specified from the average speed. For example, SpeedFilter=10 returns speeds that are 10% +/- the Average speed. A negative value has the same result as a positive value (e.g. SpeedFilter=-10 is the same as SpeedFilter=10). If this parameter is not specified, no filter is applied.
StartTime Query Datetime The expected traffic at this time. The default is the current time. All times should be in UTC or have the timezone offset as specified in DateTime Values.
Duration Query String The duration, in minutes, for which to return traffic data in the specified intervals. Duration should be specified as a multiple of 5. For example, a Duration parameter of 120 and an Interval parameter of 30 will return results for the current time, as well as forecasts on the hour and half-hour, for up to 120 minutes from the current time. The default value is 0, which means real-time traffic data only.
Interval Query Integer The period of time in minutes between reports when the duration parameter is non-zero. The first set of data in the response will have the real-time timestamp. The timestamp for subsequent sets will have a minute value that is a multiple of the interval value. For example, an interval value of 30 specifies data sets on the hour and 30 minutes past the hour. The interval parameter is used in conjunction with the duration parameter.
Value Description
15 (default) Return data for 15 minute periods
30 Return data for 30 minute periods
60 Return data for 60 minute periods
FRCLevel Query String The Functional Road Classification code of the Segments to report. Multiple codes can be specified in a comma-delimited list.
Value Description
All (default) Report all road types.
1 First class roads, such as national highway network roads.
2 Second class roads, such as state highway network roads.
3 Third class roads, such as state interconnecting network roads.
4 Fourth class roads, such as major connecting roads.
5 Fifth class roads, such as minor roads connecting suburbs and destination and destination collector roads.
Resolution Query Integer If resolution is specified, the speed of sub-segment is returned. The sub-segment is specified in terms of offsets. The length of the sub-segment will be based on the resolution specified. The default is 0, which means "full resolution" or one section per segment. Sub-segments are only returned if the sub-segment speed is more than 5 mph different from the speed on the overall segment.
Coverage Query Integer Indicates the type of coverage to return - core or extended. The default is specified per vendor.
Value Description
1 Real-time core coverage, i.e., roads segments that will always have coverage.
4 Real-time extended coverage, i.e., road segments, other than core, where we have real-time coverage at the given point in time.
8 Real-time core + extended coverage.
32 Reference.
48 Historical.
255 Return all types of coverage.
SpeedBucketID Query Integer A speed bucket is a range of speeds or percentages that is used to categorize Segment data. All speed buckets are identified by a unique number called a speedbucketID. Default is to use the INRIX default speed bucket ID (id=1) which is described in the CreateSpeedBucket api . Custom speed buckets can be defined by using the CreateSpeedBucket API.
SpeedBucketOutputFilter Query String A comma-delimited list of bytes specifying which speed bucket numbers to be included in the response. Multiple speed buckets can be specified. The number of speed buckets available to be filtered is dependent on the number of speed buckets returned from calls to CreateSpeedBucket. A value of 255 returns only closures.
Value Description
(empty)(default) Return all speed buckets.
0 Return only speed bucket 0.
1 Return only speed bucket 1.
2 Return only speed bucket 2.
(n) Return only speed bucket (n).
255 Report only closed segments or subsegments.
RoadSegmentType Query String This indicates the type of Segment to return. If RoadSegmentType is not specified, INRIX XD Segments (XDS) are returned. Multiple RoadSegmentTypes can be specified in a call as a comma separated ordered list and the ordering matters. For instance, if “TMC,XDS” is specified, TMCs will be returned for all TMC-defined road segments, and INRIX XD Segments will be returned for additional road segments not defined by the TMC Table and where traffic coverage is available. If “XDS,TMC” is specified then XD Segments will be returned where available, else TMC segments would be returned. However as XD segments in general cover all TMC locations this call would return only XD Segments.
Value Description
XDS (default) INRIX XD Segments
TMC INRIX Default TMC Tables
Accept Header String Format for the response. Accepts either text/json or text/xml. Default is json.

Requests

Example Get segment speeds request
Query
https://segment-api.inrix.com/v1/segments/speed?box=47.77577|-122.207249,47.743362|-122.16227&accesstoken={token}

Responses

200 Success
{ 
 "copyright": "Copyright INRIX Inc. 2019", 
 "versionNumber": "v1", 
 "createdDate": "2019-05-12T00:52:43Z", 
 "responseId": "dc0963eb-ba0a-4e2b-9b14-871adf197a7e", 
 "result": {
     "segments": [
                {
                    "subSegments": [
                        {
                            "speed": 42,
                            "offset": "408,612"
                        }
                    ],
                    "code": "114-04231",
                    "type": "TMC",
                    "speed": 29,
                    "average": 53,
                    "reference": 55,
                    "travelTimeMinutes": 1.265,
                    "speedBucket": 0,
                    "lanes": [ 
                        {"lane" [
                            { 
                            "speed":51, 
                            "type":"hov"  
                            } 
                        ] 
                        } 
                    ] 
                    },
                    {
                    "code": "1237042571",
                    "type": "XDS",
                    "speed": 66,
                    "average": 69,
                    "reference": 79,
                    "travelTimeMinutes": 0.276,
                    "speedBucket": 2
                    },
                    {
                    "subSegments": [
                        {
                            "speed": 59,
                            "offset": "236,472"
                        }
                    ],
                    "code": "114P14469",
                    "type": "TMC",
                    "speed": 26,
                    "average": 27,
                    "reference": 76,
                    "travelTimeMinutes": 1.088,
                    "speedBucket": 1
                    }
                    ],
                    "timestamp": "2019-05-12T00:52:43Z"
                }
} 

Response Elements

Property Type Description
segments Array The speed on a segment.
Property Type Description
code String Unique identifier for the segment. The value would be the TMC code or the INRIX XD Segment ID. Required
type String Indicates type of segment. Possible values are “TMC” and “XDS”. XDS refers to a segment type of INRIX XD segment. Required
speed Integer Current speed on the segment
average Integer The typical speed on the segment for the given day and time
reference Integer The free flow speed on the segment for the given day and time
travelTimeMinutes Integer Travel time along the segment at current speed in minutes
speedBucket Integer Level of congestion
segmentClosed Boolean Indicates whether the segment is closed or not. Speed data is not returned for a closed segment
lanes Array The speed on any specific lanes for the segment
Property Type Description
type String The type of lane such as Hov or exit.
speed Integer The speed on that specific lane
subSegmentegments Array The speed on a sub-segment. Sub-segments are only returned if the sub-segment speed is more than 5 mph different from the speed on the overall segment.
Property Type Description
offset String The start and end offsets of the sub-segment on the parent segment in meters
speed String Current speed on the sub-segment