Skip to content

Instantly share code, notes, and snippets.

@csiebler
Created October 20, 2021 08:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save csiebler/8953bb07284a6a8edc575580d9898224 to your computer and use it in GitHub Desktop.
Save csiebler/8953bb07284a6a8edc575580d9898224 to your computer and use it in GitHub Desktop.
Bing Search v7 example
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