Hey hey!
Some of you have been talking to us about enriching and cleaning up data. Jobs in lead generation us it a lot, but if you don’t know what lead gen is, read on anyway. It’s cool what this app does!
There’ are a few steps to build this. First, you’ll have to activate the Google Maps Platform integration in dashdash’s Integrations menu by storing your Google API key there. This is how the app will look like in the end:
Cells where stuff is happening
A2: "McDonalds, Berlin" //the company you want to search
B2: =iferror(parse(place_search_google(A2),"place_id"),"not found")
C2: =iferror(place_detail_google(B2),"not found")
D2: =iferror(parse(C4,"result.name"),"not found")
E2: =iferror(parse(C4,"result.formatted_address"),"not found")
F2: =iferror(parse(C4,"result.formatted_phone_number"),"not found")
G2: =iferror(parse(C4,"result.website"),"not found")
What’s going on on the block above? Lets see:
-
B2
has a 3 functions. APLACE_SEARCH_GOOGLE
that calls Google Places API/ Web Service/ Place Search/ Text Search, where you can provide an imprecise search term (its thequery=
part) and get very nice places that exist on Google!The second part, is a
PARSE
on this response to thePLACE_SEARCH_GOOGLE
, which is filtering just the variableplace_id
inside first result (results[0].place_id
); this will return the unique identifier for that result, so that we can do more stuff in another Google API. The last function is just theIFERROR
that returns a nice message in case the API request fails or doesn’t return any results. -
C2
also includesIFERROR
, same as above. Apart from it, thePLACE_DETAIL_GOOGLE
is calling Google Places API/ Web Service/ Place details, where we provide Google with aplace_id
and it’ll give us all the info it has on that place. Beautiful.
-
D2
throughG2
are fetching individual parts of the response inC2
withPARSE
.
And that’s all folks!
If you want to directly talk with the Google Places API without our integration, you can do that, too:
B2:
=iferror(parse(get("https://maps.googleapis.com/maps/api/place/textsearch/json?key="&$H$1&"&query="&A4),"results[0].place_id"),"not found")
Y C2:=iferror(get("https://maps.googleapis.com/maps/api/place/details/json?placeid="&B4&"&key="&$H$1),"not found")
(assuming you store your API key in H1)