My purpose is to use R to query google api. I have a list of addresses and names (belong to shops, restaurants, etc.) and for each of them I need to store:
"latitude", "longitude", "business type"
My idea is to use google place api:
-Use the Text Search Requests to search the address to store latitude e longitude
https://maps.googleapis.com/maps/api/place/textsearch/xml?query=address&key=AddYourOwnKeyHere
-Then use the Radar Search Requests to search the name nearby the latitude e longitude. So I get the ID_place
https://maps.googleapis.com/maps/api/place/radarsearch/json?location=latitude,longitude&radius=1&keyword=name&key=AddYourOwnKeyHere
-Thanks to the ID_place, I query the Place Details Requests to get detail about business type (es. "types" : [ "food" ] )
https://maps.googleapis.com/maps/api/place/details/json?placeid=ID_place&key=AddYourOwnKeyHere
I'm very new to use google api and maybe is not the most efficient way to do it. But I need to give some consideration: -Sometimes the address is not complete (sometimes I have the civic number missing) -Not always the name is correct (sometimes I have abbreviations)
I need to understand some things:
- -If this is the best way to do it
- -How query these Google api with R
- -How handle the json output