r-nikhil / pygoogle

A simple Google search module for Python
16 stars 7 forks source link

Error: "The Google Web Search API is no longer available" #9

Open wkevils opened 8 years ago

wkevils commented 8 years ago

Running the script in the example: from pygoogle import pygoogle g = pygoogle('quake 3 arena') g.pages = 5 print 'Found %s results'%(g.get_result_count()) Gives the following error: pygoogle ERROR search| responseDetails : The Google Web Search API is no longer available. Please migrate to the Google Custom Search API (https://developers.google.com/custom-search/) Found 0 results

r-nikhil commented 8 years ago

It seems like the Ajax api used in the module is deprecated. I am little busy now and I can migrate it to the new api in sometime. PR's are gladly welcome in the meanwhile. :)

r-nikhil commented 8 years ago

I think the API to be migrated to is https://developers.google.com/custom-search/json-api/v1/overview#data_format

The current version of the module does not need an API key for working because the Ajax api was free and unlimited to everyone.

This new custom search API has a limit on number of requests per day (around 100) making this useless to be used in production unless the developer buys the paid version and changes the API key accordingly.

Also, if a new developer wants to use the updated module, he/she has to first create a custom search engine in the Google developer console, then obtain the API key from there.

All this makes it too cumbersome and pointless for the module which was supposed to help you search google from the command line easily without worrying about other things.

al-hassan-cse commented 6 years ago

How to use this api please help me.