Autosuggest API

The Autosuggest API helps users to complete queries faster by adding intelligent search capabilities to your web or mobile app. This API returns a list of results as well as suggested queries as the user types in the search field.

Input URL

https://atlas.mapmyindia.com/api/places/search/json?

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

Input URL

GET

Request Parameters

The parameters are colour coded based on their requirements. The “Red” one’s are mandatory, and the “black” one’s are optional.

a. Mandatory Parameters:
  1. query (string) e.g. Shoes, Coffee, Versace, Gucci, H&M, Adidas, Starbucks, B130 {POI, House Number, keyword, tag}
b. Optional Parameters:
  1. location {string (latitude[double],longitude[double])} e.g. location=28.454,77.435 Location is required to get location bias autosuggest results.
  2. zoom (double): takes the zoom level of the current scope of the map (min: 4, max: 18).
  3. 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)

Request Headers

The Atlas API leverages OAuth 2.0 based security. Hence, the developer would need to send a request for access token using their client_id and client_secret to the OAuth API. Once validated from the OAuth API, the access_token and the token_type need to be sent as Authorization header with the value: “{token_type} {access_token}”.

1. Authorization: “{token_type} {access_token}”.
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 we’re 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, please contact MapmyIndia

Response Messages (as HTTP response message)

  1. 200: Success.
  2. 204: No matches we’re 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

suggestedLocations ([object])

  1. type (string): type of location POI or Country or City
  2. eLoc (string): Place Id of the location 6-char alphanumeric.
  3. placeAddress (string): Address of the location.
  4. latitude (double): Latitude of the location.
  5. longitude (double): longitude of the location.
  6. entranceLatitude: entry latitude of the location
  7. entrancelongitude: entry longitude of the location
  8. placeName (string): Name of the location.
  9. orderIndex (integer): the order where this result should be placed

Sample Input

https://atlas.mapmyindia.com/api/places/search/json?query=mmi000

{  "suggestedLocations": [  {  "type": "POI",  "typeX": 7,  "placeAddress": "Okhla Industrial Estate Phase 3 New Delhi Delhi 110020",  "latitude": 28.5507160000001,  "longitude": 77.2689280000001,  "eLoc": "MMI000",  "entryLatitude": 28.551045,  "entryLongitude": 77.268952,  "placeName": "Mapmyindia Head Office New Delhi",  "orderIndex": 1  }  ]  }