File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 88import json
99import 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' ]
1213customConfigId = "YOUR-CUSTOM-CONFIG-ID"
1314searchTerm = "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
1618r = requests .get (url , headers = {'Ocp-Apim-Subscription-Key' : subscriptionKey })
1719print (r .text )
You can’t perform that action at this time.
0 commit comments