Storing Data from Google Places API

Please don't mind if this question sounds a little silly!

I am trying to learn more about Google Places API. I am interested in doing 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 autosuggest feature provided by Google Places API for filling the city, region and country (eg https://www.airbnb.com/rooms/new)

Questions

1) Once someone selects a Place in the "City" field, what exactly are we allowed to store in ourdatabase from the fetched Google data? Can we store the city name, its region, its country, co-ordinates, etc in our database?

2) What about URLs? When browsing for rooms, the URLs generated on airbnb site are of the format 'CITY--REGION' (eg www.airbnb.com /s/Auckland--New-Zealand)

We would like to do something similar. For this too, wouldn't we need to store a unique url (based on some formula) for each fetched Place?

3) In our project, we would even like to generate breadcrumbs. eg You are here: Oceania > New Zealand > Otago > Queenstown

When we fetch a city, can we store its region and administrative areas?

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

Any database schemas of such similar sites would be truly appreciated!

Thanks!


  • I've read pretty much all of Places API's documentation and I have never once seen restrictions on what and what not you are allowed to store in a database. I would however recommend just storing the locations "reference" ID and just getting the details view HTTP every time so if a location's info changes, you are kept up-to-date.

  • Of course you can do that, Google doesn't own country names :P

  • Again, I would recommend storing the reference and accessing the location that way.

  • A Place only has one ID. When you get the details of a place that ID will be returned every time. A reference, however, varies with each request. You cannot use an ID to get details about a Place but you can use a reference. An ID is useful for comparing places to see if they are the same as a location only has one ID.

  • Keep the storage as light as possible. Keep only Place references and maybe IDs.


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

    Save place IDs for later use

    Place IDs are exempt from the caching restrictions stated in Section 10.1.3 of the Google Maps APIs Terms of Service. You can therefore store place ID values indefinitely.

    This supports the answer given by Windwaker, that the place ID is the right, and only legal thing you may store permanently.


    I just found this question and although it's a bit late, maybe this answer can help some person looking for the policies.

    Google Places API only allows you to store the unique place id. Therefore you are not allowed to store URLs, photos or anything in your database. But you can store their place ids and the next time you need the data you can fetch it by making a place detail search.

    链接地址: http://www.djcxy.com/p/63164.html

    上一篇: 使用谷歌地方api like airbnb

    下一篇: 从Google Places API存储数据