Add place via Google Place API WEB Service with opening hours - google-maps

Is it possible to add new place with opening hours via Google Places API Web Service?
I can't find any information about it.
https://developers.google.com/places/web-service/add-place
Thank you in advance

Sorry, no. You can't provide opening hours in Add Place requests to the Google Places API.
Depending on what you need to do, you could try adding the place manually via https://google.com/maps (click "Send feedback" then "Add a missing place").

I think it is not possible. As you can see in this document, these are the only information that you can place in the body.
accuracy — The accuracy of the location signal on which this request is based, expressed in meters.
address (recommended, to improve chances of passing moderation) — The address of the place you wish to add. If a place has a well-formatted, human-readable address, it is more likely to pass the moderation process for inclusion in the Google Maps database.
language — The language in which the place's name is being reported. See the list of supported languages and their codes. Note that we often update supported languages so this list may not be exhaustive.
location (required) — The geographical location, specified as latitude and longitude values, of the place you want to add.
name (required) — The full text name of the place. Limited to 255 characters.
phone_number (recommended, to improve chances of passing moderation) — The phone number associated with the place. If a place has a well-formatted phone number, it is more likely to pass the moderation process for inclusion in the Google Maps database.
types (required) — The category in which this place belongs. While types takes an array, only one type can currently be specified for a place. XML requests require a single <type> element. See the list of supported types for more information. If none of the supported types are a match for this place, you may specify other.
Hope this helps!

Related

Google Place Autocomplete API showing invalid address

We are currently trying the Google places autocomplete api, but it seems as though Google places autocomplete api also returns invalid (non existent) addresses in the search result.
We want to receive only valid / actual addresses when the user types in the address autocomplete, is there a way to do it?
I searched the api docs but couldn't find anything much helpful.
There is a google places validation api but it only validates after given a single address, but we want to show only valid/actual addresses on search autocomplete and also don't want to call validation api for each of the search result items.
Went through official doc and also experimented several stackoverflow answers but those didn't match our requirements.
SO ref-1
This is Working as Intended as of now
I tried reproducing the Autocomplete request using this:
https://maps.googleapis.com/maps/api/place/autocomplete/json?input=332%20Kennedy%20drive,%20Torrington,%20CT&types=address&key=API_KEY
And the results returned has a long Place ID.
According to the Places API documentation:
"Place IDs uniquely identify a place in the Google Places database and on Google Maps."
The documentation also says that the API may return a different place ID in the response. These place ID types include:
Street addresses that do not exist in Google Maps as precise addresses, but are inferred from a range of addresses.
Segments of a long route, where the request also specifies a city or locality.
Intersections.
Places with an address component of type subpremise.
These IDs often take the form of a long string.
This explains why the API still returned a street address for the input =332 Kennedy drive, Torrington, CT using types=address. The use case of autocomplete is to help the users obtain the closest result even if they are requesting an ambiguous query. So the Autocomplete always tries to return the closest result to their input and types. In your case, it returned a street addresses that do not exist in Google Maps as precise addresses, but are inferred from a range of addresses.
There's a public bug on the issue tracker that is somehow related to this. On the comment #5, it says that:
Suggestions are sometimes created for addresses that may not exist, if there are chances that they do.
Retrieving details for such suggestions may result in the suggested address, if it actually exists or can be synthesized from existing data. Otherwise, the result may be a different address, one that actually exists.
Possible workaround
One thing you can do is to use the validation API.
But since you mentioned that you don't want to use it, I tried the Autocomplete request using this:
https://maps.googleapis.com/maps/api/place/autocomplete/json?input=332%20Kennedy%20drive,%20Torrington,%20CT&types=establishment&key=API_KEY
I just changed the types=address to types=establishment and it seems to return legit addresses. I'm not sure if this would fit on your use case, so you can just comment down if it does not.
And if it does not, I found a similar public bug on the issue tracker which says that similar issues like these are currently being worked on by the Google engineers internally. So what I would advise you to do wait for on update from this public bug.
There's no definite timeline on how long this will be fixed, but you can star it to be notified whenever there's an update.
Hope this helps!
== UPDATE ==
I tried playing around with the types and got to a point where I tried putting an array of types from this table. I tried this:
https://maps.googleapis.com/maps/api/place/autocomplete/json?input=332%20Kennedy%20drive,%20Torrington,%20CT&types=street_address|street_number|premise&key=API_KEY
and it did return some real addresses. I changed the types=address to types=street_address|street_number|premise. You could try it out yourself and play around with the types and see if it works for your use case.
for more information about types, here's a link to the documentation.

How can I create links Google Maps that either use the place name in the query (for known places) or just the address otherwise?

I am creating links to Google Maps for a large number of locations using this URL pattern:
https://www.google.com/maps?q=[query]
In many cases, Google knows that the particular business exists at that location. In those cases, I want to include the place/business name in the query so the resulting map shows additional information about the business (e.g. name, phone numbers, site URL, office hours, etc.). For example:
https://maps.google.com/?q=Child+Guidance+Center,+Inc.+525+Cabrillo+Park+Dr+#300+Santa+Ana,+CA+92701
But, if the place isn't known, including the business name in the query prevents the map from adding a marker to the correct address. For example:
https://maps.google.com/?q=Awesome+Paint+527+Cabrillo+Park+Dr+Santa+Ana,+CA+92701
It can cause the map to be totally zoomed out, or focus on a competing business with a somewhat similar name in the same general area.
How can I make this work better? I would like the map pin to always go in the correct location for the address I specify. If the business name I provide is known to Google at that address, then I'd like the nice panel of extra information. If it is not known, I just want the pin.
Thank you.
This similar question is asking about creating embedded maps, which is a slightly different case Google map to show name of location if found, otherwise just the address. I'd prefer to avoid extensive use of the APIs because I'm worried about exceeding the free limit, but more generally geocoding the address that worked above (Child+Guidance+Center,+Inc.+525+Cabrillo+Park+Dr+#300+Santa+Ana,+CA+92701) returns zero results like so:
http://maps.googleapis.com/maps/api/geocode/json?address=Child+Guidance+Center,+Inc.+525+Cabrillo+Park+Dr+#300+Santa+Ana,+CA+92701

Google maps api and cross locale city search

i have a website where people can buy/sell services in different cities.
I use google maps api v3, autocomplete and searchbox elements, to let them choose a city, store it in the db, and search against the db when they're buying.
Problem is, google searches are localized, so when a user looks for the same city in a different locale they won't find any match in my DB.
My solution would be to map each city to a code (much like yahoo's WOEID) and store that into my db, this way cross locale search would be ok, but i couldn't find anything like it in google maps api reference.
So, is there a way to keep using google maps, do i have to switch to yahoo, or is there another solution to cross locale searches i'm not aware of??
Thank you
Dario
If using the Places library, a search returns a PlaceResult object that has two properties that can help you:
id contains a unique identifier denoting this place. This identifier may not be used to retrieve information about this place, but can be used to consolidate data about this Place, and to verify the identity of a Place across separate searches. As ids can occasionally change, it's recommended that the stored id for a Place be compared with the id returned in later Details requests for the same Place, and updated if necessary.
reference contains a token that can be used to query the Details service in future. This token may differ from the reference used in the request to the Details service. It is recommended that stored references for Places be regularly updated. Although this token uniquely identifies the Place, the converse is not true: a Place may have many valid reference tokens.
Documentation reference
Edit:
Note: The id and reference fields are deprecated as of June 24, 2014. They are replaced by the new place ID, a unique identifier that can be used to reference specific places. The Places service in the Google Maps JavaScript API currently returns a place_id in all responses, and accepts a placeId in the Place Details request. Soon after June 24, 2015, the service will stop returning the id and reference fields in responses. Some time later, the service will no longer accept the reference in requests. We recommend that you update your code to use the new place ID instead of id and reference as soon as possible.

Google Places Autocomplete API flow

I want to use Google Places Autocomplete API to provide search-while-typing for an Android app.
the Autocomplete API returns IDs and References, requiring an iteration through the results to get the details (such as name and geometry) for each place, this is slow and results in a bad user experience. also, many API calls are done for each key press.
is there a better way to provide such searching capability with Google Places ?
Is there a reason you need to have the geometry for each possible autocomplete place after each keypress of the API? Showing this seems like generally it would not be a great user experience, and is not what the Autocomplete API was designed for.
In theory the name (description) should be enough for the user to decide which item they're interested in, and then after a user has actually selected something you can request additional details as needed.
On the other hand if you already have some information about the name of the place, you could use the Places API (not Autocomplete) to get additional details of matching nearby places:
https://developers.google.com/maps/documentation/places/#PlaceSearchResponses

Will Google Places Autocomplete return places my app has added via place report?

I am looking to find out if Google Places Autocomplete should return results including my submitted places.
I have submitted a place to the Place Report endpoint, and got an
id and ref back.
I then want my users to be able to select that
place from an autocomplete box - along with all the other results.
I have added the browser API key to the Javascript src.
Is this how it's designed to work, 'cos it's not working like that at the moment - or am I being impatient / doing something wrong.
I have verified my Place has been added by calling up the details using the reference it returned when I added it...
Your Place Reports are supposed to be available immediately to your application, but they must pass through a Google moderation process before they become generally available to all users. From the User Place Reports section of the Google Places API Docs:
Place Report requests are used to add new Places, or delete existing
ones. New Places will be available immediately in Place Searches
initiated by your application, and will enter the moderation queue to
be considered for Google Maps. A newly-added Place will not be
available to other applications until it has been approved by the
moderation process.
It isn't clear from your question exactly how you performed your Place Report, so I assumed you had used the Google Places API.
Some additional info, based on your comment:
It makes sense that you can see the place you have added using the Places API, but that it doesn't appear when using Autocomplete. The Places API is designed to be very thorough (and of course, the new place was added by your application), while the Autocomplete is focused on being high-speed, low-latency, and is based almost entirely on how Google rates the prominence of nearby places. Assuming the newly added place has not yet had many clicks, ratings, etc. on maps.google.com, it makes sense that it will not yet rate very highly in prominence.
There is some very good information about the differences between the Autocomplete tool and the general Places API in the Autocomplete Demo & Places API Demo & Discussion Video, given by Paul Saxman, a Developer Advocate at Google and Marcelo Camelo, Google's Technical Lead for the Places API. There is a portion near the end where they discuss adding new places and I think it will help clarify the results you are seeing. Anyway, I hope it helps -