Next Previous

Places API Search Nearby Places


Nearby search is part of the Google Places API Library.

Nearby Search request allows us to search for different types of places such as restaurants, grocery stores, etc close by to the user’s location.

✅Get User Location using HTML5 Geolocation in the form of Latitude and Longitude.

     position => {
     error => {

✅ Then, make an HTTP request to Nearby Search Library.

Base URL

Required URL Parameter

JSON or XMLoutput format (json recommended)

Required Query Parameters

keyYour API Key from Google Cloud Platform. Find how to get it here
locationThe value must be specified in the format of latitude, longitude
radiusSpecify in meters. i.e. 5000 = 5KM
typeThis could be a restaurant, bar, etc. full list here

Optional Query Parameters

rankbydistanceThis will sort places in asending order by their distance. When using rankby, radius option can’t be used.

Here is a sample URL with the required parameters:[YOURAPIKEY]&location=-33.8670522,151.1957362&radius=5000&type=restaurant

The returned JSON object will look like this:

Next Previous