m-wrzr / populartimes

MIT License
815 stars 167 forks source link

Current Popularity? #91

Closed packdev122 closed 3 years ago

packdev122 commented 4 years ago

I've checked the source in detail and was very interested. This is very useful for my project. But I have one question. I see this: "The information present for places is highly varying. Therefore popularity, current_popularity, rating, rating_n, time_wait, time_spent and phone are optional return parameters and only present if available."

So if current_popularity is not available in the response, can I consider that it's not busy at all? I mean if current_popularity not there, the place(bar) is free of use and not busy.

Thanks

Porter97 commented 4 years ago

Not really. The current popularity rating is inconsistent in the fact that it will appear only for higher traffic businesses (where they can routinely tell the traffic, not infer it from average values), and may only appear at specific time when a few users with the Google Maps app are present at the location. Otherwise, Google will just defer to the average value instead. There's also times where Google will withhold the information from repeat requesters (such as scrapers like this), or have the information accessible only through an alternative means of requesting (that at this point aren't available through this package).

Long story short, trust the default average value if not overridden by the current popularity rating.

packdev122 commented 4 years ago

Noted. But I want to know how busy the place is at the moment. How can I check that with this?

Porter97 commented 4 years ago

You can do a request, if it returns a number in the current popularity field, use that figure, otherwise, select the localized date and time for that location (pytz and calendar python packages will help greatly) from the popular_times response field.

packdev122 commented 4 years ago

Thanks. And the popularity value is 0~100 right? How can i consider it as level? I mean the value range of not busy, little busy, busy, very busy .

Porter97 commented 4 years ago

That's kind of relative.

The busy-ness of a location would be dependent on how big the spot is and how many people go through it.

For the most part though you could just "bucket" the values, 0-25 as not busy, 25-50 as kinda busy and so on and so forth.

packdev122 commented 4 years ago

Noted. Also I can see those 24 values for every weekdays in populartimes. Are these 0~23 of the local timezone? I mean the timezone of the searched place.

Porter97 commented 4 years ago

Yep! Those values will be local to the location.

packdev122 commented 4 years ago

Oh great! Thanks for your immediate response