Directions API
GET Find Link Id
Resource URL
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 | 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 https://www.mapquestapi.com/directions/v2/findlinkid?key=KEY&lat=40.0755&lng=-76.329999
Example Response
JSON
{
"linkId": 37214459,
"street": "Granite Run Dr",
"info": {
"copyright": {
"text": "© 2024 MapQuest, Inc.",
"imageUrl": "https://api.mqcdn.com/res/mqlogo.gif",
"imageAltText": "© 2024 MapQuest, Inc."
},
"statuscode": 0,
"messages": []
}
}
XML
<?xml version="1.0" encoding="UTF-8"?>
<response>
<linkId>37214459</linkId>
<street>Granite Run Dr</street>
<info>
<statusCode>0</statusCode>
<messages/>
<copyright>
<imageUrl>https://api.mqcdn.com/res/mqlogo.gif</imageUrl>
<imageAltText>© 2024 MapQuest, Inc.</imageAltText>
<text>© 2024 MapQuest, Inc.</text>
</copyright>
</info>
</response>