Reverse Geocoding is a process to give the closest matching address to a provided geographical coordinates (latitude/longitude). MapmyIndia reverse geocoding API provides real addresses along with nearest popular landmark for any such geo-positions on the map.
- Basic URL structure:
- Output: The output format would be JSON.
- HTTP Request Method: GET
The following input parameters will be supported in the Reverse Geocoding API request –
- lat: the latitude of the location for which the address is required.
- lng: the longitude of the location for which address is required.
- licence_key: the REST API licence key allocated to you by signing into our services and registering yourself as a developer (28 Char Alphanumeric).
- region (string): it takes in the country code. LKA, IND, BTN, BGD, NPL for Sri-Lanka, India, Bhutan, Bangladesh, Nepal respectively. Default is India (IND)
The API returns an enveloped response of reverse geocoded data in the results object which will be a collection containing a single Item. The following output parameters will be supported in the Reverse Geocoding API response –
- responseCode (int): The response code of the operation. The 400 series is for client side (yours) error while 500 series for server side (ours) error, 200 for success.
- version (string): The version of the API you’re connected to.
- results: array of single result, consisting of the following parameters
- houseNumber (string): The house number of the location.
- houseName (string): The name of the location.
- poi (string): The name of the POI if the location is a place of interest (POI).
- poi_dist (string): distance from nearest POI in metres.
- street (string): The name of the street of the location.
- street_dist (string): distance from nearest Street in metres.
- subSubLocality (string): The name of the sub-sub-locality where the location exists.
- subLocality (string): The name of the sub-locality where the location exists.
- locality (string): The name of the locality where the location exists.
- village (string): The name of the village if the location exists in a village.
- district (string): The name of the district in which the location exists.
- subDistrict (string): The name of the sub-district in which the location exists.
- city (string): The name of the city in which the location exists.
- state (string): The name of the state in which the location exists.
- pincode (string): The pin code of the location area.
- lat (double): The latitude of the location.
- lng (double): The longitude of the location.
- formatted_address (string): The complete human readable address string that is usually the complete postal address of the result.
- area (string):in-case the co-ordinate lies in a country the name of the country would be returned or if the co-ordinate lies in an ocean, the name of the ocean will be returned.
The Geocode API must respond within 100 Ms under all circumstances on a stable internet connection although on an unstable one, response times may vary.
One request using the API link will be considered as one transaction.
- Get the address details of a latitude and longitude belonging to a location.
"district": "Madhubani District",
"formatted_address": "Sisauni, Harlakhi, Madhubani District, Bihar. 936 m from Primary Health Centre Basopatti pin-847225 (India)"