PMassicotte / gtrendsR

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

inconsistencies with pulling data automatically #452

Closed lukschue closed 10 months ago

lukschue commented 10 months ago

Hello everyone,

I currently run several schedulers on an external server with taskscheduleR to gather daily gtrends data. Unfortunately, every once in a while some gtrendsR schedules did not work. All my scripts look like the following:

`library(gtrendsR)

gtrends <- gtrends( keyword = c("keyword"), geo = "US",
time = "now 1-d",
gprop = "web",
category = 0,
hl = "en",
compared_breakdown = FALSE, low_search_volume = FALSE, tz = 0, onlyInterest = TRUE )

timestamp <- format(Sys.time(), "%d-%m-%Y") file_name <- paste0("gtrends_daily", timestamp, ".rds") file_path <- "path/to/file" saveRDS(gtrends, file = file.path(file_path, file_name))`

Has anyone experienced something similar?

P.S. I am not specifically refer to the time described in #451 . I think everyone had trouble using gtrendsR then.

PMassicotte commented 10 months ago

This seems to work fine on my side:

plot(gtrendsR::gtrends(keyword = c("keyword"), geo = "US", time = "now 1-d", 
    gprop = "web", category = 0, hl = "en", compared_breakdown = FALSE, 
    low_search_volume = FALSE, tz = 0, onlyInterest = TRUE))

Created on 2023-08-22 with reprex v2.0.2

MattCowgill commented 10 months ago

@PMassicotte's code works fine for me too