I have written this code;
import bingsearch
bingsearch.API_KEY='mykey'
r = bingsearch.request("JohnDalton")
r.status_code
r[0]['Description']
print r[0]['Url']
This is th bingsearch.py file
import requests
import urllib2
URL = 'https://api.datamarket.azure.com/Data.ashx/Bing/SearchWeb/Web?Query=%(query)s&$top=50&$format=json'
API_KEY = 'mykey'
def request(query, **params):
r = requests.get(URL % {'query': query}, auth=('', API_KEY))
return r.json['d']['results']
As i mentioned in the title it gives me an instancemethod error. How should i fix this?