Saving data from the Google Places API

Please do not mind if this question sounds a little silly!

I'm trying to learn more about the Google Places API. I'm interested in an implementation similar to airbnb.com (check the search function at the top, it shows "powered by google" in autosuggest).

In our address form, we planned to use the autoplay function provided by the Google Places API to fill in the city, region and country (for example, https://www.airbnb.com/rooms/new )

Questions

1) When someone selects a place in the "City" field, what exactly are we allowed to store in our database from the selected Google data? Can we keep the name of the city, its region, country, coordinates, etc. In our database?

2) What about the urls? When viewing numbers, the URLs created on the airbnb website are in the CITY-REGION format (for example, www.airbnb.com/s/Auckland - New-Zealand).

We would like to do something similar. For this, too, do we need to store a unique URL (based on some formula) for each selected location?

3) In our project, we would even like to create breadcrumbs. for example you are here: Oceania> New Zealand> Otago> Queenstown

When we take a city, can we save its region and administrative areas?

4) What is a unique identifier for any Google Place, whether it is an identifier or a link, it is not too clear from the documentation https://developers.google.com/maps/documentation/javascript/places#place_details_results

Any database schemes of such sites will be truly appreciated!

Thanks!

+7
google-places-api geocoding
source share
3 answers
  • I read almost all of the Places API documentation, and I have never seen restrictions on what and what you are not allowed to store in the database. However, I would recommend just storing the reference identifier "reference" and just getting the HTTP viewing information every time, so if the location information changes, you are constantly updated.

  • Of course you can do this, Google does not own the names of the countries: P

  • Again, I would recommend storing the link and accessing the location this way.

  • A place has only one identifier. When you receive information about the place where the ID will be returned every time. However, with each request, the link changes. You cannot use the identifier to get information about the place, but you can use the link. An identifier is useful for comparing places to see if they match a location with only one identifier.

Keep as much light as possible. Keep only links to the place and possibly identifiers.

+1
source share

You can find here: https://developers.google.com/places/place-id#find-id

Save location IDs for future reference

Location identifiers are exempt from the cache restrictions specified in Section 10.1.3 of the Google Maps API Terms of Use. Therefore, you can store location id values โ€‹โ€‹indefinitely.

This supports the answer given by Windwaker that the place identifier is correct, and only a legal thing that you can keep forever.

+1
source share

I just found this question, and although it's a bit late, maybe this answer can help someone who is looking for politics.

The Google Places API allows you to store a unique place identifier. Therefore, you are not allowed to store URLs, photos, or anything in your database. But you can save their place identifiers the next time you need data that you can get by doing a detailed search .

0
source share

All Articles