def METHOD_NAME(package, from_version, to_version, *, api_key):
    from_version = parse_version(from_version)
    to_version = parse_version(to_version)
    changelog = {}
    r = requests.get(
        "https://pyup.io/api/v1/changelogs/{}/".format(package),
        headers={"X-Api-Key": api_key}
    )
    if r.status_code == 200:
        data = r.json()
        if data:
            # sort the changelog by release
            sorted_log = sorted(data.items(), key=lambda v: parse_version(v[0]), reverse=True)
            # go over each release and add it to the log if it's within the "upgrade
            # range" e.g. update from 1.2 to 1.3 includes a changelog for 1.2.1 but
            # not for 0.4.
            for version, log in sorted_log:
                parsed_version = parse_version(version)
                if parsed_version > from_version and parsed_version <= to_version:
                    changelog[version] = log
    return changelog