import requests


def test_steam_api_key(api_key=None):
    """
    Test if api_key is valid for steam api

    Parameters
    ----------
        api_key (int): api steam key
    Returns
    -------
        (bool): True if valid
    """
    # According to https://developer.valvesoftware.com/wiki
    # /Steam_Web_API#GetGlobalAchievementPercentagesForApp_.28v0001.29
    url_test = f'http://api.steampowered.com/ISteamUser\
/GetPlayerSummaries/v0002/?key={api_key}&steamids=76561197960435530'
    return requests.get(url_test).status_code == 200