Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Combine Places Autocomplete and The Google Time Zone API

I need an api like the Places Autocomplete but with the place timezone in the response. I could use the Places Autocomplete api, to get the place reference from the response, than the Place Details api to get the longitude and latitude and finally the Google Time Zone API to get the place timezone. Can I do this with a single HTTP call?

like image 273
user2298916 Avatar asked Apr 19 '13 11:04

user2298916


People also ask

Is Google API free timezone?

The Time Zone API uses a pay-as-you-go pricing model. Requests for the Time Zone are billed under the SKU for Time Zone. Along with the overall Google Terms of Use, there are usage limits specific to the Time Zone API.

Is Google address autocomplete API free?

First of all, the new Google Place Autocomplete API is not free (after exceeding the US$200 monthly credit equivalent free usage). Now coming to the pricing, Google has introduced three possible pricing criteria: Autocomplete without Places Details – Per Session. Autocomplete (included with Places Details) – Per ...


1 Answers

If you just need the current UTC offset so you can tell what time it is at that place, you will usually find it in the results from the Details API. From the documentation:

utc_offset contains the number of minutes this Place’s current timezone is offset from UTC. For example, for Places in Sydney, Australia during daylight saving time this would be 660 (+11 hours from UTC), and for Places in California outside of daylight saving time this would be -480 (-8 hours from UTC).

However, as some have commented, and as discussed here, the place details API does not always return the time zone offset.

If it is not returned, or when you need the full IANA/Olson time zone id for the location, you will need to call the Time Zone API as you described.

You may also be interested in one of the other methods to obtaining a time zone from a location, which are listed here.

like image 82
Matt Johnson-Pint Avatar answered Nov 03 '22 10:11

Matt Johnson-Pint