0

my question has 2 parts.

1) I am using R to query Google Trends in order to get the data of a specific trend. For example, let's say that I want to query the trend of "call of Duty". I found that the library 'gtrendsR' does the trick.

library(gtrendsR) res <- gtrends("Call of Duty") plot(res)

The problem is, this gives me the trend of the 'search term' while i want the "Video game series' trend. enter image description here Can anybody tell me how I can specify that I want the 'Video game series' trend ?

2) If i want to automate this process and query the trends of many games i.e call of duty, red alert, generals, battlefield, overwatch and many more... Can i simply fill in an array of strings being the game names and query them using a loop or will querying the google trends site many times cause a problem ? If so, is there a way around that in order to automate the process?

Thank you very much for your help!

codastic
  • 333
  • 3
  • 7
  • look at the documentation - it says there is a category argument you can specify. I looked at the available categories and while there is no "Video game series" category, there are some other ones you could try out. Also please post a reproducible example - I couldn't run your code because "Error: No connection object has been created. Use 'gconnect()' first.". You have higher chances if you give a good example where people don't have to figure out half of the code themselves .. ;) – friep Jul 04 '17 at 11:31
  • Hello @friep, thank you for getting back to me. Using the new version of gtrendsr you do not need to connect using gconnect() (check https://github.com/PMassicotte/gtrendsR). The small script that I posted was enough to query back the data. Could you please tell me where I can found the documentation as I stumbled on a lot of documents and don't know which one is the official one :(. – codastic Jul 04 '17 at 11:43
  • ah ok. I just installed it from CRAN.. let me get back to you. you can find the manual usually by just googling someth. like "gtrends package R" and then click like the first or second hit. Anyway: https://cran.r-project.org/web/packages/gtrendsR/index.html under "reference manual". – friep Jul 04 '17 at 11:45
  • sorry, i get some other errors (related to the package) so I can't really try it out myself. I got the categories by doing `data("categories")` and then `categories`. Then you can filter the names for "Video" or something similar and take the corresponding id for the `cat` argument of gtrends – friep Jul 04 '17 at 11:50
  • It's weird @friep, event when you choose "all categories" in the category, when you download the csv file manually from the Call of Duty Video games series trend, and compare it with the results picked up by R, the csv file downloaded from the website has values greater to those picked up from R even though you set the search for all categories which should be the maximum number of hits for a given date. I'm sure they're is a way to specify exactly that I want the same values found on the "video game series" csv file, I just can't figure it out... – codastic Jul 04 '17 at 12:25
  • I'm sorry I can't help you out with that - seems to be related to the package (?) / the API. – friep Jul 04 '17 at 12:36

0 Answers0