Skip to content

Commit 425533d

Browse files
authored
Merge pull request #89 from wiazur/patch-49
Updated key/endpoint
2 parents 3aa4765 + a3fbe66 commit 425533d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

python/Search/BingCustomSearchv7.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@
88
import json
99
import requests
1010

11-
subscriptionKey = "YOUR-SUBSCRIPTION-KEY"
11+
# Add your Bing Custom Search subscription key to your environment variables.
12+
subscriptionKey = os.environ['BING_CUSTOM_SEARCH_SUBSCRIPTION_KEY']
1213
customConfigId = "YOUR-CUSTOM-CONFIG-ID"
1314
searchTerm = "microsoft"
1415

15-
url = 'https://api.cognitive.microsoft.com/bingcustomsearch/v7.0/search?q=' + searchTerm + '&customconfig=' + customConfigId
16+
# Add your Bing Custom Search endpoint to your environment variables.
17+
url = os.environ['BING_CUSTOM_SEARCH_ENDPOINT'] + "/bingcustomsearch/v7.0/search?q=' + searchTerm + '&customconfig=' + customConfigId
1618
r = requests.get(url, headers={'Ocp-Apim-Subscription-Key': subscriptionKey})
1719
print(r.text)

0 commit comments

Comments
 (0)