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?

Method

GET

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

Request Parameters

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
  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)
  4. tokenizeAddress (valueless) = provides the different address attributes in a structured object.
  5. pod (string) = it takes in the place type code which helps in restricting the results to certain chosen type.
    Below mentioned are the codes for the pod -
    1. SLC: Sublocality
    2. LC: Locality
    3. CITY: City
    4. VLG: Village
    5. SDIST: Subdistrict
    6. DIST: District
    7. STATE: State
    8. SSLC: Subsublocality
  6. filter = this parameter helps you restrict the result either by mentioning a bounded area or to certain eloc (6 digit code to any poi, locality, city, etc.), below mentioned are the both types -
    a. filter = bounds: lat1, lng1; lat2, lng2 (latitude, longitude) {e.g. filter=bounds: 28.598882, 77.212407; 28.467375, 77.353513}
    b. filter = cop: {eloc} (string) {e.g. filter=cop:YMCZ0J}

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}..
Security Type:

Atlas OAuth 2.0 based security using AES 256 and SHA-1.

Response Type

JSON: if the user passed in ./json..

XML: if the user passed in ./xml.

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

a. suggestedLocations ([object])

  1. eLoc (string): Place Id of the location 6-char alphanumeric.
  2. placeName (string): Name of the location.
  3. placeAddress (string): Address of the location.
  4. type (string): type of location POI or Country or City
  5. latitude (double): Latitude of the location.
  6. longitude (double): longitude of the location.
  7. orderIndex (integer): the order where this result should be placed
  8. keywords (object): contains the category code to which the POI result(if applicable) belongs to.
  9. addressTokens (object)
    1. houseNumber (string): house number of the location.
    2. houseName (string): house name of the location.
    3. poi (string): name of the POI (if applicable)
    4. street (string): name of the street. (if applicable)
    5. subSubLocality (string): the sub-sub-locality to which the location belongs. (if applicable)
    6. subLocality (string): the sub-locality to which the location belongs. (if applicable)
    7. locality (string): the locality to which the location belongs. (if applicable)
    8. village (string): the village to which the location belongs. (if applicable)
    9. subDistrict (string): the sub-district to which the location belongs. (if applicable)
    10. district (string): the district to which the location belongs. (if applicable)
    11. city (string): the city to which the location belongs. (if applicable)
    12. state (string): the state to which the location belongs. (if applicable)
    13. pincode (string): the PIN code to which the location belongs. (if applicable)

b. suggestedSearches ([object])

  1. keyword (string): what the user typed in.
  2. Identifier (string): what did the API use for it to qualify it as a suggested search request
  3. location (string): the name of the location to which the nearby will run in context to.
  4. hyperlink (string): the ready-made link for the nearby API pre-initialized with all default parameters and location with code to search for.

Sample Input

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

{  "suggestedLocations": [  {  "type": "POI",  "typeX": 7,  "placeAddress": "Bahai Temple Road, Bahapur, Kalkaji, New Delhi, Delhi, 110019",  "latitude": 28.553302,  "longitude": 77.258677,  "eLoc": "JQ5QN8",  "entryLatitude": 28.552913,  "entryLongitude": 77.261556,  "placeName": "Lotus Temple",  "alternateName": "Bahai House Of Worship,bahai Temple",  "keywords": [  "RCNTST"  ],  "addressTokens": {  "houseNumber": "",  "houseName": "",  "poi": "Lotus Temple",  "street": "Bahai Temple Road",  "subSubLocality": "",  "subLocality": "Bahapur",  "locality": "Kalkaji",  "village": "",  "subDistrict": "Kalkaji",  "district": "South East Delhi District",  "city": "New Delhi",  "state": "Delhi",  "pincode": "110019"  },  "p": 3,  "orderIndex": 1  },  {  "type": "POI",  "typeX": 7,  "placeAddress": "Mehrauli Gurgaon Road, Sector 14, Gurugram, Haryana, 122001",  "latitude": 28.470402,  "longitude": 77.0470760000001,  "eLoc": "1ATS36",  "entryLatitude": 28.470192,  "entryLongitude": 77.047176,  "placeName": "Lotus Plaza",  "alternateName": "",  "keywords": [  "SHPBLD"  ],  "addressTokens": {  "houseNumber": "",  "houseName": "",  "poi": "Lotus Plaza",  "street": "Mehrauli Gurgaon Road",  "subSubLocality": "",  "subLocality": "",  "locality": "Sector 14",  "village": "",  "subDistrict": "Gurgaon",  "district": "Gurgaon District",  "city": "Gurugram",  "state": "Haryana",  "pincode": "122001"  },  "p": 4276,  "orderIndex": 2  },  {  "type": "POI",  "typeX": 7,  "placeAddress": "Inner Circle, Lotus Pond, Vaibhav Khand, Indirapuram, Ghaziabad, Uttar Pradesh, 201014",  "latitude": 28.636667,  "longitude": 77.3640300000001,  "eLoc": "XQT4WZ",  "entryLatitude": 28.636685,  "entryLongitude": 77.363768,  "placeName": "Studio",  "alternateName": "",  "keywords": [  "SHPOTH"  ],  "addressTokens": {  "houseNumber": "",  "houseName": "",  "poi": "Studio",  "street": "Inner Circle",  "subSubLocality": "Lotus Pond",  "subLocality": "Vaibhav Khand",  "locality": "Indirapuram",  "village": "",  "subDistrict": "Ghaziabad",  "district": "Ghaziabad District",  "city": "Ghaziabad",  "state": "Uttar Pradesh",  "pincode": "201014"  },  "p": 4437,  "orderIndex": 3  },  {  "type": "POI",  "typeX": 7,  "placeAddress": "Mawana, Meerut District, Uttar Pradesh, 250404",  "latitude": 29.166073,  "longitude": 78.0127820000001,  "eLoc": "13F29Q",  "entryLatitude": 29.16174,  "entryLongitude": 78.012294,  "placeName": "Lotus Temple Hastinapur",  "alternateName": "",  "keywords": [  "PLPJAN"  ],  "addressTokens": {  "houseNumber": "",  "houseName": "",  "poi": "Lotus Temple Hastinapur",  "street": "",  "subSubLocality": "",  "subLocality": "",  "locality": "",  "village": "",  "subDistrict": "Mawana",  "district": "Meerut District",  "city": "",  "state": "Uttar Pradesh",  "pincode": "250404"  },  "p": 3025,  "orderIndex": 4  },  {  "type": "LOCALITY",  "typeX": 5,  "placeAddress": "Dharwad, Karnataka, 580007",  "latitude": 15.4634060000001,  "longitude": 74.981859,  "eLoc": "PW1CN7",  "entryLatitude": 0,  "entryLongitude": 0,  "placeName": "Lotus Layout",  "alternateName": "",  "keywords": [  ],  "addressTokens": {  "houseNumber": "",  "houseName": "",  "poi": "",  "street": "",  "subSubLocality": "",  "subLocality": "",  "locality": "Lotus Layout",  "village": "",  "subDistrict": "Dharwad",  "district": "Dharwad District",  "city": "Dharwad",  "state": "Karnataka",  "pincode": "580007"  },  "p": 20440,  "orderIndex": 5  },  {  "type": "LOCALITY",  "typeX": 5,  "placeAddress": "Bhuj, Gujarat, 370001",  "latitude": 23.235486,  "longitude": 69.675712,  "eLoc": "WIJBLV",  "entryLatitude": 0,  "entryLongitude": 0,  "placeName": "New Lotus Colony",  "alternateName": "",  "keywords": [  ],  "addressTokens": {  "houseNumber": "",  "houseName": "",  "poi": "",  "street": "",  "subSubLocality": "",  "subLocality": "",  "locality": "New Lotus Colony",  "village": "",  "subDistrict": "Bhuj",  "district": "Kachchh District",  "city": "Bhuj",  "state": "Gujarat",  "pincode": "370001"  },  "p": 21845,  "orderIndex": 6  },  {  "type": "POI",  "typeX": 7,  "placeAddress": "Andheri Kurla Road, International Airport Zone, Jb Nagar, Andheri East, Mumbai, Maharashtra, 400059",  "latitude": 19.111815,  "longitude": 72.8711670000001,  "eLoc": "C7124S",  "entryLatitude": 19.111855,  "entryLongitude": 72.870992,  "placeName": "VITS Hotel Mumbai",  "alternateName": "Lotus Suites Hotel,vits Hotel",  "keywords": [  "HOTPRE"  ],  "addressTokens": {  "houseNumber": "",  "houseName": "",  "poi": "VITS Hotel Mumbai",  "street": "Ram Krishna Mandir Road",  "subSubLocality": "",  "subLocality": "Bhim Nagar",  "locality": "Andheri East",  "village": "",  "subDistrict": "Mumbai Suburban",  "district": "Mumbai Suburban District",  "city": "Mumbai",  "state": "Maharashtra",  "pincode": "400059"  },  "p": 561,  "orderIndex": 7  },  {  "type": "POI",  "typeX": 7,  "placeAddress": "Jubilee Hills, Hyderabad, Telangana, 500033",  "latitude": 17.4137000000001,  "longitude": 78.4202500000001,  "eLoc": "1SE745",  "entryLatitude": 17.414078,  "entryLongitude": 78.421296,  "placeName": "Lotus Pond",  "alternateName": "",  "keywords": [  "NTCLAK"  ],  "addressTokens": {  "houseNumber": "",  "houseName": "",  "poi": "Lotus Pond",  "street": "",  "subSubLocality": "",  "subLocality": "",  "locality": "Jubilee Hills",  "village": "",  "subDistrict": "Shaikpet",  "district": "Hyderabad District",  "city": "Hyderabad",  "state": "Telangana",  "pincode": "500033"  },  "p": 986,  "orderIndex": 8  }  ],  "suggestedSearches": [  {  "keyword": "Lotus",  "identifier": "near",  "location": "me",  "hyperLink": "https://atlas.mapmyindia.com/api/places/nearby/json?explain&richData&refLocation=28.550976,77.268863&keywords=Lotus",  "orderIndex": 0  }  ]  }