Traffic - Get Traffic Incident Detail

Use to get information on traffic incidents inside a given bounding box.

The Traffic Incident Detail API is an HTTP GET request that provides information on traffic incidents inside a given bounding box, based on the current Traffic Model ID. The Traffic Model ID is available to grant synchronization of data between calls and API's. The Traffic Model ID is a key value for determining the currency of traffic incidents. It is updated every minute, and is valid for two minutes before it times out. It is used in rendering incident tiles. It can be obtained from the Viewport API.

GET https://atlas.microsoft.com/traffic/incident/detail/{format}?api-version=1.0&style={style}&boundingbox={boundingbox}&boundingZoom={boundingZoom}&trafficmodelid={trafficmodelid}
GET https://atlas.microsoft.com/traffic/incident/detail/{format}?api-version=1.0&style={style}&boundingbox={boundingbox}&boundingZoom={boundingZoom}&trafficmodelid={trafficmodelid}&language={language}&projection={projection}&geometries={geometries}&expandCluster={expandCluster}&originalPosition={originalPosition}

URI Parameters

Name In Required Type Description
format
path True

ResponseFormat

Desired format of the response. Value can be either json or xml.

api-version
query True

string

Version number of Azure Maps API.

boundingbox
query True

number[]

The boundingbox is represented by two value pairs describing it's corners (first pair for lower left corner and second for upper right). The pairs can either be specified using any of the projection's specified below (e.g., minY,minX,maxY,maxX) or by two latitude-longitude pairs (e.g., minLat,minLon,maxLat,maxLon).

NOTE: If latitude/longitude pairs are used, then the projection parameter must be set to "EPSG4326".

boundingZoom
query True

integer

int32

Zoom level for desired tile. 0 to 22 for raster tiles, 0 through 22 for vector tiles

style
query True

IncidentDetailStyle

The style that will be used to render the tile in Traffic Incident Tile API. This will have an effect on the coordinates of traffic incidents in the reply.

trafficmodelid
query True

string

Number referencing traffic model. This can be obtained from the Viewport API. It is updated every minute, and is valid for two minutes before it times out. If the wrong Traffic Model ID is specified, the correct one will be returned by the interface. A value of -1 will always invoke the most recent traffic model

expandCluster
query

boolean

Boolean to indicate whether to list all traffic incidents in a cluster separately

geometries
query

IncidentGeometryType

The type of vector geometry added to incidents (returned in the element of the response).

language
query

string

ISO 639-1 code for the output language. Supported languages are ar, ca, cs, da, de, el, en, en-GB, en-US, es, et, fi, fr, he, hu, id, in*, it, lt, lv, nb, nl, no, pl, pt, ro, ru, sk, sv, th, tr, zh.

Please refer to Supported Languages for details. When invalid language code is provided response is returned in English. When incident cause or description does not have translation, English description is returned.

originalPosition
query

boolean

Boolean on whether to return the original position of the incident () as well as the one shifted to the beginning of the traffic tube ()

projection
query

ProjectionStandard

The projection used to specify the coordinates in the request and response. EPSG900913 (default) or EPSG4326

Request Header

Name Required Type Description
x-ms-client-id

string

Specifies which account is intended for usage in conjunction with the Microsoft Entra ID security model. It represents a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To use Microsoft Entra ID security in Azure Maps see the following articles for guidance.

Responses

Name Type Description
200 OK

TrafficIncidentDetail

OK

Other Status Codes

ErrorResponse

An unexpected error occurred.

Security

AADToken

These are the Microsoft Entra OAuth 2.0 Flows. When paired with Azure role-based access control it can be used to control access to Azure Maps REST APIs. Azure role-based access controls are used to designate access to one or more Azure Maps resource account or sub-resources. Any user, group, or service principal can be granted access via a built-in role or a custom role composed of one or more permissions to Azure Maps REST APIs.

To implement scenarios, we recommend viewing authentication concepts. In summary, this security definition provides a solution for modeling application(s) via objects capable of access control on specific APIs and scopes.

Notes

  • This security definition requires the use of the x-ms-client-id header to indicate which Azure Maps resource the application is requesting access to. This can be acquired from the Maps management API.

The Authorization URL is specific to the Azure public cloud instance. Sovereign clouds have unique Authorization URLs and Microsoft Entra ID configurations. * The Azure role-based access control is configured from the Azure management plane via Azure portal, PowerShell, CLI, Azure SDKs, or REST APIs. * Usage of the Azure Maps Web SDK allows for configuration based setup of an application for multiple use cases.

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

Name Description
https://atlas.microsoft.com/.default https://atlas.microsoft.com/.default

subscription-key

This is a shared key that is provisioned when you Create an Azure Maps account in the Azure portal or using PowerShell, CLI, Azure SDKs, or REST API.

With this key, any application can access all REST API. In other words, this key can be used as a master key in the account that they are issued in.

For publicly exposed applications, our recommendation is to use the confidential client applications approach to access Azure Maps REST APIs so your key can be securely stored.

Type: apiKey
In: query

SAS Token

This is a shared access signature token is created from the List SAS operation on the Azure Maps resource through the Azure management plane via Azure portal, PowerShell, CLI, Azure SDKs, or REST APIs.

With this token, any application is authorized to access with Azure role-based access controls and fine-grain control to the expiration, rate, and region(s) of use for the particular token. In other words, the SAS Token can be used to allow applications to control access in a more secured way than the shared key.

For publicly exposed applications, our recommendation is to configure a specific list of allowed origins on the Map account resource to limit rendering abuse and regularly renew the SAS Token.

Type: apiKey
In: header

Examples

Request information about a traffic incident

Sample request

GET https://atlas.microsoft.com/traffic/incident/detail/json?api-version=1.0&style=s3&boundingbox=6841263.950712,511972.674418,6886056.049288,582676.925582&boundingZoom=11&trafficmodelid=1335294634919

Sample response

{
  "tm": {
    "@id": "1521671948910",
    "poi": [
      {
        "id": "europe_HD_NL_TTR116377227776064",
        "p": {
          "x": 538636.9,
          "y": 6842004.5
        },
        "ic": 9,
        "ty": 1,
        "cs": 0,
        "d": "roadworks",
        "c": "new roadworks layout",
        "f": "Amstelveen/Vinkeveen - N201 (N196)",
        "t": "Uithoorn-Centrum (N196)",
        "l": 220,
        "dl": 14,
        "r": "N196"
      },
      {
        "id": "europe_CLUSTER_11_-34959639",
        "p": {
          "x": 528668.6,
          "y": 6848897.9
        },
        "ic": 8,
        "ty": 0,
        "cbl": {
          "x": 528622.5,
          "y": 6848661.2
        },
        "ctr": {
          "x": 528714.7,
          "y": 6849134.6
        },
        "cs": 2,
        "l": 190
      },
      {
        "id": "europe_CLUSTER_11_-1540737434",
        "p": {
          "x": 518277,
          "y": 6852206.8
        },
        "ic": 9,
        "ty": 1,
        "cbl": {
          "x": 517421.3,
          "y": 6851776.4
        },
        "ctr": {
          "x": 519132.8,
          "y": 6852637.2
        },
        "cs": 2,
        "l": 1620
      },
      {
        "id": "europe_CLUSTER_11_-26712906",
        "p": {
          "x": 529902.2,
          "y": 6855622.4
        },
        "ic": 8,
        "ty": 0,
        "cbl": {
          "x": 529524.6,
          "y": 6855377.2
        },
        "ctr": {
          "x": 530279.9,
          "y": 6855867.7
        },
        "cs": 4,
        "l": 660
      },
      {
        "id": "europe_HD_NL_TTR116367997504816",
        "p": {
          "x": 568216,
          "y": 6851287.6
        },
        "ic": 9,
        "ty": 1,
        "cs": 0,
        "d": "roadworks",
        "c": "new roadworks layout",
        "f": "Ankeveen (N236)",
        "t": "Weesp (N236)",
        "l": 2760,
        "dl": 73,
        "r": "N236"
      },
      {
        "id": "europe_HD_NL_TTR116367997261488",
        "p": {
          "x": 561973.7,
          "y": 6854259.4
        },
        "ic": 9,
        "ty": 3,
        "cs": 0,
        "d": "roadworks",
        "c": "new roadworks layout",
        "f": "Weesp (N236)",
        "t": "Ankeveen (N236)",
        "l": 2650,
        "r": "N236"
      },
      {
        "id": "europe_HD_NL_TTR116331064819392",
        "p": {
          "x": 571268.5,
          "y": 6858435.4
        },
        "ic": 8,
        "ty": 4,
        "cs": 0,
        "d": "closed",
        "f": "IJsselmeerweg",
        "t": "A6",
        "l": 370
      },
      {
        "id": "europe_CLUSTER_11_-1442937814",
        "p": {
          "x": 563934,
          "y": 6859271.3
        },
        "ic": 9,
        "ty": 1,
        "cbl": {
          "x": 563726.1,
          "y": 6859250.4
        },
        "ctr": {
          "x": 564141.9,
          "y": 6859292.2
        },
        "cs": 2,
        "l": 460
      },
      {
        "id": "europe_CLUSTER_11_258400781",
        "p": {
          "x": 558055.6,
          "y": 6861147.1
        },
        "ic": 13,
        "ty": 1,
        "cbl": {
          "x": 557493.3,
          "y": 6860514.8
        },
        "ctr": {
          "x": 558618,
          "y": 6861779.4
        },
        "cs": 3,
        "l": 1030
      },
      {
        "id": "europe_HD_NL_TTR116100227865681",
        "p": {
          "x": 542665,
          "y": 6861959.7
        },
        "ic": 8,
        "ty": 4,
        "cs": 0,
        "d": "closed",
        "f": "Strawinskylaan",
        "t": "Matthijs Vermeulenpad",
        "l": 110
      },
      {
        "id": "europe_CLUSTER_11_1438243625",
        "p": {
          "x": 545058.7,
          "y": 6864571.6
        },
        "ic": 8,
        "ty": 0,
        "cbl": {
          "x": 543779.5,
          "y": 6864070.7
        },
        "ctr": {
          "x": 546337.8,
          "y": 6865072.6
        },
        "cs": 5,
        "l": 1590
      },
      {
        "id": "europe_HD_NL_TTR116081762316976",
        "p": {
          "x": 547507.8,
          "y": 6866259.3
        },
        "ic": 8,
        "ty": 4,
        "cs": 0,
        "d": "closed",
        "f": "Alexanderplein (s113)",
        "t": "Stadhouderskade",
        "l": 390,
        "r": "S100"
      },
      {
        "id": "europe_CLUSTER_11_691732516",
        "p": {
          "x": 541448.7,
          "y": 6867162.1
        },
        "ic": 8,
        "ty": 0,
        "cbl": {
          "x": 541160.1,
          "y": 6866710.7
        },
        "ctr": {
          "x": 541737.2,
          "y": 6867613.5
        },
        "cs": 4,
        "l": 430
      },
      {
        "id": "europe_CLUSTER_11_1582351486",
        "p": {
          "x": 534709.6,
          "y": 6865174.7
        },
        "ic": 8,
        "ty": 0,
        "cbl": {
          "x": 534562.2,
          "y": 6865025.3
        },
        "ctr": {
          "x": 534856.9,
          "y": 6865324.2
        },
        "cs": 2,
        "l": 380
      },
      {
        "id": "europe_CLUSTER_11_-2070222267",
        "p": {
          "x": 536813.1,
          "y": 6868188.3
        },
        "ic": 8,
        "ty": 0,
        "cbl": {
          "x": 536191.1,
          "y": 6867699.7
        },
        "ctr": {
          "x": 537435.1,
          "y": 6868677
        },
        "cs": 7,
        "l": 1380
      },
      {
        "id": "europe_CLUSTER_11_-496866890",
        "p": {
          "x": 516025.5,
          "y": 6871606.3
        },
        "ic": 8,
        "ty": 0,
        "cbl": {
          "x": 514115.1,
          "y": 6870216.9
        },
        "ctr": {
          "x": 517935.9,
          "y": 6872995.7
        },
        "cs": 7,
        "l": 1510
      },
      {
        "id": "europe_HD_NL_TTR115675492352160",
        "p": {
          "x": 517835.3,
          "y": 6883216.3
        },
        "ic": 8,
        "ty": 4,
        "cs": 0,
        "d": "closed",
        "f": "Amsterdamseweg",
        "t": "A22",
        "l": 710
      },
      {
        "id": "europe_CLUSTER_11_834920993",
        "p": {
          "x": 543803.8,
          "y": 6875659.8
        },
        "ic": 8,
        "ty": 0,
        "cbl": {
          "x": 543474.7,
          "y": 6875602.7
        },
        "ctr": {
          "x": 544133,
          "y": 6875716.9
        },
        "cs": 2,
        "l": 760
      }
    ]
  }
}

Definitions

Name Description
DelayMagnitude

The magnitude of delay associated with incident. These values correspond to incident colors in the traffic tiles

ErrorAdditionalInfo

The resource management error additional info.

ErrorDetail

The error detail.

ErrorResponse

Error response

IconCategory

The icon category associated with this incident. Values are numbers in the range 0-13, with the following meanings -- 0: Unknown, 1: Accident, 2: Fog, 3: Dangerous Conditions, 4: Rain, 5: Ice, 6: Jam, 7: Lane Closed, 8: Road Closed, 9: Road Works, 10: Wind, 11: Flooding, 12: Detour, 13: Cluster

IncidentDetailStyle

The style that will be used to render the tile in Traffic Incident Tile API. This will have an effect on the coordinates of traffic incidents in the reply.

IncidentGeometryType

The type of vector geometry added to incidents (returned in the element of the response).

Point

Generic representation of a point with coordinates (x, y) in the Cartesian plane.

ProjectionStandard

The projection used to specify the coordinates in the request and response. EPSG900913 (default) or EPSG4326

ResponseFormat

Desired format of the response. Value can be either json or xml.

Tm

Main response element

TrafficIncidentDetail

This object is returned from a successful Traffic incident Detail call

TrafficIncidentPointOfInterest

DelayMagnitude

The magnitude of delay associated with incident. These values correspond to incident colors in the traffic tiles

Name Type Description
0

Integer

Unknown

1

Integer

Minor

2

Integer

Moderate

3

Integer

Major

4

Integer

Indefinite (used for road closures and other indefinite delays)

ErrorAdditionalInfo

The resource management error additional info.

Name Type Description
info

object

The additional info.

type

string

The additional info type.

ErrorDetail

The error detail.

Name Type Description
additionalInfo

ErrorAdditionalInfo[]

The error additional info.

code

string

The error code.

details

ErrorDetail[]

The error details.

message

string

The error message.

target

string

The error target.

ErrorResponse

Error response

Name Type Description
error

ErrorDetail

The error object.

IconCategory

The icon category associated with this incident. Values are numbers in the range 0-13, with the following meanings -- 0: Unknown, 1: Accident, 2: Fog, 3: Dangerous Conditions, 4: Rain, 5: Ice, 6: Jam, 7: Lane Closed, 8: Road Closed, 9: Road Works, 10: Wind, 11: Flooding, 12: Detour, 13: Cluster

Name Type Description
0

Integer

Unknown

1

Integer

Accident

10

Integer

Wind

11

Integer

Flooding

12

Integer

Detour

13

Integer

Cluster: Returned if a cluster contains incidents with different icon categories.

14

Integer

Broken Down Vehicle

2

Integer

Fog

3

Integer

Dangerous Conditions

4

Integer

Rain

5

Integer

Ice

6

Integer

Jam

7

Integer

Lane Closed

8

Integer

Road Closed

9

Integer

Road Works

IncidentDetailStyle

The style that will be used to render the tile in Traffic Incident Tile API. This will have an effect on the coordinates of traffic incidents in the reply.

Name Type Description
night

string

Night style.

s1

string

Creates traffic lines with colored chevrons indicating severity.

s2

string

Creates plain lines with certain degree of glow.

s3

string

Creates plain lines with certain degree of glow, different than the s2 style.

IncidentGeometryType

The type of vector geometry added to incidents (returned in the element of the response).

Name Type Description
original

string

Places incidents precisely on the road.

shifted

string

Moves the incident slightly (depending on zoom level) to indicate specific road lanes.

Point

Generic representation of a point with coordinates (x, y) in the Cartesian plane.

Name Type Description
x

number

x coordinate

y

number

y coordinate

ProjectionStandard

The projection used to specify the coordinates in the request and response. EPSG900913 (default) or EPSG4326

Name Type Description
EPSG4326

string

EPSG4326

EPSG900913

string

EPSG900913

ResponseFormat

Desired format of the response. Value can be either json or xml.

Name Type Description
json

string

The JavaScript Object Notation Data Interchange Format

xml

string

The Extensible Markup Language

Tm

Main response element

Name Type Description
@id

string

ID of the traffic model for this incident

poi

TrafficIncidentPointOfInterest[]

A single traffic incident, or a cluster of traffic incidents

TrafficIncidentDetail

This object is returned from a successful Traffic incident Detail call

Name Type Description
tm

Tm

Main response element

TrafficIncidentPointOfInterest

Name Type Description
c

string

Cause of the incident, where available, in the language requested

cbl

Point

Bottom left coordinate of the cluster in the projection of the request

cs

integer

Cluster size: the number of incidents in the cluster

ctr

Point

Top right coordinate of the cluster in the projection of the request

d

string

Description of the incident in the language requested

dl

integer

Delay caused by the incident in seconds (except in road closures)

ed

string

Estimated end date of the incident, if available. The date is described in the ISO8601 format.

f

string

From: the name of the intersection or location where the traffic due to the incident starts

ic

IconCategory

The icon category associated with this incident. Values are numbers in the range 0-13, with the following meanings -- 0: Unknown, 1: Accident, 2: Fog, 3: Dangerous Conditions, 4: Rain, 5: Ice, 6: Jam, 7: Lane Closed, 8: Road Closed, 9: Road Works, 10: Wind, 11: Flooding, 12: Detour, 13: Cluster

id

string

ID of the traffic incident

l

integer

Length of the incident in meters

p

Point

The point where an icon of the cluster or raw incident should be drawn, expressed in the requested projection. This is affected by traffic style, zoom level and road type

r

string

The road number(s) affected by the incident. Multiple road numbers will delimited by slashes

sd

string

Start date of the incident, if available. The date is described in the ISO8601 format.

t

string

To: the name of the intersection or location where the traffic due to the incident ends

ty

DelayMagnitude

The magnitude of delay associated with incident. These values correspond to incident colors in the traffic tiles