Geocoding API Documentation

Blazing fast Forward & Reverse Geocoding.

Sandbox Documentation

Start with a free developer token.

Sandbox

Geocoding API converts a street address to a location while the Reverse Geocoding API converts a location to a street address.

Geocoding

Reverse Geocoding

Geocoding API Documentation

Usage

Both Geocoding & Reverse Geocoding requests are sent to any of the following endpoints:

Geocoding

Request body
Send the following data as a GET request.
  • token - Your API token. If you don't have one, get one free here!
    token=<Your_API_Key>
  • type - For Geocoding requests, the type has to be set as geocoding.
    type=geocoding
  • q - Query string to search for.
    q=<query>
  • Alternatively can be entered as:
    street=<housenumber> <streetname>
    city=<city>
    county=<county>
    state=<state>
    country=<country>
    postalcode=<postalcode>
    Alternative query string format for structured requests. Structured requests are faster and require less server resources. DO NOT COMBINE WITH q=<query> PARAMETER.
  • format - Output format. (Optional) (Default: json).
    format=[json]
  • accept-language - Preferred language order for showing search results, overrides the value specified in the "Accept-Language" HTTP header. Either uses standard rfc2616 accept-language string or a simple comma separated list of language codes. (Optional) (Default: en).
    accept-language=<browser language string>
  • countrycodes - Limit search results to a specific country (or a list of countries). <countrycode> should be the ISO 3166-1alpha2 code, e.g. gb for the United Kingdom, de for Germany, etc., (Optional).
    countrycodes=<countrycode>[,<countrycode>][,<countrycode>]...
  • addressdetails - Include a breakdown of the address into elements (Optional).
    addressdetails=[0|1]
  • limit - Limit the number of returned results (Optional).
    limit=<integer>
  • namedetails - Include a list of alternative names in the results. These may include language variants, references, operator and brand (Optional).
    namedetails=1
  • json_callback - Wrap json output in a callback function (JSONP) i.e. <string>(<json>) (Optional).
    json_callback=<string>
This is how a typical request look like:
https://us1.unwiredlabs.com/v2/address.php?type=geocoding&token=API_KEY&format=json&q=Empire%20State%20Building

Response body

Here's a successful output in JSON format:
[
    {
        "place_id": "49220656",
        "licence": "Data © OpenStreetMap contributors, ODbL 1.0. http://www.openstreetmap.org/copyright",
        "osm_type": "node",
        "osm_id": "3674260525",
        "boundingbox": [
            "40.7487227",
            "40.7488227",
            "-73.9849836",
            "-73.9848836"
        ],
        "lat": "40.7487727",
        "lon": "-73.9849336",
        "display_name": "Empire State Building, 362, 5th Avenue, Diamond District, Manhattan, New York County, New York City, New York, 10035, United States of America",
        "class": "tourism",
        "type": "attraction",
        "importance": 0.301,
        "icon": "http://158.69.3.42/nominatim/images/mapicons/poi_point_of_interest.p.20.png"
    },
    {
        "place_id": "66859654",
        "licence": "Data © OpenStreetMap contributors, ODbL 1.0. http://www.openstreetmap.org/copyright",
        "osm_type": "way",
        "osm_id": "34633854",
        "boundingbox": [
            "40.7479226",
            "40.7489422",
            "-73.9864854",
            "-73.9848258"
        ],
        "lat": "40.7484284",
        "lon": "-73.9856545198733",
        "display_name": "Empire State Building, West 33rd Street, Koreatown, New York County, New York City, New York, 10001, United States of America",
        "class": "building",
        "type": "yes",
        "importance": 0.301
    }
]

Reverse Geocoding

Request body

  • token - Your API token. If you don't have one, get one free here!
    token=<Your_API_Key>
  • type - For Reverse Geocoding requests, the type has to be set as reverse.
    type=reverse
  • osm_type
    osm_id
    A specific osm node / way / relation to return an address for. Please use this in preference to lat / lon where possible.
    osm_type=[N|W|R]
    osm_id=<value>
  • lat
    lon
    The location to generate an address for.
    lat=<value>
    lon=<value>
  • zoom - Level of detail required where 0 is country and 18 is house/building.
    zoom=[0-18]
  • format - Output format. (Optional) (Default: json).
    format=[json]
  • accept-language - Preferred language order for showing search results, overrides the value specified in the "Accept-Language" HTTP header. Either uses standard rfc2616 accept-language string or a simple comma separated list of language codes. (Optional) (Default: en).
    accept-language=<browser language string>
  • addressdetails - Include a breakdown of the address into elements (Optional).
    addressdetails=[0|1]
  • extratags - Include additional information in the result if available, e.g. wikipedia link, opening hours (Optional).
    extratags=1
  • namedetails - Include a list of alternative names in the results. These may include language variants, references, operator and brand (Optional).
    namedetails=1
  • json_callback - Wrap json output in a callback function (JSONP) i.e. <string>(<json>) (Optional).
    json_callback=<string>
This is how a typical request look like:
https://us1.unwiredlabs.com/v2/address.php?type=reverse&token=API_KEY&format=json&lat=17.426585&lon=78.445360&zoom=16

Response body

Here's a successful output in JSON format:
{
    "place_id": "18528686",
    "licence": "Data © OpenStreetMap contributors, ODbL 1.0. http://www.openstreetmap.org/copyright",
    "osm_type": "node",
    "osm_id": "1883412881",
    "lat": "17.4272928",
    "lon": "78.4450291",
    "display_name": "Nagarjuna Circle Bus Stop, Road No. 3, Nagarjuna Hills, Panjagutta, Hyderabad, Medak, Telangana, 500073, India",
    "address": {
        "bus_stop": "Nagarjuna Circle Bus Stop",
        "road": "Road No. 3",
        "neighbourhood": "Nagarjuna Hills",
        "suburb": "Panjagutta",
        "city": "Hyderabad",
        "county": "Medak",
        "state": "Telangana",
        "postcode": "500073",
        "country": "India",
        "country_code": "in"
    }
}