Nearby API

Nearby Places API, enables you to add discovery and search of nearby POIs by searching for a generic keyword used to describe a category of places or via the unique code assigned to that category.

API URL

Request Parameters

The following input parameters will be supported in the nearby API request –

  1. lat: the latitude of the location near which POI of specified category is required.
  2. lng: the longitude of the location near which POI of specified category is required.
  3. page: it's a mandatory parameter of which the value ranges from 1 uptill 10. It's used to refer to the page number of the list of POIs returned.

Please Note: The parameters are below and if not sent then default values will be used to calculate the result. However, either of the two must be sent for a successful request

  1. code: the unique code assigned to that POI category. Optional. If keyword parameter is present, this input parameter is ignored, but one of them is must in input parameters. (See Appendix B)
  2. keywords: any generic query that can be used to refer to a POI. Optional. Should not be used with code input parameter. One of the two parameters: code or keyword is required.

Response Parameters

The nearby API will return at most 3 POIs per result object. The following output parameters will be supported in the API response –

  1. 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.
  2. version (string): The version of the API you’re connected to.
  3. results (object [ ]): a collection containing a single object of details of a location matching the provided parameters. The contains the following properties: 
    • poi (string): The name of the POI if the location is a place of interest (POI).
    • street (string): The name of the street of the location.
    • 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.
    • 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.
    • pincode (string): The pin code of the location area.
    • address (string): complete human readable address.
    • longitude (string): longitude of the location.
    • latitude (string): latitude of the location.
    • state (string): The name of the state in which the location exists.
    • place_id (string): The eLoc or placeId assigned for a place in map database. An eLoc is the digital identity for an address or business to identify its unique location. For more information on eLoc, click here.
    • poi_dist (string): distance of the POI from input location in metres.

Performance

The nearby API must respond within 100 ms under all circumstances on a stable internet connection although on an unstable one, response times may vary.
Maximum of 3 POIs are given as output per page. Code (code) input parameter’s valid input values can be taken from the list of mapped POI categories (to be shared separately; appendix B).

Transaction Information

One request using the API link will be considered as one transaction, up to 3 POIs in one transaction.

Use Cases

  • For a quick search about what’s nearby.
  • Search for nearby categories e.g. Coffee, Hospitals

Example

Input:
https://apis.mapmyindia.com/advancedmaps/v1/<licence_key>/nearby_search?lat=28.546955020526934&lng=77.28168801307678&keywords=food&page=1

Output:

{  "responseCode": 200,  "version": "130.10",  "results": [  {  "poi": "Cafe Nescafe",  "subSubLocality": "",  "subLocality": "",  "locality": "Jasola Vihar",  "city": "New Delhi",  "subDistrict": "Kalkaji",  "district": "South District",  "longitude": "77.2829760000001",  "latitude": "28.5402260000001",  "state": "Delhi",  "pincode": "110025",  "place_id": "D8TATD",  "poi_dist": "480",  "code": "FODCOF"  },  {  "poi": "Food Track",  "subSubLocality": "",  "subLocality": "",  "locality": "Jasola Vihar",  "city": "New Delhi",  "subDistrict": "Kalkaji",  "district": "South District",  "longitude": "77.2834990000001",  "latitude": "28.537719",  "state": "Delhi",  "pincode": "110020",  "place_id": "5C948Q",  "poi_dist": "662",  "code": "FODFFD"  },  {  "poi": "Sabras Foods",  "subSubLocality": "",  "subLocality": "Splendor Forum",  "locality": "Jasola District Centre",  "city": "New Delhi",  "subDistrict": "Kalkaji",  "district": "South District",  "longitude": "77.286364",  "latitude": "28.537829",  "state": "Delhi",  "pincode": "110025",  "place_id": "FTKO72",  "poi_dist": "935",  "code": "FODIND"  }  ]  }