import requests


def ergast_retrieve(api_endpoint: str):
    """Retrieve data from the Ergast API."""
    url = f"https://ergast.com/api/f1/{api_endpoint}.json"
    response = requests.get(url).json()

    return response["MRData"]