Find businesses around any location with Google Maps Platform

Hey,

If your work involves finding businesses, museums or any other type of place in a specific location, you can build yourself an app to do that in just a few minutes.

In this post, we’ll show you how to quickly find all of the gyms that are within 300 meters of Piccadilly Circus. Just in case you’re in the mood for a quick workout next time you are in London.

Here’s what our app will look like:

1. Setup the Google Maps Platform integration

First, follow our guide on how to get your Google API key and connect the Google Maps integration.

2. Select an address and geocode it into its latitude and longitude

To find the gyms, we first need to define the location for our search and find its latitude and longitude:

A1: Address
B1: Piccadilly Circus
A2: Geocode
B2: =GEOCODE_GOOGLE(B1)
A3: Latitude
B3: =PARSE(B2,"[‘lat’]")
A4: Longitude
B4: =PARSE(B2,"[‘lng’]")

Now you’re app should look like this:

3. Select the radius of search and use NEARBY_SEARCH_GOOGLE

Now, let’s select the search radius for our query and the type of place we are looking for (in our case, the gym).

A5: Radius
B5: 150
A6: Search
B7 :
A7: Type
B7: gym
A8: Nearby request
B8: =NEARBY_SEARCH_GOOGLE(B3,B4,B5,B6,B7)

To refine the search you can add a specific keyword in B7. Use “Peak DNA” to find a gym that matches those keywords.

4. Create a table with the list of gyms

To finalize our app, we will add the names, addresses and google ratings of the gyms to a table. To automatically add records to the table, we will use the INSERT_DATA function and match the results of the nearby search with the table headers we are looking for.

A9: Insert data
A11: name
A12: vicinity
A13: rating
B9: =INSERT_DATA(PARSE(B8,"[‘results’]"),A11:C11)

That is it. Your app is now ready. Let’s see it at work :muscle:

Tip: The search will be triggered everytime you add/update/remove any of the arguments (Address, Latitude, Longitude, Radius, Search, Type).

To avoid the automatic search add a control cell “N” in C8. Then, change B8 to =IF(C8="Y", NEARBY_SEARCH_GOOGLE(B3,B4,B5,B6,B7),"Search not executed"). This way, the query will only run when C8 is “Y”.

Happy building,
Henrique

1 Like