Open Search (Nominatim) API

GET
Reverse

Resource URL

http://open.mapquestapi.com/nominatim/v1/reverse.php

Resource Information

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

Parameters

The following table displays common parameters that are used when requesting a Nominatim Search. Please refer to the Nominatim Wiki page for a complete list.

Name Description
key The API Key, which is needed to make requests to MapQuest services.
format Specify the output format being called. Must be one of the following, if supplied:
  • html
  • json
  • xml
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.
lat The latitude to reverse geocode
lon The longitude to reverse geocode
osm_type Specify if the feature is a Node, Way, or Relation in OpenStreetMap.
  • N - Node
  • W - Way
  • R - Relation
osm_id Specify the OpenStreetMap ID# you wish to reverse geocode.

Example Request by OSM Type/ID

When reverse geocoding by OSM Type/ID, please make sure you specify the correct osm_type - Node, Way, Relation (N, W, R).

GET

http://open.mapquestapi.com/nominatim/v1/reverse.php?key=KEY&format=json&osm_type=W&osm_id=26996903

Example Request by Latitude/Longitude

GET

http://open.mapquestapi.com/nominatim/v1/reverse.php?key=KEY&format=json&lat=51.521435&lon=-0.162714

Example Response

{
    "place_id": "57795317",
    "licence": "Data © OpenStreetMap contributors, ODbL 1.0. http://www.openstreetmap.org/copyright",
    "osm_type": "way",
    "osm_id": "26996903",
    "lat": "51.5217805",
    "lon": "-0.162823959130876",
    "display_name": "The Landmark, Melcombe Place, Marylebone, City of Westminster, London, Greater London, England, NW1 6JE, United Kingdom",
    "address": {
        "hotel": "The Landmark",
        "road": "Melcombe Place",
        "suburb": "Marylebone",
        "city": "London",
        "state_district": "Greater London",
        "state": "England",
        "postcode": "NW1 6JE",
        "country": "United Kingdom",
        "country_code": "gb"
    }
}
<reversegeocode timestamp="Thu, 27 Aug 15 20:05:52 +0000"
                attribution="Data ©OpenStreetMap contributors, ODbL 1.0. http://www.openstreetmap.org/copyright"
                querystring="%20key=KEY&amp;format=xml&amp;lat=51.521435&amp;lon=-0.162714">
    <result place_id="57795317" osm_type="way" osm_id="26996903" ref="The Landmark" lat="51.5217805" lon="-0.162823959130876">
        The Landmark, Melcombe Place, Marylebone, City of Westminster, London, Greater London,
        England, NW1 6JE, United Kingdom
    </result>
    <addressparts>
        <hotel>The Landmark</hotel>
        <road>Melcombe Place</road>
        <suburb>Marylebone</suburb>
        <city>London</city>
        <state_district>Greater London</state_district>
        <state>England</state>
        <postcode>NW1 6JE</postcode>
        <country>United Kingdom</country>
        <country_code>gb</country_code>
    </addressparts>
</reversegeocode>