Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Status code was not 200. Returned status code:429 #436

Closed
ReemOmer opened this issue Nov 7, 2022 · 3 comments
Closed

Status code was not 200. Returned status code:429 #436

ReemOmer opened this issue Nov 7, 2022 · 3 comments

Comments

@ReemOmer
Copy link

ReemOmer commented Nov 7, 2022

I am trying to collect trends data for more than 5 keywords following the suggested solution on this tutorial. However, I can't get all the data due to this error:
__Error_ in FUN(X[[i]], ...) : Status code was not 200. Returned status code:429_

Here is the part that generates the error:

install.packages("readr")
install.packages("colorspace")
install.packages("vctrs")
install.packages("gtrendsR")
library(gtrendsR)
keywords <- c("X", "Y", "Z", "A", "B")
country <- c("US")
time <- ("2019-10-31 2022-10-31")
trends <- gtrends(keywords, geo = country, time = time)
@gittybobomber
Copy link

same error,
with code that used to work at least a couple of weeks ago.

@PMassicotte
Copy link
Owner

You should search opened issues: #431

As @ReemOmer already commented for the same issue with pytrends (GeneralMills/pytrends#538), this is related to how Google block requests after a while. Please check what is 429 error is about: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429.

Google Trends do not offer a proper API, gtrendsR and pytrends are just "hacking" it to retrieve data. We do not have control on how many requests one can perform.

@ReemOmer
Copy link
Author

ReemOmer commented Nov 8, 2022

It's me actually 😅 and wanted to know if there are any workarounds in gtrendsR. Thanks

@ReemOmer ReemOmer closed this as completed Nov 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants