Traffic API

GET
Flow Image

The Flow Request returns an image of the current traffic for a particular area.

Resource URL

https://www.mapquestapi.com/traffic/v2/flow

Resource Information

Response Formats GIF, PNG
Authentication Yes (Requires Key)
Rate Limited Yes

Request Parameters

  • key required

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

  • mapState required

    A valid map state for this image.

    This parameter must contain the following information:

    • width - width of the image in pixels
    • height - height of the image in pixels
    • center - lat/lng object of the map center
    • scale - map scale

    The scale must be one of the following values:

    Zoom Scale
    10 433343
    11 216671
    12 108335
    13 54167
    14 27083
    15 13541
    16 6770
    17 3385
    18 1692

    Supply the following query parameters to describe the mapState:

    • mapWidth - width of the image (in pixels)
    • mapHeight - height of the image (in pixels)
    • mapLat - latitude of the map center (in degrees), must be between -90 and 90
    • mapLng - longitude of the map center (in degrees), must be between -180 and 180
    • mapScale - map scale (in points (1/72 of an inch) per pixel), must be one of the following values
    Note: the combination of mapHeight, mapWidth and mapScale parameters must cover an area no more than 1 degree in either direction. An error message will inform you if this is exceeded.
  • imageType optional, defaults to gif

    The format of the image. Can be gif or png.

Example Request

GET

https://www.mapquestapi.com/traffic/v2/flow?key=KEY&mapLat=38.890763&mapLng=-77.084755&mapHeight=400&mapWidth=400&mapScale=108335

Example Response (Flow Image)

The following sample returns a 400x400 pixel image centered on Arlington, VA, with a scale of 108335 (zoom level of 12)