Geocoding
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).
- 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.
Every request have to be signed by an API key. For a detailed explanation click here.
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
https://maptoolkit.p.rapidapi.com/geocode/search?<params>
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 generates an address from a latitude and longitude. The optional zoom parameter specifies the level of detail required.
https://maptoolkit.p.rapidapi.com/geocode/reverse?<query>
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) |
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"
}
}