PMassicotte / gtrendsR

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

res$status_code == 200 is not TRUE #254

Closed AndRosis closed 6 years ago

AndRosis commented 6 years ago

I have error message "res$status_code == 200 is not TRUE" since yesterday ... 2 days ago everything was OK... I've changed network and IP address (to reset potential quota problems) - no effect.

Fragment of my code:

install.packages("devtools") devtools::install_github("PMassicotte/gtrendsR") install.packages("httr") install.packages("lubridate") library("httr") library("gtrendsR") seriale_weekly_combo = gtrends(c("TVN"), geo = "PL", time = "2016-01-01 2017-12-31")$interest_over_time

PMassicotte commented 6 years ago

Please see other issue before posting. #252

mfcava commented 4 years ago

Problem is back

deanfantazzini commented 4 years ago

Unfortunately, I confirm the same error has started to appear in the last 24 hours. I tried myself and several colleagues in Europe and in Russia, with different platforms, but the error is the same:

Error in FUN(X[[i]], ...) : Status code was not 200. Returned status code:401

For example, this is my session info,

sessionInfo() R version 4.0.0 (2020-04-24) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 10 x64 (build 16299)

Matrix products: default

locale: [1] LC_COLLATE=Russian_Russia.1251 LC_CTYPE=Russian_Russia.1251 LC_MONETARY=Russian_Russia.1251 LC_NUMERIC=C [5] LC_TIME=Russian_Russia.1251

attached base packages: [1] stats graphics grDevices utils datasets methods base

other attached packages: [1] rio_0.5.16 gtrendsR_1.4.4.9000 lubridate_1.7.8 forcats_0.5.0 stringr_1.4.0 dplyr_0.8.5 purrr_0.3.4 [8] readr_1.3.1 tidyr_1.0.2 tibble_3.0.1 ggplot2_3.3.0 tidyverse_1.3.0

loaded via a namespace (and not attached): [1] Rcpp_1.0.4.6 lattice_0.20-41 zoo_1.8-7 prettyunits_1.1.1 ps_1.3.2 assertthat_0.2.1 rprojroot_1.3-2 [8] digest_0.6.25 R6_2.4.1 cellranger_1.1.0 backports_1.1.6 reprex_0.3.0 httr_1.4.1 pillar_1.4.4 [15] rlang_0.4.5 curl_4.3 readxl_1.3.1 data.table_1.12.8 rstudioapi_0.11 callr_3.4.3 desc_1.2.0 [22] devtools_2.3.0 foreign_0.8-78 munsell_0.5.0 broom_0.5.6 compiler_4.0.0 modelr_0.1.7 pkgconfig_2.0.3 [29] pkgbuild_1.0.7 tidyselect_1.0.0 fansi_0.4.1 crayon_1.3.4 dbplyr_1.4.3 withr_2.2.0 grid_4.0.0 [36] nlme_3.1-147 jsonlite_1.6.1 gtable_0.3.0 lifecycle_0.2.0 DBI_1.1.0 magrittr_1.5 scales_1.1.0 [43] zip_2.0.4 cli_2.0.2 stringi_1.4.6 fs_1.4.1 remotes_2.1.1 testthat_2.3.2 xml2_1.3.2 [50] ellipsis_0.3.0 generics_0.0.2 vctrs_0.2.4 openxlsx_4.1.4 tools_4.0.0 glue_1.4.0 hms_0.5.3 [57] processx_3.4.2 pkgload_1.0.2 colorspace_1.4-1 sessioninfo_1.1.1 rvest_0.3.5 memoise_1.1.0 haven_2.2.0 [64] usethis_1.6.1

while this is the sessionInfo of a colleague of mine in Italy:

sessionInfo() R version 3.6.3 (2020-02-29) Platform: x86_64-apple-darwin15.6.0 (64-bit) Running under: macOS Catalina 10.15.4

Matrix products: default BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib LAPACK: /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libRlapack.dylib

locale: [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages: [1] stats graphics grDevices utils datasets methods base

other attached packages: [1] gtrendsR_1.4.4

loaded via a namespace (and not attached): [1] Rcpp_1.0.3 assertthat_0.2.1 dplyr_0.8.4 crayon_1.3.4 grid_3.6.3 R6_2.4.1 jsonlite_1.6.1 [8] lifecycle_0.1.0 gtable_0.3.0 magrittr_1.5 scales_1.1.0 ggplot2_3.2.1 pillar_1.4.3 rlang_0.4.4 [15] curl_4.3 lazyeval_0.2.2 rstudioapi_0.11 tools_3.6.3 glue_1.3.1 purrr_0.3.3 munsell_0.5.0 [22] compiler_3.6.3 pkgconfig_2.0.3 colorspace_1.4-1 tidyselect_1.0.0 tibble_2.1.3

As you see, very different platforms but with the same errors. Have Google changed the API again?

Thanks for your attention.

croxycraxer commented 4 years ago

Have the same issue!

guaribr commented 4 years ago

I have the same issue.

JBleher commented 4 years ago

@guaribr @croxycraxer @deanfantazzini Do you have the issue when you use the Paramter onlyInterest=TRUE?

guaribr commented 4 years ago

No, but I only get the trends data.

Bruno Guarita Em 6/05/2020, 11:58 +0100, JBleher notifications@github.com, escreveu:

@guaribr @croxycraxer @deanfantazzini Do you have the issue when you use the Paramter onlyInterest=TRUE? — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

JBleher commented 4 years ago

Yes. Then it is the same error. The function related_topics doesn't work anymore... this needs fixing.

deanfantazzini commented 4 years ago

Yes, it works, thanks.

P.S. Of course, if a user needs all the other information reported by Google Trends this is clearly not sufficient. (I am lucky that I need only the data about interest over time )

PMassicotte commented 4 years ago

This has been solved. Please use the dev version for now until the new version is on CRAN. @eddelbuettel, are you ok with releasing it?

guaribr commented 4 years ago

Thanks PMassicotte! Your library is helping me a lot on my daily work. Thanks +++

Bruno Guarita Em 6/05/2020, 13:46 +0100, Philippe Massicotte notifications@github.com, escreveu:

This has been solved. Please use the dev version for now until the new version is on CRAN. @eddelbuettel, are you ok with releasing it? — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

eddelbuettel commented 4 years ago

Sure, if it passes tests and manages to fix a bug annoying scores of people what's not to love? ;-)

PMassicotte commented 4 years ago

@eddelbuettel Do you know why I have this error about data.table installation?

https://win-builder.r-project.org/645lT7f4wt68/00install.out

eddelbuettel commented 4 years ago

Looks like a temp snafu at CRAN? Maybe race condition with data.table being installed / upgraded?

Can you try RHub's windows builders?

PMassicotte commented 4 years ago

I have the same data.table error.

https://builder.r-hub.io/status/gtrendsR_1.4.4.9000.tar.gz-2c1d4d7d00484272b9ea2a1b07740387

Same also on Ubuntu 16.04:

https://builder.r-hub.io/status/gtrendsR_1.4.4.9000.tar.gz-f705fb9ed4224276b957e4926aad53cb

eddelbuettel commented 4 years ago

Looking at DESCRIPTION we see it is not listed.

"Computers still deterministic, News at 11pm" ;-)

PMassicotte commented 4 years ago

awww, it was never listed and build were ok? Thanks :)

eddelbuettel commented 4 years ago

I have no idea. I doubt it passed if it was used but not listed -- that is a key feature of R CMD check to find these mismatches, and has been there a loooong time.

I don't follow the package that closely as @JBleher can be trusted to duct tape^Hre-engineer whatever Google breaks so it is really between you and him.

JBleher commented 4 years ago

I don't understand. Have I broken something with the last PR ?

croxycraxer commented 4 years ago

Thanks! That was fast!

PMassicotte commented 4 years ago

@JBleher It as on my side. Everything is fine now.

guaribr commented 4 years ago

I've just reinstalled gtrendsR and it works. Thanks+

awoldemichael commented 4 years ago

Works fine for me as well. Thanks @PMassicotte and @JBleher

mfcava commented 4 years ago

Works also for me!