Directions API

GET
Find Link Id

Resource URL

http://www.mapquestapi.com/directions/v2/findlinkid

Resource Information

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

Request Parameters

Request Parameter Description Required?
key
String
The API Key, which is needed to make requests to MapQuest services. Yes
lat The latitude of the point to find a Link Id. Yes
lng The longitude of the point to find a Link Id. Yes
outFormat Specifies the format of the response. Must be one of the following, if supplied:
  • json
  • xml
Default: json
No
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. No

Response

Response Field Description
linkId The Link Id of a road, which can later be supplied with the mustAvoidLinkIds or the tryAvoidLinkIds route option attributes.
street The street name of the road Link Id found.
info This field contains information about the response.

The statuscode subfield is an integer return value. See the Status Codes page for more details on our status codes and error messages.

The messages subfield is an array of error messages which describe the status.

Example Request

GET

http://www.mapquestapi.com/directions/v2/findlinkid?key=KEY&lat=40.0755&lng=-76.329999

Example Response

{
  "linkId": 37214459,
  "street": "Granite Run Dr",
  "info": {
    "copyright": {
      "text": "© 2017 MapQuest, Inc.",
      "imageUrl": "http://api.mqcdn.com/res/mqlogo.gif",
      "imageAltText": "© 2017 MapQuest, Inc."
    },
    "statuscode": 0,
    "messages": []
  }
}
<?xml version="1.0" encoding="UTF-8"?>
<response>
    <linkId>37214459</linkId>
    <street>Granite Run Dr</street>
    <info>
        <statusCode>0</statusCode>
        <messages/>
        <copyright>
            <imageUrl>http://api.mqcdn.com/res/mqlogo.gif</imageUrl>
            <imageAltText>© 2017 MapQuest, Inc.</imageAltText>
            <text>© 2017 MapQuest, Inc.</text>
        </copyright>
    </info>
</response>