bingapi

A very thin Python wrapper over the Bing API
Download

bingapi Ranking & Summary

Advertisement

  • Rating:
  • License:
  • GPL
  • Price:
  • FREE
  • Publisher Name:
  • Lakshman Prasad and Shabda Raaj
  • Publisher web site:
  • https://uswaretech.com/

bingapi Tags


bingapi Description

A very thin Python wrapper over the Bing API bingapi is a very thin Python wrapper over the Bing API. Bing provides a very simple Restful interface to their search engine and provides results in JSON and XML interface.With bingapi.py, we query the rest urls to get the JSON response, which is parsed with simplejson.py. bingapi.py just adds simple niceties like logging and error handling.Installing:easy_install bingapior Svn it from https://svn.uswaretech.com/bingapi/Using:To use this library, you need to have an Appid from Bing. You can get it fromhttp://www.bing.com/developers/createapp.aspxThe meat of bingapi.py is `talk_to_bing` function. It takes a query(eg. salsa)and a sources(eg. web) and other optional parameters in extra_args(eg. {'web.offset': 40}) and returns the dictionary of Bing's response.egIn : from bingapi import bingapiIn : bing = bingapi.Bing('')In : bing.talk_to_bing('salsa', sources='web')Out: ..........In : bing.talk_to_bing('salsa', sources='web', extra_args={'web.offset':40})Out: ..........Class `Bing` also provides utility functions to do the various types of serachesso you dont have to remember the source type.The various functions available are,do_web_searchdo_image_searchdo_news_searchdo_spell_searchdo_related_searchdo_phonebook_searchdo_answers_searchAll of them are used similarly.In : bing.do_web_search('salsa')Out: ..........In : bing.do_image_search('salsa')Out: ..............In : bing.do_answers_search('what is salsa')Out: ...............If you want to use multiple sources in one call you can use `talk_to_bing`directly asIn : bing.talk_to_bing(query='salsa', sources='web news')Out:............ Requirements: · Python


bingapi Related Software