import requests


def query_api(decoded_hash):
    """
    query the API with the first 5 characters of the decoded hashed password (the prefix) using https
    args:
        a single hashed password as a string
    returns:
        - the status code that should always be 200, the API should not return a 404
        - a list of suffixes matching the prefix and the count of how many times each was found
    """
    prefix = decoded_hash[:5]
    url = 'https://api.pwnedpasswords.com/range/' + prefix
    r = requests.get(url)
    print(f'request status code: {r.status_code}')
    api_results = r.text.split()
    return api_results