I've been trying to find specific place in Google Places API with no success. When I type "La Cucina Trattoria" in Google Maps I get three results. However, when I run this query:
https://maps.googleapis.com/maps/api/place/autocomplete/json?key=API_KEY&input=la%20cucina%20trattoria
I only get two results. So I've tested more queries with similar effectiveness:
input=la%20cucina%20trattoria%20gmbh - no results
https://maps.googleapis.com/maps/api/place/search/json?key=API_KEY&location=48.139649,11.602685&rankby=distance&keyword=cucina - place missing in results (I've put its exact location as a parameter)
location=48.139649,11.602685&rankby=distance&keyword=Neherstraße%209 - place missing in results (however, it is returning results from the same street)
My client named two random places he knows and none of them could be found in Google Places API. Is it possible that Google Places API and Google Maps operate on two different databases? Or can these places be hidden in the public API?
I've come across similar issues, but usually changing the query gave better results. Aside from reporting it, you can manually add a place:
POST https://maps.googleapis.com/maps/api/place/add/json?key=AddYourOwnKeyHere HTTP/1.1
Host: maps.googleapis.com
{
"location": {
"lat": -33.8669710,
"lng": 151.1958750
},
"accuracy": 50,
"name": "Google Shoes!",
"phone_number": "(02) 9374 4000",
"address": "48 Pirrama Road, Pyrmont, NSW 2009, Australia",
"types": ["shoe_store"],
"website": "http://www.google.com.au/",
"language": "en-AU"
}
This should allow your application to immediately see the place and potentially have it added into Google Maps.
I was unable to find La Cucina Trattoria in Places, and I tried a number of different tactics, including a Text Search (https://maps.googleapis.com/maps/api/place/textsearch/xml?query=italian restaurant on Neherstraße in munich&key=MYKEY). I'd report it to the Place API Issues tracker here: https://code.google.com/p/gmaps-api-issues/issues/list?can=2&q=apitype:PlacesAPI%20type:Defect&sort=-stars&colspec=ID%20Type%20Status%20Introduced%20Fixed%20Summary%20Internal%20Stars
Check through the extensive list of existing bugs to see if you can add your name to an existing one and speed its resolution. Here are some similar confirmed bugs:
Some queries return no results when there should be many
Bug: Sparse search results in germany
Bug: Place details request returns wrong result
Related
When searching for a venue in Google, I can usually see the following bar graph displaying how busy the place is each hour:
I am looking at the Google Places API docs, but cannot seem to find the relevant information.
It's not currently possible to get popular or busy times information from Google's Place API.
However, there is an open feature request in Google's Issue Tracker which I suggest starring to increase visibility and subscribe to future notifications:
https://issuetracker.google.com/issues/35827350
BestTime.app provides foot traffic data almost similar to Google Popular Times and Foursquare data, but with more functionality. You can also analyze and filter foot traffic data of multiple places in an area. So you can for example filter places and show only bars that are busy on Friday evening, or show only supermarkets that are quiet on Sunday morning. Or sort the places by foot traffic on a specific hour of the day, or the dwell time (how long people visit a place).
You can view the data through their website tools (e.g. on a heatmap), or get the same data through their software API (Software API tutorial).
Integrating the API is really useful if you want to e.g. make consumer-focused apps/websites to inform people to which place they should and at what time (i.e. automatically curate lists of best places to go).
In the picture above the BestTime.app Radar tool shows foot traffic data for popular attractions in New York City. On the left the a foot traffic prediction is shown for the whole day. The map is overlayed with a heatmap that indicates the predicted foot traffic intensity for current hour per place. Using the filters, in the right panel, you can narrow down your search by selecting for example only the quiet NYC attractions on Friday afternoon.
Disclosure: I work for BestTime.app
The issue in Google maps is assigned, but is being analyzed, but there are some helpful repositories in GitHub to obtain the data with just your API KEY and the place ID. These are the ones I found useful:
This one written in Python and easily let you get the hours by day. Also I found useful this repository written in python and make a web scraping and this one that is written in JavaScript.
Have a look at the Tufuta API documentation. This uses anonymised cell phone data.
Example API here:
[ { "company": "dubaishoppingcenter", "date": "25/08/2020", "day": "Tuesday", "hourtwentyfour": "11", "inference": "59,68,74,48.11737239360809,68,61,63,65,12,20,44,54,59,64", "init": "0", "latitude": "", "live": "48.11737239360809", "location": "dubai", "longitude": "", "maxoccupancy": "347", "month": "August", "quarter": "Q3", "time": "11:45", "truetime": "11:54", "weather": "Windy and Overcast", "year": "2020" } ]
Disclosure: I work for Tufuta
I'm currently working on an app with GoogleMaps API using their PlacesAutocomplete plugin to fill an input.
The problem which I encountered is that for the result types for Airports I get only establishment. I tried using establishment and geocode for parameters in the API call but with no luck. I either get only establishment or maximum transit_station in the results. The problem with transit_station is that all the train stations, airports, bus stations are marked the same.
I need a way to get the specific type for each of them, could someone help me please, maybe I'm doing something wrong.
You can see in the screenshot below the result from the API
According to the documentation, currently the types parameter of places autocomplete supports only following values:
geocode
address
establishment
(regions)
(cities)
https://developers.google.com/maps/documentation/javascript/places-autocomplete#add_autocomplete
LE: Found a workaround
In order to get the place type I used another API this time Place Details
I took the placeId from the Autocomplete request and fired a new request to the Place Details with the fields parameter set to types
https://maps.googleapis.com/maps/api/place/details/json?key=[YOUR_KEY]&placeid=ChIJRQFUJVRhRUcR-C4yT1Y4KWk&fields=type
And the result was
{
"html_attributions": [],
"result": {
"types": [
"airport",
"point_of_interest",
"establishment"
]
},
"status": "OK"
}
So by combining the two calls I was able to get even the type which in the Autocomplete was not available
The docs for the the Place Details can be found here
For the Google Geocoding API (any version), is there any way to know if the response location (coordinate - latitude and longitude) is refereed to a 'house', a 'building' or none of them?
The idea here is to 'categorize' the location.
Given a list of human readable addresses (street name, number, zip, etc) I need to categorize each one of them as 'House', 'Building' or 'None'.
Request example:
https://maps.googleapis.com/maps/api/geocode/json?address=Dieciocho%2045%2C%20Santiago%2C%20Region%20Metropolitana&key={{key}}&components=country:CL
With the example the "location_type" is "ROOFTOP" (perfect accuracy) but even thou I don't see any address_component that can give me the information I need. Am I missing something?
I have read the api documentation (https://developers.google.com/maps/documentation/geocoding/intro#GeocodingResponses) but didn't find anything helpful for the case.
Does anyone know how to achieve this result?
Thank you in advance
There is a way in the Geocoding API (and Places API) to tell whether a result is known (to Google Maps) to be a building of some sort or not.
In your example, "types" : [ "street_address" ] indicates the address is not tied to a specific building, in the API. There may actually be a building at that location in real life, it's just that the API does not know about it. So this is kinda telling you "don't know".
In the following example, "types" : [ "premise" ] the result indicates this is some kind of building... but as you can see, it's actually a cathedral:
https://maps.googleapis.com/maps/api/geocode/json?latlng=-29.903018,-71.251052
For more fine grain distinctions, Places API Text Search lets you search for pretty much everything Google Maps does, and shows more types. These don't seem like they'll be enough to tell residential houses from other buildings though, may want to file a feature request for that.
For such a purpose, use Google Places API.
From JS v3 API, snippet is like this:
var service = new google.maps.places.PlacesService(map);
service.nearbySearch({
location: new google.maps.LatLng(...),
radius: 10,
type: ['store']
}, callback);
https://developers.google.com/maps/documentation/javascript/examples/place-search
I am searching for the way to identify lat/lng coordinates of street intersections of, for example, city blocks in specified area. Previously, I tried to utilize the data from OpenStreetMap to do this, but it is not working well. (Please refer to my previous question: "How can I exhaustively collect latlng coordinates of street intersections from OpenStreetMap (or from any other data)?")
I was searching for the alternative method, and I found that Google Places API seems to offer the data I want. In the following page (link), Google says that it supports the Place Type "intersection". I tried the following url to access their API (with replacing MY_API_KEY with my Google API key),
https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=38.8962391,-77.0280818&radius=1000&types=intersection&sensor=false&key=MY_API_KEY
but no luck, it returned
{
"debug_info" : [],
"html_attributions" : [],
"results" : [],
"status" : "ZERO_RESULTS"
}
I was wondering why this is not working. Is it because I am in the area that the service is not supported (the area I specified above is in Washington D.C.), or am I making some mistake in the query? Is there any walk around to this or do you know better way to find the street intersection coordinates?
Thanks.
I am trying to use the Google Maps API to get the latitude and longitude of a few locations. For some reason, whenever I send a place name with an apostrophe, it does not return any results.
For instance, if I send the following requests for searching Berri's Pizza Cafe I get the results mentioned below
http://maps.googleapis.com/maps/api/geocode/json?address=berri%27s+pizza+cafe&sensor=false
{"results" : [], "status" : "ZERO_RESULTS"}
And this
http://maps.google.com/maps/geo?q=Berri%27s%20Pizza%20Cafe&output=json
{
"name": "Berri's Pizza Cafe",
"Status": {
"code": 602,
"request": "geocode"
}
}
I assume this is a problem with Google Maps API (found a forum post saying this was an issue in the javascript API but was supposedly fixed there, probably not in this)
Does anyone have a workaround for this situation?
Thanks.
The issue is that you are attempting to geocode a business name; the geocoder works with postal addresses. Omitting the apostrophe doesn't get any results either (thus proving it's not the apostrophe which is the problem).
Note that the Maps geocoder is far more sophisticated and uses a variety of data sources to locate targets, including address geolocation and business name lookup.
You may be able to find the data you're looking for using the Places API (but you will need to specify the city which you are currently omitting).