I recently had a requirement to look in to using the Google Places API in some code i was writing.
I found this library here that made the whole thing a lot easier.
https://github.com/azizmb9494/Google-Places
I ended up writing a quick C# application to test the different searches by lon/lat and by text.
Download Places – a quick and dirty C# application that implements the API.. you’ll need to get a Google API Key to run it.
https://developers.google.com/places/web-service/get-api-key
Paste your key in to the app and then you can search by lon/lat, text or a combination of both
The basic guts of the code is below. Having never had anything to do with Google API’s before, it was pretty simple to get some programmatic searching going on…
Example method using the API above:
private async void TestGooglePlaces() { Response results; var placeList = new List<Place>(); string apiKey = "your api key"; if ((string.IsNullOrEmpty(txtLat.Text) || string.IsNullOrEmpty(txtLon.Text))) //if we dont have a lon/lat .. search txt { results = await Places.Api.TextSearch(txtQuery.Text, apiKey); } else { results = await Places.Api.SearchPlaces(Convert.ToDouble(txtLat.Text), Convert.ToDouble(txtLon.Text), txtQuery.Text, apiKey); } //add the results to placeList foreach (var place in results.Places) { placeList.Add(place); } //if there are more than one 'page' of results... while (results.Next != null) { //get the next lot of results results = await Places.Api.GetNext(results.Next, apiKey); foreach (var place in results.Places) { placeList.Add(place); } } foreach (var place in placeList) { var placeDetails = await Places.Api.GetDetails(place.PlaceId, apiKey); //do stuff with your place and placeDetails string name = place.Name; string address = placeDetails.Address; //...... } }