GithubHelp home page GithubHelp logo

vincentleeuwen / pybingsearchapi Goto Github PK

View Code? Open in Web Editor NEW

This project forked from xthepoet/pybingsearchapi

0.0 1.0 0.0 67 KB

Python Bing Search API for new Azure Marketplace version (Aug 2012 release)

pybingsearchapi's Introduction

pyBingSearchAPI

Python Bing Search API for new Azure Marketplace version (Aug 2012 release)

Inspired by https://github.com/mlagace/Python-SimpleBing (designed for outdated Bing API 2.0), this class basically encodes your query parameters as a url request but also makes sure the parameters are in the right order, case is correct for the mandatory parameters, and quotes are added. Details are in the source comments.

To use: Get your API key from http://www.bing.com/developers/

For the Bing Search API schema, go to http://www.bing.com/developers/ Click on Bing Search API, then download the Bing API Schema Guide (which is oddly a Word document)

The parameters are just accepted as a dictionary. Note from the documentation quotations are required for some filters. I've mapped both " and ' to be the desired urlencoding to make it more python-esque

Example:

from bing_search_api import BingSearchAPI 

my_key = "[your key]"
query_string = "Your Query"
bing = BingSearchAPI(my_key)
params = {'ImageFilters':'"Face:Face"',
          '$format': 'json',
          '$top': 10,
          '$skip': 0}
print bing.search('image+web',query_string,params).json() # requests 1.0+ 

pybingsearchapi's People

Contributors

xthepoet avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.