Geocoding


Please be advised that the following documentation pertains only to our self-service plans, namely Basic, Pro, and Ultra, which are accessible via RapidAPI. If you are an Enterprise customer, we offer dedicated documentation with extended code examples, which can be found in our developer backend.

Geocoding API

The Maptoolkit geocoding API was build to enable fast and powerful forward and reverse geocoding. The geocoder includes data from OSM and other sources in some regions (e.g. touristic regions).

Features

  • Forward geoding (coordinates for an search term)
  • Reverse geocoding (place for a coordinate)
  • Limit search to one or more countries (using country codes)
  • Limit search to an area (define a bounding box)
  • Language setting for the results
  • Polylines for the results

The following API documentation shows detailed usage information, available endpoints, parameters and how the response will look like.

Authentication

Every request have to be signed by an API key. For a detailed explanation click here.

Example

Search Addresses (forward geocoding)

Search terms are processed first left to right and then right to left if that fails. Both searches will work: pilkington avenue, birmingham birmingham, pilkington avenue (Commas are optional, but improve performance by reducing the complexity of the search.)

Where house numbers have been defined for an area they should be used: 135 pilkington avenue, birmingham

URL

https://maptoolkit.p.rapidapi.com/geocode/search?<params>

Parameters

Name Value Description
callback String Wrap json output in a callback function (JSONP)
q String Query string to search for (required).
countrycodes String[,String,...] Limit search results to a specific country (or a comma separated list of countries). should be the ISO 3166-1alpha2 codes, e.g. gb for the United Kingdom, de for Germany, etc.
viewbox minLng,minLat,maxLng,maxLat The preferred area to find search results. Any two corner points of the box are accepted in any order as long as they span a real box.
language String Language for showing search results (default: de).
polygon Number Output polygon outlines for items found (default: 0).
limit Number Limit the number of returned results (default: 10).

Reverse Geocoding

Reverse geocoding generates an address from a latitude and longitude. The optional zoom parameter specifies the level of detail required.

URL

https://maptoolkit.p.rapidapi.com/geocode/reverse?<query>

Parameters

Name Value Description
callback String Wrap json output in a callback function (JSONP)
language String Language for showing search results (default: de)
lat Number The location latitude to generate an address for (required).
lon Number The location longitude to generate an address for (required).
polygon Number Output polygon outlines for items found (default: 0)

Example

https://maptoolkit.p.rapidapi.com/geocode/reverse?lat=48.200702&lon=16.3523667&rapidapi-key=your-api-key
{
  "display_name":"Kirchengasse 9, Neubau, Wien, 1070, Österreich",
  "place_id":"23708113",
  "lon":"16.3522368",
  "osm_type":"node",
  "licence":"OpenStreetMap contributors, ODbL 1.0.",
  "osm_id":"3016786133",
  "lat":"48.2006928",
  "address":{
    "city":"Wien",
    "house_number":"9",
    "country":"Österreich",
    "suburb":"Neubau",
    "state":"Wien",
    "postcode":"1070",
    "country_code":"at",
    "road":"Kirchengasse"
  }
}