PMassicotte / gtrendsR

R functions to perform and display Google Trends queries
354 stars 112 forks source link

Compare more than five countries, compare multiple countries and multiple topics, get long timeperiods in smaller time resolution #413

Open mjohli opened 2 years ago

mjohli commented 2 years ago

Hi there, thank you so much for the awesome package, it is really useful for me. When working with it I came to the restriction (coming from google trends, not from your package) that one can only compare five countries at once, one has to decide if one wants to compare multiple countries or multiple topics, both at once is not possible, and that the longer the timeperiod looked at, the more coarse-grained the time resolution gets. I started writing a function solving these issues and it seems to work. Are there any reasons (e.g., legal concerns, ...) that this could not be implemented? If yes, let me know, if no I'd be happy to contribute these functions and make a PR.

JBleher commented 2 years ago

Dear mjohli, have a look at our paper. See https://doi.org/10.1016/j.ecosta.2021.10.006. One can get around the restrictions by downloading a comparison. Best regards, J

mjohli commented 2 years ago

Dear J, Thank you so much for pointing me to that paper. My approach is actually quite similar to yours but your paper showed me quite well how I could improve my function. My original question was rather why a ready-to-use function to get data beyond the restrictions (e.g., as the algorithm you describe in your paper) is not implemented in the gtrendsR package. Since I am currently writing these functions for a project, I thought it would be a good idea to provide them for others and I would be more than happy to contribute them to your awesome package. Kind regards, mjohli

JBleher commented 2 years ago

Dear mjohli, This is a great idea. I have already written these functions as referenced in the paper. Feel free to improve them... They are not part of gtrendsR though. See here. The problem in my opinion is: The number of queries becomes large quickly when you'd like to use smaller time intervals. Therefore, I do not think it is wise to add these functions to GTrends as standard functionality. In my opinion, users should need to figure out how to set the number of queries they submit during a given time interval in accordance to Google's rate limits (which are unknown to me and have changed over time). Giving users in a standard function the possibility to flood the GTrends website with queries, will result in users complaining about errors everytime Google changes the rate limits. It might also be a violation of Google's Terms of Service... I am not a lawyer, in the Terms of Use Google has the rule "don’t abuse, harm, interfere with, or disrupt the services — for example, by [...] bypassing our systems or protective measures [...]". Again, I am not a lawyer, rate limits, possibly, might be understood as such a system. So, I would recommend to handle the issue with care and within the boundaries of Google's Terms of Use...