google-it
google-it copied to clipboard
Error in response: statusCode 429
Version of google-it 1.6.1
Versions of npm and node npm - 6.14.6 node - v12.18.4
Describe the bug
I was using this module in a NodeJS project (discord.js specifically) and I faced this error:
Error in response: statusCode 429. To see the raw response object, please include the 'diagnostics: true' as part of the options object (or -d if using command line)
Expected behavior It should have given me results according to the query specified but it didn't.
Additional context I also enabled the "diagnostics" to see the raw data but it didn't gave me anything. Hope this info is alright for the info.
Hi @Rachniotov, the 429 status code represents Too Many Requests. Do you happen to remember if you saw that error after creating a lot of searches within a limited span of time? This is something I haven't experimented with yet, but possibly one way to enhance this library to avoid seeing that error can be to use a different default user agent whenever encountering that 429 status code response. As an attempt to mimic a different user and hopefully bypass Google's bot detection.
Ah I see, I'll limit the requests for now. Also when I tested it now, it sends the data in French, any way to fix it? or I just use proxy? Thanks for the help and a great package!!
Sorry for the delayed response again. Not sure why the data is coming back in French - do you happen to be in a French-speaking country, or are you using google-it on a remote machine that is located in a French-speaking country? Honestly not sure what effect the proxy option might have.
Yes I use a vps but I don't know the country. I am not sure what a proxy does, was just asking for help.
I encountered that same issue and solved it by adding the parameter 'gl' to the search. You can see how that parameter works here
I am seeing this issue on my first ever request with this package. It appears to run fine when run locally however when I run on a raspberry Pi it always gives this error. (Even if I haven't made a request with it for months!) Is there an issue with the OS used (as it does seem to have an effect)
after some struggle with the similar issue I have created an API server based on a fork of this library and published it to RapidAPI: https://rapidapi.com/restyler/api/google-search26 - it has some additional logic to try to extract time snippet to separate json field.