Python Google API and Yahoo API Fun
January 9th, 2006 - 2 CommentsSo, I decided that I would take up learning Python while I was down in Mexico. I plowed through 150 pages or so while down there and thought that when I got back, I would try and get to working on a search tool for a project I am working on. Searching around for some Python modules for the Google API and Yahoo API, I found PyGoogle and pYsearch respectively. Without too much grief, I had Google API search queries going and soon after Yahoo API queries as well. Of course, being a noob, I did run into one hiccup with the pYsearch modules when trying to get the total number of results available, that kept me up until 1am (lucky, I know) before I threw in the towel.
In my afternoon/evening of learning Python, I found a good page with Python modules for everything from the Google and Yahoo APIs to Amazon AWS and more. Hopefully, I will get some work done today and not spend it pulling my hair out trying to get these queries to work. If you know your way around pYsearch, and can tell me how to get the total number of available results for a query, drop me a line.







[...] Update: Jason Golod has some Google API and Yahoo API links as well. [...]
Heh, I didn’t see this post until now, but I’m wondering what problems you might have had getting the number of search results. Something as simple as this would show that:
from yahoo.search.web import WebSearch
srch = WebSearch(app_id=”YahooDemon”)
srch.query = “Leif Hedstrom”
results = srch.parse_results()
print results.totalResultsAvailable
A little python tip: If you can’t figure out what methods / attributes a search object has, you can always print out dir() on the object, e.g. in the above, do
print dir(results)