Traffic API

GET
Traffic Incidents

The Traffic Incidents request returns a structured list of traffic incidents for a specified bounding box in JSON or XML formats, e.g., road construction, traffic collisions.

Resource URL

http://www.mapquestapi.com/traffic/v2/incidents

Resource Information

Response Formats JSON, XML
Authentication Yes (Requires Key)
Rate Limited Yes

Request Parameters

  • key required

    The API Key, which is needed to make requests to MapQuest services.

  • boundingBox required

    The area in which to search for incidents.

    Example:

    boundingBox=39.95,-105.25,39.52,-104.71

  • filters optional, defaults to incidents,construction

    A list of incident types to return.

    Possible values are:

    • incidents
    • construction
    • event
    • congestion
    Example:

    filters=incidents,congestion

  • outFormat optional, defaults to json

    Specifies the format of the response. Must be one of the following, if supplied:

    • json
    • xml
    Example: XML response

    outFormat=xml

  • callback optional

    A JavaScript function name. The JSON-formatted response will be wrapped in a call to the supplied callback function name to provide JSONP functionality. This functionality might be needed to do cross-site scripting. See the Wikipedia.org entry for JSON for more details.

    Example: Callback

    callback=incidentsResult

Response Object

  • lat

    Latitude of the incident.

  • lng

    Longitude of the incident.

  • type

    Incident type. Values are:

    • 1 = Construction
    • 2 = Event
    • 3 = Congestion/Flow
    • 4 = Incident/accident
  • severity

    The incident severity. Values range from 0-4 with 4 indicating the highest severity.

  • eventCode

    The incident event code. These are standard Alert-C event codes.

    Visit ALERT-C Codes Project

  • impacting

    Indicates if the incident is impacting traffic.

  • startTime

    The start time (ISO 8601 Combined Date and Time format) of the incident.

  • endTime

    The end time (ISO 8601 Combined Date and Time format) of the incident.

  • shortDesc

    A short description of the incident.

  • fullDesc

    A full description of the incident.

  • iconURL

    URL for an icon to use for displaying the incident.

  • distance

    Optional (0 if not sent from traffic provider). The length of the road extent (in miles) affected by the incident.

  • delayFromTypical

    Optional (0 if not sent from traffic provider). The delay (minutes) from typical conditions. This is the increase in travel time across the road extent affected by the incident relative to the travel time under average conditions for the given day of the week and time.

  • delayFromFreeFlow

    Optional (0 if not sent from traffic provider). The delay (minutes) from typical conditions. This is the increase in travel time across the road extent affected by the incident relative to the travel time under free-flowing conditions.

  • tmcs

    Optional. List of Traffic Message Channel ids located at the incident.

Try It Now

Example Request

GET

http://www.mapquestapi.com/traffic/v2/incidents?key=KEY&boundingBox=39.95,-105.25,39.52,-104.71&filters=construction,incidents

Example Response

{
  "incidents": [
    {
      "fullDesc": "One lane closed due to maintenance work on California Street Eastbound between 18th Street and 19th Street.",
      "lng": -104.9886,
      "severity": 2,
      "shortDesc": "California Street E/B : Lane closed between 18th Street and 19th Street ",
      "endTime": "2013-08-02T01:59:00",
      "type": 1,
      "id": "330627538",
      "startTime": "2013-02-04T19:00:00",
      "impacting": true,
      "tmcs": [],
      "eventCode": 0,
      "iconURL": "http://api.mqcdn.com/mqtraffic/const_mod.png",
      "lat": 39.7481
    }
  ],
  "mqURL": "http://www.mapquest.com/maps?traffic=1&latitude=39.73976&longitude=-104.9848",
  "info": {
    "copyright": {
      "text": "2018 MapQuest, Inc.",
      "imageUrl": "http://api.mqcdn.com/res/mqlogo.gif",
      "imageAltText": "2018 MapQuest, Inc."
    },
    "statuscode": 0,
    "messages": []
  }
}
<IncidentsResponse>
    <Incidents>
        <Incident>
            <id>5376488</id>
            <type>4</type>
            <severity>2</severity>
            <eventCode>401</eventCode>
            <lat>39.7505</lat>
            <lng>-105.216789</lng>
            <startTime>2016-12-04T07:30:00</startTime>
            <endTime>2016-12-05T00:31:00</endTime>
            <shortDesc>
                Washington Ave: road closed from 10th St to 18th St
            </shortDesc>
            <fullDesc>
                Road closed on Washington Ave both ways from 10th St to 18th St. Golden Candle Light Walk.
            </fullDesc>
            <delayFromTypical>0.0</delayFromTypical>
            <delayFromFreeFlow>0.18000000715255737</delayFromFreeFlow>
            <distance>1.2</distance>
            <iconURL>http://api.mqcdn.com/mqtraffic/incid_mod.png</iconURL>
        </Incident>
    </Incidents>
    <info>
        <statusCode>0</statusCode>
        <messages/>
        <copyright>
            <imageUrl>http://api.mqcdn.com/res/mqlogo.gif</imageUrl>
            <imageAltText>© 2018 MapQuest, Inc.</imageAltText>
            <text>© 2018 MapQuest, Inc.</text>
        </copyright>
    </info>
</IncidentsResponse>