Skip to content

Commit

Permalink
Updated structure, fixed bug
Browse files Browse the repository at this point in the history
  • Loading branch information
wiazur authored Jan 24, 2020
1 parent 862c7b7 commit 7f527f8
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions python/Search/BingAutosuggestv7.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,22 @@

# -*- coding: utf-8 -*-

import http.client, urllib.parse, json
'''
This sample uses the Bing Autosuggest API to check the spelling of query words and then suggests corrections.
Bing Spell Check API: https://docs.microsoft.com/en-us/rest/api/cognitiveservices-bingsearch/bing-autosuggest-api-v7-reference57855119bca1df1c647bc358
'''

# **********************************************
# *** Update or verify the following values. ***
# **********************************************
import http.client
import json
import os
import urllib.parse

# Add your Bing Autosuggest subscription key to your environment variables.
subscriptionKey = os.environ['BING_AUTOSUGGEST_SUBSCRIPTION_KEY']

# Add your Bing Autosuggest endpoint to your environment variables.
host = os.environ['BING_AUTOSUGGEST_ENDPOINT']
host = host.replace('https://', '')
path = '/bing/v7.0/Suggestions'

mkt = 'en-US'
Expand Down

0 comments on commit 7f527f8

Please sign in to comment.