How to use bing search api

Constraint

How to use

Sample code

bingsearch.py


#! /usr/bin/python
# -*- coding:utf-8 -*-

import urllib
import requests
import json
NUM = 100
key = '' #Enter api key
url = 'https://api.datamarket.azure.com/Bing/Search/Web?'
json_param = '&$format=json'
param = {
    'Query':"''", #Put a query
}
req_url = url + urllib.urlencode(param)

for i in range(0,NUM):
    r = requests.get(req_url + json_param,auth=(key,key)).json
    print json.dumps(r)
    req_url = r['d']['__next']

Recommended Posts

How to use bing search api
How to use search sorted
How to use OpenPose's Python API
[Python] How to use Typetalk API
How to use GCP's Cloud Vision API
How to use xml.etree.ElementTree
How to use Python-shell
How to use tf.data
How to use virtualenv
How to use Seaboan
How to use image-match
How to use shogun
How to use Virtualenv
How to use numpy.vectorize
How to use pytest_report_header
How to use partial
How to use Bio.Phylo
How to use SymPy
How to use x-means
How to use WikiExtractor.py
How to use virtualenv
How to use Matplotlib
How to use iptables
How to use numpy
How to use TokyoTechFes2015
How to use venv
How to use Pyenv
How to use list []
How to use python-kabusapi
How to use OptParse
How to use return
How to use dotenv
How to use pyenv-virtualenv
How to use Go.mod
How to use imutils
How to use import
How to use the Google Cloud Translation API
How to use the NHK program guide API
How to use Qt Designer
python3: How to use bottle (2)
Understand how to use django-filter
How to use the generator
How to use FastAPI ③ OpenAPI
How to use Python argparse
How to use IPython Notebook
How to use Pandas Rolling
[Note] How to use virtualenv
How to use redis-py Dictionaries
[Python] How to use checkio
[Go] How to use "... (3 periods)"
[Python] How to use input ()
How to use the decorator
[Introduction] How to use open3d
How to use Python lambda
How to use Jupyter Notebook
[Python] How to use virtualenv
python3: How to use bottle (3)
python3: How to use bottle
How to use Google Colaboratory
How to use Python bytes
[BigQuery] How to use BigQuery API for Python -Table creation-