headers = {"Ocp-Apim-Subscription-Key": subscription_key} # 'subscription_key' is my api key
params = {"q": search_term, "textDecorations": True, "textFormat": "HTML"}
response = requests.get(search_url, headers=headers, params=params, verify=False)
response.raise_for_status()
search_results = response.json()
I wrote:
import requests
but return:
HTTPError: 401 Client Error: PermissionDenied for url: https://api.bing.microsoft.com/v7.0/search?q=Microsoft+Bing+Search+Services&textDecorations=True&textFormat=HTML