qpowell / google_places

A Ruby wrapper around the Google Places API
MIT License
382 stars 188 forks source link

detail: true #114

Closed hmontazeri closed 6 years ago

hmontazeri commented 6 years ago

Hi,

first of all, thank you for the wrapper. Appreciate your work.

I have a question regarding the documentation:

This option should be used with care, as it adds an additional API call for EACH spot in the collection. E.g. a spots collection of 100 spots will use 101 API calls when the detail: true option is set.

Shouldn't that be 200 API calls then? List of 100 spots. EACH spot an extra call for the details, makes 200 calls, right?

edwinwills commented 6 years ago

Thanks for the question! It's 101 API calls, as we can get a collection of all the non-detailed spot results with just 1 API call, and then to get the extra details, we need to make an additional API call per spot. So (1 * number_of_spots) + 1 for the non-detailed collection.

hmontazeri commented 6 years ago

OK! Got it, thank you!