Place Autocomplete API delivers fewer results than Google Maps - google-maps

I use the Place Autocomplete API (https://maps.googleapis.com/maps/api/place/autocomplete) trying to get the same results as in Google Maps. Until a few days ago the result where pretty the same, but now they differ significantly: In Google Maps I get the same results as before, but in Place Autocomplete API sometimes I don't get even one result anymore.
Example: Using https://maps.googleapis.com/maps/api/place/autocomplete/json?input=wanko%20ainring&language=de&components=country:de&key=mykey I get zero results. Typing in "wanko ainring" in Google Maps I get one result with an address.
Has something internally changed in the Place Autocomplete API or am I doing something wrong?
Or maybe I should generally ask: How do I get the same results in Place Autocomplete API as in Google Maps?
Thanks for any comment.

Related

Maps search api won't show some results

i'm using google maps search api to search for an existing place but i don't get any result. If i search the same query on google maps or google street view, i can find the place.
Query: Rialto Luxury Studios
Maps result: https://www.google.it/maps/place/Rialto+Luxury+Studios/#45.4378195,12.3367443,18z/data=!4m8!1m2!2m1!1sRialto+Luxury+Studios!3m4!1s0x477eb1dbca09ab15:0x98e130dbd1f6fbf7!8m2!3d45.4377321!4d12.336083
Api call: https://maps.googleapis.com/maps/api/place/autocomplete/json?input=Rialto+Luxury+Studios&key=[xxxxxxxxxxxx]
Is there anything i'm doing wrong?
Thx
Why are you using autocomplete? If you are just searching for place details then textsearch is probably the way to go.
A textsearch for 'Rialto+Luxury+Studios' returns the result you want as the second result.
Adding some more detail, a textsearch for 'Rialto+Luxury+Studios+Ponte+di+Rialto'
returns the result you want as the first result.
If you can't find a place, a nearbysearch is usually a good way to go: location=45.437670,%2012.336059&radius=1000&keyword=rialto+luxury
I do not know why autocomplete isn't showing your result, sorry, can't help you there.

Google Geocoding API suddenly returns only one result

I am using Google Maps Geocoding Api in one of my applications in order to get addresses from a user address search term. It was working fine but now it returns only one result every time. There is also an open issue here:
Open issue with Geocoding API
Do you have any idea of what is may happenning?
From what I can see, if the search is quite generic then google returns only one result.

Google maps GeoCode API doesn't return any result at all?

This is weird. When I search something like "The New York Palace Hotel,America,New York" in Google maps app's search box I get exactly the hotel on the map.
However When I use the maps API,
A GET at http://maps.googleapis.com/maps/api/geocode/json?address=The%20New%20York%20Palace%20Hotel,America,New%20York&sensor=true
I get ZERO results in the response.
It doesn't even give New York as the option in search results.
I am making an app where I use this API to get the lat-long for user provided address.
Now, I don't know why this Google maps API doesn't work the way the Google maps app works.
BUT I wanted to know, is there a way to search and provide Google maps API these search terms as meaningful words where instead of taking whole string as one parameter it knows which city I am searching and which Address I ams searching.
If not, then only option left with me will be to Once the first results fails I make another query for city name only.
recently, i was given a similar task, and came to know the api works reverse... i.e.. we can get address for lat lon that we provide.. and that too has its own restrictions (i.e.. no.of addresses resolved per request, mostly some 2500 address per day something...)....here you can get some info over that...
You are using the Geocoding API. "The New York Palace Hotel,America,New York" is not an address, it is a "place". The Places API might be a better option.
Example of your query using the (javascript version of) the Places API

Google Maps search box vs Google Places API

I'm quite new to the Google Places API. What I want to achieve is create a simple search box where people can search places based on Google places, and choose one of them to get the coordinate (latitude, longitude).
Currently I'm using the Google Places API. All the steps are pretty straight forward, but after using it for a couple of day, I realize that sometimes the result from the Google Maps search box is better than the Google places API.
Below is what I test right now for Google Maps and the Google Places API
I test the result from the Google Maps search box with maps.google.com and see all the autocomplete.
I'm using the Google places API without any limitation in radius (orderby=distance), sensor is false, I put the user current location in the location parameters and the text into the keyword field.
Based on this configuration, the results are different. May I know if someone knows and would be willing to share how to configure the Google Places API URL to get the same results as with the Google Maps search box?
Or is it unachievable? That is, will the Google Places API search result not be as good as when we search in Google Maps? If so, is there any policy that does not allow people to only use the Google search box and the coordinate result without showing the map?
I believe Google Maps autocomplete uses a combination of results from the Place autocomplete and Query autocomplete services. Based on your mention of rankby=distance, it sounds like you're using the nearbysearch service, which will return somewhat different results from the autocomplete services. Have a look at the Google Places API documentation for the details of using the autocomplete services.
https://developers.google.com/places/documentation/

How to handle inaccurate Google Maps locations?

When I type in addresses in Google maps for locations in Asia, quite a lot of them are off by more than 200 metres. For example, "blk 85 bedok north road, singapore" is off by more than 300 metres. While I don't expect Google Maps to be spot on every time, sometimes the error is too great for certain use cases. What options do I have to handle inaccurate Google Maps locations in a web app? The web app should let the user enter an address or postal code as part of an entry and I will geocode the address and store the lat-long.
You could use bing, yahoo's and google's Geo Location api's to find latitude and longitude for a location, average the results together and use the result. Thus, if they all agree, you still get a good location, but if they disagree you get the best approximation of all three.
You could even programmatically compare the results from each engine and throw out any that don't agree with the others (for instance, if bing and yahoo agree and google does not, you could throw out google).
Beyond that, if you have a collection of addresses you know to be wrong, you could simply store the correct longitude and latitude for those points, and override the results in those cases.
Of course, to get around this problem at all, you'll need to geocode the addresses, check their validity in some way (as described above), and plot them using their latitude and longitude.
You don't have any fixes for this really, you're at the mercy of the accuracy of google maps here. The important part is you don't know if the address in inaccurate when doing one search to the next, so nothing you can do to handle it.
You can post a topic here and google will see it and often respond as well: Google Maps Local Listing Forums. I'd open something there with some of your examples and hope they get more accurate...that's all you can do in this case.
There are always other alternatives as well, yahoo and bing have mapping APIs, but I have no idea how much better or worse off you'd be going that route.
The problem is not the lat/lng data, in fact, they are correct. The problem is that the geo coords of the map tiles of the public Google maps api are inaccurate. The maps at maps.google.com are provided by a different map provider than the map tiles used with the public Google Maps API that you can embed in your website, use in your own applications, etc.
Check my recent posting at Google Maps & apps with mapview have different current positions
Is the result out on maps.google.com as well as through the maps api?
If on google maps live site the result is accurate then you can do an ajax search to return the correct lon/lat.
I have used this when geocoding UK postcodes
Geocoding UK Postcodes with Google Map API
I tried to reply to the upper answer, but I am not qualified enough yet. Just be aware that whatever you're using for geocoding, sometimes has restrictions on the use of that data. For example, google's geocoding API isn't allowed to be used to display information retrieved anywhere but google maps. The same might be for the others, I don't know what your project is, but it's something to be aware of.