PMassicotte / gtrendsR

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

Can not get any data #458

Open rezar362 opened 3 months ago

rezar362 commented 3 months ago

It seems like, the package is broken any attempt to get data shows the error code 429

Error in interest_over_time(widget, comparison_item, tz) : Status code was not 200. Returned status code:429

eddelbuettel commented 3 months ago

Have a look at the currently open issues -- your is almost surely a duplicate, and cannot be reproduced as you did not include sample data.

rezar362 commented 3 months ago

Thanks a lot for checking the issue. Here is the sessionInfo: sessionInfo() R version 4.3.3 (2024-02-29) Platform: x86_64-apple-darwin20 (64-bit) Running under: macOS Monterey 12.5.1

Matrix products: default BLAS: /Library/Frameworks/R.framework/Versions/4.3-x86_64/Resources/lib/libRblas.0.dylib LAPACK: /Library/Frameworks/R.framework/Versions/4.3-x86_64/Resources/lib/libRlapack.dylib; LAPACK version 3.11.0

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

time zone: America/Los_Angeles tzcode source: internal

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

other attached packages: [1] gtrendsR_1.5.1

loaded via a namespace (and not attached): [1] utf8_1.2.4 R6_2.5.1 magrittr_2.0.3 gtable_0.3.4
[5] glue_1.7.0 tibble_3.2.1 pkgconfig_2.0.3 lifecycle_1.0.4 [9] ggplot2_3.5.0 cli_3.6.2 fansi_1.0.6 scales_1.3.0
[13] grid_4.3.3 vctrs_0.6.5 compiler_4.3.3 curl_5.2.1
[17] munsell_0.5.0 pillar_1.9.0 Rcpp_1.0.12 anytime_0.3.9
[21] colorspace_2.1-0 jsonlite_1.8.8 rlang_1.1.3

I have also tried this on AWS with no luck. Example: library('gtrendsR') gtrends('Musk', time= "2009-01-01 2024-02-29", onlyInterest=TRUE)

Error in interest_over_time(widget, comparison_item, tz) : Status code was not 200. Returned status code:429

429 code is indicator of the too many requests, while this is a fresh install with just few queries that none is working.

I can use the browser and pull the data, but unable to get it from the API:

https://trends.google.com/trends/explore?date=2009-02-19%202024-03-19&q=Musk&hl=en

jonathanhansen808 commented 1 month ago

Facing this issue now, but was fine a month ago. Running my code 20 times to get one result... Checked pyTrends issues and lots of info there - https://github.com/GeneralMills/pytrends/issues/614 https://github.com/GeneralMills/pytrends/issues/618

Looks to be people trying to reverse engineer it too, with no known work arounds, so hopefully something will come out of it - https://github.com/GeneralMills/pytrends/issues/619

PMassicotte commented 1 month ago

Thanks for sharing, please let us know if you see any solution we could implement.

jonathanhansen808 commented 1 month ago

Will do, thanks for all you do

pricerices commented 1 month ago

Could anyone learn from Domtrens and SerpApi to implement it in gtrendsr? The scrapping is still working there..