Open Elevation API

GET
Elevation Chart

Resource URL

http://open.mapquestapi.com/elevation/v1/chart

Resource Information

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

Parameters

Request Parameter Description Required?
key

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

Yes
latLngCollection

String/JsonArray

Collection of latitude/longitude pairs for a given route which may be in raw or compressed format. Yes
sessionId

A unique identifier used to refer to a route session. The Route Session Id can be used in place of a latLngCollection to get the lat/lng positions for an elevation chart request. The session will expire after 30 minutes. Please also see the Advanced Routing and Options Parameters

No - May be used in place of a latLngCollection
inFormat Specifies the format of the request. If this parameter is not supplied, the input format is assumed to be JSON-formatted text. The JSON-formatted input text must be supplied as either the "json" parameter of an HTTP GET, or as the BODY of an HTTP POST. If this parameter is "xml", the XML-formatted input text must be supplied as either the "xml" parameter of an HTTP GET, or as the BODY of an HTTP POST. No
shapeFormat

String

This value represents the input format for the shape points.
  • raw: shape is represented as float pairs (default).
  • cmp: shape is represented as a compressed path string with 5 digits of precision.
  • cmp6: shape is represented as a compressed path string with 6 digits of precision.

See the Compressed Lat/Lng description page for more detail, including sample source code and an interactive encoder/decoder.

No
unit

String

Specifies the type of units to use when calculating elevation profile. Acceptable values are:
  • m: Metric
  • f: Imperial

Default value is "m".

No
width Specifies the width of the elevation chart. Must be > 0 and >= 1024, if supplied. Defaults to "500" if not supplied. No
height Specifies the height of the elevation chart. Must be > 0 and >= 1024, if supplied. Defaults to "350" if not supplied. No

Example Request

GET

http://open.mapquestapi.com/elevation/v1/chart?key=KEY&shapeFormat=raw&width=425&height=350&latLngCollection=39.74012,-104.9849,39.7995,-105.7237,39.6404,-106.3736

Example Response