Yahoo BOSS python api

By : lakshman

Yahoo has a search api with generous limits, BOSS. There are a few python apis around it. But we wanted a lighter api, and one which has the same interface as out Bing Python api. So here is the updated bingapi.(Now with as well). Or svn it from here


Usage is mostly compatible with bingapi

In [2]: from bingapi import bossapi

In [3]: api = bossapi.Boss('<appid>')

In [4]: api.do_web_search('Uswaretech')
Out[4]: ....

In [5]: api.do_news_search('salsa')
Out[5]: ...

In [6]: api.do_siteexplorer_search('')
Out[6]: .....

Related Posts

Can we help you build amazing apps? Contact us today.

Topics : API search yahoo


Tom Bateman 5th July, 2009

This is great. Does anybody know how to offset the results in the same way as Bing?


It accepts all options described here as keyword arguments.

Dan 9th July, 2009

I think there's a bug in this code.

On line 24, the "query" parameter needs to be quoted. Add "from urllib import quote" somewhere, and then, on line 24, do:
final_url = base_url%(type_, quote(query), payload)
This bug is not normally manifest, because (as far as I can tell) urllib will escape those characters itself. However, if you (as I have) port the code to Google App Engine and use Google's "urlfetch" instead, you may find yourself baffled by this for hours.


Marc Puig

Thanks Dan, I was having some problems with the bossapi and I solved thanks to your comment!


I updated the code. So if you checkout from the source, you should not have this problem. Let me if you do.

© Agiliq, 2009-2012