Skip to content

Commit

Permalink
Minor
Browse files Browse the repository at this point in the history
  • Loading branch information
wiazur authored Jan 27, 2020
1 parent 501e39c commit 22e8370
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions python/Search/BingVideoSearchv7.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@

# Add your Bing Search V7 subscription key and endpoint to your environment variables.
subscriptionKey = os.environ['BING_SEARCH_V7_SUBSCRIPTION_KEY']
host = os.environ['BING_SEARCH_V7_ENDPOINT']
path = "/bing/v7.0/videos/search"
endpoint = os.environ['BING_SEARCH_V7_ENDPOINT'] + "/bing/v7.0/videos/search"

# Search query
query = "kittens"
Expand All @@ -29,12 +28,15 @@
params = { "q": query }

# Call the API
response = requests.get(host + path, headers=headers, params=params)
response.raise_for_status()

# Print results
print("\nHeaders:\n")
print(response.headers)

print("\nJSON Response:\n")
pprint(response.json())
try:
response = requests.get(endpoint, headers=headers, params=params)
response.raise_for_status()

# Print results
print("\nHeaders:\n")
print(response.headers)

print("\nJSON Response:\n")
pprint(response.json())
except Exception as ex:
raise ex

0 comments on commit 22e8370

Please sign in to comment.