Created
October 20, 2021 08:40
-
-
Save csiebler/8953bb07284a6a8edc575580d9898224 to your computer and use it in GitHub Desktop.
Bing Search v7 example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests, json | |
key = "xxxxx" # Paste your API key here | |
url = "https://api.bing.microsoft.com/v7.0/search" | |
search_term = "Azure Cognitive Services" | |
headers = {"Ocp-Apim-Subscription-Key" : key} | |
params = {"q": search_term, "textDecorations": True, "textFormat": "HTML"} | |
response = requests.get(url, headers=headers, params=params) | |
print(json.dumps(response.json(), indent=2)) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment