Geocoding API

URL (Production)

https://atlas.mapmyindia.com/api/places/geocode?

Method

GET

Request Parameters

The parameters are colour coded based on their requirements. The “Red” ones are mandatory, and the “Black” ones are optional.

Please Note: The Restricted parameters are also optional.

a. Mandatory Parameters:

  1. address(string) address to be geocoded e.g. 237 Okhla industrial estate phase 3 new delhi, delhi 110020.

b. Optional Parameters:

  1. itemCount (integer): parameter can be set to get maximum number of result items from the API (default: 1).

Request Headers

  1. Authorization: Takes authorisation token for security check.

Security Type

This APIs follow OAuth2 based security. To know more on how to create your authorization tokens, please use our authorization token URL. More details available here

Response Type

JSON

Response Codes {as HTTP response code}

Success:

  1. 200: To denote a successful API call.
  2. 204: To denote the API was a success but no results were found.

Client-Side Issues:

  1. 400: Bad Request, User made an error while creating a valid request.
  2. 401: Unauthorized, Developer’s key is not allowed to send a request with restricted parameters.
  3. 403: Forbidden, Developer’s key has hit its daily/hourly limit.

Server-Side Issues:

  1. 500: Internal Server Error, the request caused an error in our systems.
  2. 503: Service Unavailable, during our maintenance break or server downtimes.

Response Messages (as HTTP response message)

  1. 200: Success.
  2. 204: No matches were found for the provided query.
  3. 400: Something’s just not right with the request.
  4. 401: Access Denied.
  5. 403: Services for this key has been suspended due to daily/hourly transactions limit.
  6. 500: Something went wrong.
  7. 503: Maintenance Break.

Response Parameters

  1. houseNumber(string): the houseNumber of the address/location
  2. houseName(string): houseName of the address/location
  3. poi(string): the point of interest or famous landmark nearby the location
  4. street(string): the street or road of the location
  5. subsubLocality(string): the subSubLocality of the location
  6. subLocality(string): the subLocality of the location
  7. locality(string): the locality of the location
  8. village(string): the village of the location
  9. subDistrict(string): the subDistrict of the location
  10. district(string): the district of the location
  11. city(string): the city of the location
  12. state(string): the state of the location
  13. pincode(string): the pincode of the location
  14. formattedAddress(string): the general protocol following address
  15. eloc(string): eloc of the particular location
  16. latitude(double): the latitude for the location.
  17. longitude(double): the longitude for the location.
  18. geocodeLevel(string): the best matched address component.

Sample Response data

  1. When ‘itemCount’ parameter is set to 1 or set to default.
  {
"copResults": {
"houseNumber": "some house number", 
"houseName": "", 
"poi": "", 
"street": "", 
"subSubLocality": "", 
"subLocality": "some subLocality", 
"locality": "some locality", 
"village": "", 
"subDistrict": "Kolkata", 
"district": "Kolkata District", 
"city": "Kolkata;Calcutta", 
"state": "West Bengal;WB", 
"pincode": "700029", 
"formattedAddress": "some address", 
"eLoc": "ELOC12", 
"latitude": XX.XX, 
"longitude": YY.YY, 
"geocodeLevel": "houseNumber" 
 } 
}  
  1. When ‘itemCount’ parameter is more than 1, “copResults” is returned as array.
  {
"copResults": [
{        
"houseNumber": "some house number",
"houseName": "",
"poi": "",
"street": "",
"subSubLocality": "",         
"subLocality": "some subLocality",
"locality": "some locality",         
"village": "",         
"subDistrict": "Kolkata",
"district": "Kolkata District",
"city": "Kolkata;Calcutta",         
"state": "West Bengal;WB",         
"pincode": "700029",         
"formattedAddress": "some address",         
"eLoc": "ELOC12",         
"latitude": XX.XX,         
"longitude": YY.YY,         
"geocodeLevel": "houseNumber"       
}  
}, 
{         
"houseNumber": "some house number",         
"houseName": "",         
"poi": "",         
"street": "",         
"subSubLocality": "",         
"subLocality": "some subLocality",         
"locality": "some locality",         
"village": "",         
"subDistrict": "Kolkata",         
"district": "Kolkata District",        
"city": "Kolkata;Calcutta",         
"state": "West Bengal;WB",         
"pincode": "700029",         
"formattedAddress": "some address",         
"eLoc": "ELOC12",         
"latitude": XX.XX,         
"longitude": YY.YY,         
"geocodeLevel": "houseNumber"       
 } 
]      
}