import requests


def get_launches() -> list:
    """
    Return the list of all past launches.

    :return:
    """
    url = 'https://api.spacexdata.com/v2/launches/'
    response = requests.get(url)
    # status code 200 means everything is ok
    # see https://httpstatuses.com/200
    if response.status_code == 200:
        # JSON is a special format that most APIs use
        return response.json()
    else:
        # print an error message and exit the programme
        print("SpaceX API is unavailable")
        exit()