Skip to content

Commit 39d829e

Browse files
authored
Updated key/endpoint
Endpoints are not region-based anymore, but rather custom domain -based. Although regional endpoints will still work. Also, the authentication information is moving to a standard of getting it from environment variables.
1 parent 0d20f1e commit 39d829e

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

python/Search/BingVisualSearchv7.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@
66

77
import requests, json
88

9+
# Add your Bing Search V7 endpoint to your environment variables.
10+
BASE_URI = os.environ['BING_SEARCH_V7_ENDPOINT'] + '/bing/v7.0/images/visualsearch'
911

10-
BASE_URI = 'https://api.cognitive.microsoft.com/bing/v7.0/images/visualsearch'
11-
12-
SUBSCRIPTION_KEY = 'your-subscription-key'
12+
# Add your Bing Search V7 subscription key to your environment variables.
13+
SUBSCRIPTION_KEY = os.environ['BING_SEARCH_V7_SUBSCRIPTION_KEY']
1314

1415
imagePath = 'your-image-path'
1516

@@ -36,4 +37,4 @@ def print_json(obj):
3637

3738
# Main execution
3839
if __name__ == '__main__':
39-
main()
40+
main()

0 commit comments

Comments
 (0)