import requests


def get_site_information(site, *args):
    """Reads site information from Cloudnet http API.

    Args:
        site (str): Site identifier, e.g. 'mace-head' or 'lindenberg'.
        args: Variable number of field names to be queried.
            Possible field names are 'latitude', 'longitude', 'altitude'
            and 'site_name'.

    Returns:
        list: List of return values as floats.

    Examples:
        >>> get_site_information('mace-head', 'latitude', 'longitude')

    """
    fields = ','.join(args)
    query = f"http://devcloudnet.fmi.fi/api/sites/?site_code={site}&fields={fields}"
    try:
        result = [*requests.get(query).json()[0]['fields'].values()]
        result = [float(x) for x in result]
        if len(result) == 1:
            result = result[0]
    except:
        result = [0]*len(args)
    return result