Bing image search

def img_search_bing(album):
    ''' Bing image search '''

    setup()

    album = album + " Album Art"

    api_key = "Key"
    endpoint = "https://api.cognitive.microsoft.com/bing/v5.0/images/search"
    links_dict = {}

    headers = {'Ocp-Apim-Subscription-Key': str(BING_KEY)}
    param = {'q': album, 'count': '1'}

    response = requests.get(endpoint, headers=headers, params=param)
    response = response.json()

    key = 0
    try:
        for i in response['value']:
            links_dict[str(key)] = str((i['contentUrl']))
            key = key + 1

        return links_dict["0"]
        
    except KeyError:
        return None