When searching for a specific place in the Google Places API I found out that Google delivers results far away from the restriction I sent with.
For example:
https://maps.googleapis.com/maps/api/place/findplacefromtext/json?key=<mykey>&inputtype=textquery&input=<PlaceQuery>&fields=name,geometry&locationbias=circle:200#<lat>,<lng>
In this query above I tried to find a place in a specific circle (200 metres) around a point lat lng. (Removed for this post)
Google does it's work but when I enter a place to search for which is definitely not in the region I specified it still finds the place.
Did I misunderstood something with this type of search query? Or is it a mistake at googles end?
Related
I am trying to fetch airports using the Places API autocomplete feature.
Looking at the types parameter, if this is an airport I display the result or else show it as no airports found.
I want to enhance this app, I want to show terminals within each Airport object that I display on the front end.
I have found the nearby search within places API but it is difficult to create a search query using keyword, and type to get exact results for all the airports around the world.
Does anyone have any idea as to what would be the best way to get airports and their terminals using the Places API?
Well I'm not sure if this is really your expected result but here's what I tried:
Get the placeId of an airport using Place Autocomplete.
https://maps.googleapis.com/maps/api/place/autocomplete/json?input=dublin&radius=500&types=airport&key=API_KEY
Then use that placeId to do a Place Details request and get the coordinates of the airport.
https://maps.googleapis.com/maps/api/place/details/json?place_id=ChIJLxmTab4RZ0gRVfMlt7UbElU&key=API_KEY
This also returns an overview of the airport wherein in this case the result says: "
"Airport with 2 runways, a 2nd terminal opened in 2010 plus buses into Dublin & other towns/cities."
Then after having the coordinates, I use that to do a Nearby Search request.
https://maps.googleapis.com/maps/api/place/nearbysearch/json?keyword=terminal&location=53.42644809999999,-6.249909799999999&radius=10000&key=API_KEY
This managed to get the terminals around it, I just threw in some radius but I guess it should be different on other locations. I also tried this with other Airports and it somehow worked.
If this won't work for your use case. Another thing I think you could do is to store the coordinates of known airports (Please note that coordinates/placeID are the only thing that is allowed for us to store/cache. Please see Specific Terms). And create an object which also stores the coordinate of their corresponding terminals. This would be an extensive work if you want to do this with airports all around the world.
Hope this helps.
I'm trying to use youtube data search and video API in my web application to display top view-counted videos related with several keywords. I'm planing to use totally two calls: the first call get id list with search API, and the second call get details for the ids hit on the first call, with video API.
My question is with regard to search API. Based on my trial and error, If I input multiple keyword with space separation in the parameter q for search API, it's looks behaves as AND condition it's not same as common behavior such as google. To search with multiple keywords with OR condition, As far as I tried, it's looks working if I Include the OR between keywords, but I would like to confirm my assumption correct, officially if possible.
I should be able to find this kind of specification in the official documentation, but finally I have no luck. It's very helpful if you could share these links if exists or give me the official answer.
By the way, it is my first post to stackoverflow. If there is missing point of my question, please kindly advice.
I am seeing a recent change to the Google Places API where, when I run a query like so, I get photos.
https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=34.1686107,-83.9003022&rankby=distance&types=bakery|food|cafe|restaurant&key=xyz
When I run one like so, I no longer get photos.
https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=34.203979,-83.943787&radius=2000&types=bakery|food|cafe|restaurant&key=xyz
Is anyone else seeing this issue? The only difference is the radius vs. rankby argument. I used to see the photos for both queries.
Thanks!
Basically, my problem is the same as here: Google Places API: Searching for names containing spaces
If you use %20, it works for the one name containing it, but ignores the rest.
I have a need to find restaurants near by, but only restaurants I've got additional information on, so I've got a list of 10 restaurants, I want to show the closest restaurants of the 10, it appears as though google places may not support this (spaces in names of restaurants), is there another API I should be looking at?
Are you storing these restaurants in your own database?
If you are, you need to do proximity search. MySql & Postgres has GIS plugins that support this given a lat/long.
Performing a Places Search Request with multiple keywords or names is not officially supported by the Places API therefore is not guaranteed to return accurate results.
Google Places API: Searching for names containing spaces
I want to sort results fetched via google places api based on increasing distance from "location" (a pair of lat, lng). There is no documentation on their official page. http://code.google.com/apis/maps/documentation/places/#PlaceSearchRequests
It just says:
Each element of the results array contains a single result from the
specified area (location and radius), ordered by prominence. The
ordering of results can be influenced by check-in activity within your
application - Places with many recent check-ins may figure more
prominently in your application's results. The result may also contain
attribution information which must be displayed to the user.
However they didnt mention anything about their prominence meter algorithm.
The Google Places API does not currently support this feature.
There is a feature request for this in the Places API issue tracker here:
http://code.google.com/p/gmaps-api-issues/issues/detail?id=3322
Please click the 'star' icon to be notified of future changes, and to let us know you are interested in seeing it resolved.
Cheers
Chris
This has been added to the API, please use the 'rankby=distance' instead of 'radius' in your Place Search Request as described in the documentation here: https://developers.google.com/maps/documentation/places/#PlaceSearchRequests