Traffic API
GET Traffic Markets
The Traffic Markets Request returns a structured list of regions, or "markets", for which MapQuest provides Traffic data. The list is available in JSON or XML formats.
Resource URL
Resource Information
Response Formats | JSON, XML |
Authentication | Yes (Requires Key) |
Rate Limited | Yes |
Request Parameters
Request Parameter | Description | Required |
---|---|---|
key | The API Key, which is needed to make requests to MapQuest services. | yes |
outFormat | Specifies the format of the response. Must be one of the following, if supplied:
outFormat=xml | no, defaults to json |
callback | 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 | no |
Example Request
Example Response
JSON
{
"markets": [
{
"boundingBox": {
"ul": {
"lng": -82.110762,
"lat": 41.359286
},
"lr": {
"lng": -80.926346,
"lat": 40.803517
}
},
"mqURL": "https://www.mapquest.com/maps?traffic=1&city=Akron&state=OH",
"zoom": 7,
"state": "OH",
"lng": -81.519202,
"lat": 41.081401,
"iconURL": "https://api.mqcdn.com/mqtraffic/stoplight.png",
"city": "Akron / Canton"
}
],
"info": {
"copyright": {
"text": "© 2023 MapQuest, Inc.",
"imageUrl": "https://api.mqcdn.com/res/mqlogo.gif",
"imageAltText": "© 2023 MapQuest, Inc."
},
"statuscode": 0,
"messages": []
}
}
XML
<MarketsResponse>
<markets>
<market>
<city>Akron / Canton</city>
<state>OH</state>
<lng>-81.519202</lng>
<lat>41.081401</lat>
<iconURL>https://api.mqcdn.com/mqtraffic/stoplight.png</iconURL>
<zoom>7</zoom>
<mqURL>
https://www.mapquest.com/maps?traffic=1&city=Akron&state=OH
</mqURL>
<boundingBox>
<ul>
<latLng>
<lat>41.359286</lat>
<lng>-82.110762</lng>
</latLng>
</ul>
<lr>
<latLng>
<lat>40.803517</lat>
<lng>-80.926346</lng>
</latLng>
</lr>
</boundingBox>
</market>
</markets>
<info>
<statusCode>0</statusCode>
<messages/>
<copyright>
<imageUrl>https://api.mqcdn.com/res/mqlogo.gif</imageUrl>
<imageAltText>© 2023 MapQuest, Inc.</imageAltText>
<text>© 2023 MapQuest, Inc.</text>
</copyright>
</info>
</MarketsResponse>0