Nv7-GitHub / googlesearch

A Python library for scraping the Google search engine.
https://pypi.org/project/googlesearch-python/
MIT License
430 stars 110 forks source link

Does this library violate Google's Terms of Service? #21

Open markwilkinson opened 2 years ago

markwilkinson commented 2 years ago

Automated queries Google's Terms of Service don't allow the sending of automated queries of any sort to our system without express permission in advance from Google. Sending automated queries consumes resources and includes using any software (such as WebPosition Gold) that sends automated queries to Google to determine how a website or web page ranks in Google search results for various queries. In addition to rank checking, other types of automated access to Google without permission are also a violation of our Webmaster Guidelines and Terms of Service.

https://developers.google.com/search/docs/advanced/guidelines/automated-queries

Themis3000 commented 2 years ago

https://support.google.com/websearch/answer/86640 defines an "automated query" as "Sending searches from a robot, computer program, automated service, or search scraper" or "Using software that sends searches to Google to see how a website or webpage ranks on Google".

The meaning of "Sending searches from a computer program" is quite ambiguous in my opinion. I'd personally interpret that to mean a search generated by a computer program given that it is necessary to use a computer program to search on google at all.

So I'd conclude that as long as all searches you make through this library are manually submitted by the user, it isn't against googles tos. Otherwise searches that aren't manually inputted or submitted would be against tos.

If you are looking to strictly abide by tos though, google has an official search api you should look at using. As far as I'm aware, it's the only way to make automated searching while abiding by the tos. It does however cost $5 per 1000 queries after your first 100 free queries in a day and require signup to google cloud. It does also limit you to 10k requests per day in total. If you're interested you can check it out at https://developers.google.com/custom-search/v1/overview

SaiKiru commented 1 month ago

Adding to this, multiple searches of the same query (even if by different users) will get your program flagged as a bot and return error 429. So it's best to just use their Custom Search API