LuanRT / google-this

A simple yet powerful module to retrieve organic search results and much more from Google.

Home Page:https://www.npmjs.com/package/googlethis

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error: Could not search on Google: Request failed with status code 429

GeistFighter opened this issue · comments

Hey everyone,

Why i get "Error: Could not search on Google: Request failed with status code 429".

When i user the exemple code:

async function start() {
const options = {
page: 0,
safe: false, // hide explicit results?
additional_params: {
// add additional parameters here, see https://moz.com/blog/the-ultimate-guide-to-the-google-search-parameters and https://www.seoquake.com/blog/google-search-param/
hl: 'en'
}
}

const response = await google.search("TWDG", options);
console.log(response);
}

start();

commented

Hello, status code 429 means you are being rate-limited by Google. If this is the first time you're using the library and got that right away then I assume Google might be blocking your IP address for some reason (Eg: maybe your IP is shared), in that case switching to a different IP will most likely fix the problem.

Hello, it's really strange, indeed it's the first time I use your package, nevertheless my IP is dedicated, it doesn't seem to be banned from google I can reach my website from google for example.

You will have a manipulation to make to deepen the research of the "why"?

I just tested with another package (not as well supplied as yours) but it works, so it must come from google-this.

Now it works, I don't know why.

commented

Now it works, I don't know why.

Hello, so I've done a little testing on some remote servers and it seems to work fine even after spamming requests to the Google website. I feel like Google might have temporarily blocked incoming requests from your server's IP, if that happens again you can either wait or just change your server's IP address if possible.

Edit:
And apologies for the delayed response.

commented

It keeps prompting 429, and changing the IP cannot solve it. Testing with curl is not affected and works fine.