The INRIX Traffic Camera Service returns data and images about cameras that automatically capture pictures of traffic on major roads. It can be used to find traffic cameras in a specified area, to retrieve information about a specified camera, and to retrieve the image last captured by a specified camera.
Usage
Typically traffic camera images are used to verify or get more detail from the road speed data. A common application scenario is to display traffic camera icons where they are located, and then to pop up a traffic camera image if a traffic camera icon is selected. For example, you might use the following flow for an application that displayed a map with traffic cameras:
Calculate the longitude and latitude that corresponds to the two corners of the display.
The following image is a screen-shot from a sample traffic application that shows where traffic cameras are located. When a traffic camera icon is selected, its latest image is displayed.
/?Action=GetTrafficCamerasInBox
GETReturns a set of unique traffic camera identifiers, within the given set of box coordinates.
Parameters
= required
Name
Located In
Type
Description
Token
Query
String
A valid authorization token returned in response to a GetSecurityToken request.
Corner1
Query
String
The first corner of the region in which to get data. This parameter must be specified as a pair of latitude and longitude values separated by a pipe character (|), in the form Corner1=”latitude|longitude”. The latitude and longitude values are expressed using the WGS 84 datum. Northern latitudes are positive and southern latitudes are negative. Eastern hemisphere longitudes are positive and western hemisphere longitudes are negative. Longitudes in North America are negative. The corner specified by the Corner1 parameter can be any of the four corners of the bounding rectangle.
Corner2
Query
String
The second corner of the region in which to get data. The Corner2 parameter is the geometric opposite of Corner1.
StreamingOnly
Query
Boolean
Specifies whether only cameras that have streaming video URLs should be returned.
Value
Description
false (default)
Cameras that provide still images only, and cameras that provide both still images and streaming video URLs are returned.
true
Only cameras that have streaming video URLs are returned.
OutputFields
Query
String
A comma-delimited list of the fields that should be returned in the response. If OutputFields is not specified, the default is “All.”
Value
Description
Point
The Point location of the camera (can be abbreviated as P).
Status
The status of the traffic camera (can be abbreviated as S).
Name
The name of the traffic camera (can be abbreviated as N).
License
The license of the traffic camera (can be abbreviated as L).
View
The description of the view of the traffic camera (can be abbreviated as V).
StreamUrl
The URL of the streaming video of the traffic camera (can be abbreviated as U).
All (default)
All fields are returned (can be abbreviated as A).
Count
Query
Integer
The maximum number of cameras returned in the response.
The possible directions that the camera could be facing.
Point
Element
Geo location of the traffic camera.
Property
Type
Description
latitude
Attribute (double)
Latitude of point
longitude
Attribute (double)
Longitude of point
Status
Element
Current operating status of the traffic camera.
Property
Type
Description
updateFreq
Attribute (integer)
How often, in milliseconds, the camera can provide new image frames.
License
Element
Licensing rights and obligations of the traffic camera.
Property
Type
Description
useWhileDrivingProhibited
Attribute (boolean)
true if it is prohibited to view camera data while driving; otherwise, false.
feeToEndUserProhibited
Attribute (boolean)
true if it is prohibited to charge a fee to the end user; otherwise, false.
sublicenseProhibited
Attribute (boolean)
true if it is prohibited to sublicense the data; otherwise, false.
regionId
Attribute (integer)
A unique region identifier that indicates to which region the camera belongs.
CopyrightNotice
Element (string)
The text of the copyright notice for the traffic camera.
StreamUrl
Element (string)
Url for streaming feed for camera if exists.
HasStream
Element (boolean)
If true, then the camera as a streaming video available.
Image
Element (image/jpg)
The binary image of the camera.
Direction
Element (string)
The current direction of the traffic camera.
ClosestLane
Element (string)
The lane closest to the traffic camera.
/?Action=GetTrafficCamerasInRadius
GETReturns a set of unique traffic camera identifiers within the given circular region.
Parameters
= required
Name
Located In
Type
Description
Token
Query
String
A valid authorization token returned in response to a GetSecurityToken request.
Center
Query
String
The center of the region in which to get data. This parameter must be specified as a pair of latitude and longitude values separated by a pipe character (|), in the form Center=”latitude|longitude”. Northern latitudes are positive and southern latitudes are negative. Eastern hemisphere longitudes are positive and western hemisphere longitudes are negative. Longitudes in North America are negative. The latitude and longitude values are expressed using the WGS 84 datum.
Radius
Query
Double
The radius of the circular bounding area from which to return data. Any features that are fully or partially enclosed within the bounding area are selected. 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.
Units
Query
Integer
Use 0 for English units, 1 for metric. The default is 0.
Value
Description
0 (default)
US (English units)
1
Metric units
StreamingOnly
Query
Boolean
Specifies whether only cameras that have streaming video URLs should be returned.
Value
Description
false (default)
Cameras that provide still images only, and cameras that provide both still images and streaming video URLs are returned.
true
Only cameras that have streaming video URLs are returned.
OutputFields
Query
String
A comma-delimited list of the fields that should be returned in the response. If OutputFields is not specified, the default is “All.”
Value
Description
Point
The Point location of the camera (can be abbreviated as P).
Status
The status of the traffic camera (can be abbreviated as S).
Name
The name of the traffic camera (can be abbreviated as N).
License
The license of the traffic camera (can be abbreviated as L).
View
The description of the view of the traffic camera (can be abbreviated as V).
StreamUrl
The URL of the streaming video of the traffic camera (can be abbreviated as U).
All (default)
All fields are returned (can be abbreviated as A).
Count
Query
Integer
The maximum number of cameras returned in the response.
The possible directions that the camera could be facing.
Point
Element
Geo location of the traffic camera.
Property
Type
Description
latitude
Attribute (double)
Latitude of point
longitude
Attribute (double)
Longitude of point
Status
Element
Current operating status of the traffic camera.
Property
Type
Description
updateFreq
Attribute (integer)
How often, in milliseconds, the camera can provide new image frames.
License
Element
Licensing rights and obligations of the traffic camera.
Property
Type
Description
useWhileDrivingProhibited
Attribute (boolean)
true if it is prohibited to view camera data while driving; otherwise, false.
feeToEndUserProhibited
Attribute (boolean)
true if it is prohibited to charge a fee to the end user; otherwise, false.
sublicenseProhibited
Attribute (boolean)
true if it is prohibited to sublicense the data; otherwise, false.
regionId
Attribute (integer)
A unique region identifier that indicates to which region the camera belongs.
CopyrightNotice
Element (string)
The text of the copyright notice for the traffic camera.
StreamUrl
Element (string)
Url for streaming feed for camera if exists.
HasStream
Element (boolean)
If true, then the camera as a streaming video available.
Image
Element (image/jpg)
The binary image of the camera.
Direction
Element (string)
The current direction of the traffic camera.
ClosestLane
Element (string)
The lane closest to the traffic camera.
/?Action=GetTrafficCamera
GETTakes a traffic camera ID and returns metadata information about that camera.
Parameters
= required
Name
Located In
Type
Description
Token
Query
String
A valid authorization token returned in response to a GetSecurityToken request.
CameraId
Query
Integer
The ID of the camera for which to return metadata.
DesiredWidth
Query
Integer
The width of the image to return.
DesiredHeight
Query
Integer
The height of the image to return.
ImageOptions
Query
Integer
A bitmask representing the field of view to be returned.
Value
Description
0 (default)
Bit 1: the entire camera field of view is returned. Otherwise, only the most relevant parts of the camera field of view are returned. The image is sub-sampled (or super-sampled) to match the desired width/height in pixels. The aspect ratio of the original image data is always preserved. When necessary, the returned image will be padded with black pixels.
Bit 2: the image dynamic range is enhanced for better viewability.
OutputFields
Query
String
A comma-delimited list of the fields that should be returned in the response. If OutputFields is not specified, the default is “All.”
Value
Description
Point
The Point location of the camera (can be abbreviated as P).
Status
The status of the traffic camera (can be abbreviated as S).
Name
The name of the traffic camera (can be abbreviated as N).
License
The license of the traffic camera (can be abbreviated as L).
View
The description of the view of the traffic camera (can be abbreviated as V).
StreamUrl
The URL of the streaming video of the traffic camera (can be abbreviated as U).
Direction
The current direction of the traffic camera (can be abbreviated as D). This can either return a specific direction like North or South or a Clockwise in the case of ring roads
Image
The image for of the traffic camera in binary format (can be abbreviated as I).
ClosestLane
The lane closest to the traffic camera (can be abbreviated as C). This can return either direction like Northbound or Anticlockwise in the case or ring roads
All (default)
All fields are returned (can be abbreviated as A).
The possible directions that the camera could be facing.
Point
Element
Geo location of the traffic camera.
Property
Type
Description
latitude
Attribute (double)
Latitude of point
longitude
Attribute (double)
Longitude of point
Status
Element
Current operating status of the traffic camera.
Property
Type
Description
updateFreq
Attribute (integer)
How often, in milliseconds, the camera can provide new image frames.
License
Element
Licensing rights and obligations of the traffic camera.
Property
Type
Description
useWhileDrivingProhibited
Attribute (boolean)
true if it is prohibited to view camera data while driving; otherwise, false.
feeToEndUserProhibited
Attribute (boolean)
true if it is prohibited to charge a fee to the end user; otherwise, false.
sublicenseProhibited
Attribute (boolean)
true if it is prohibited to sublicense the data; otherwise, false.
regionId
Attribute (integer)
A unique region identifier that indicates to which region the camera belongs.
CopyrightNotice
Element (string)
The text of the copyright notice for the traffic camera.
StreamUrl
Element (string)
Url for streaming feed for camera if exists.
HasStream
Element (boolean)
If true, then the camera as a streaming video available.
Image
Element (image/jpg)
The binary image of the camera.
Direction
Element (string)
The current direction of the traffic camera.
ClosestLane
Element (string)
The lane closest to the traffic camera.
/?Action=GetTrafficCameraImage
GETTakes a traffic camera ID and returns a binary image, in JPEG format, for that camera.
Parameters
= required
Name
Located In
Type
Description
Token
Query
String
A valid authorization token returned in response to a GetSecurityToken request.
CameraId
Query
Integer
The ID of the camera for which to return metadata.
DesiredWidth
Query
Integer
The width of the image to return.
DesiredHeight
Query
Integer
The height of the image to return.
ImageOptions
Query
Integer
A bitmask representing the field of view to be returned.
Value
Description
0 (default)
Bit 1: the entire camera field of view is returned. Otherwise, only the most relevant parts of the camera field of view are returned. The image is sub-sampled (or super-sampled) to match the desired width/height in pixels. The aspect ratio of the original image data is always preserved. When necessary, the returned image will be padded with black pixels.
Bit 2: the image dynamic range is enhanced for better viewability.