import requests


def get_raid_progression(name,realm="sargeras"):
    """Get the raid progression info as json from Raider.io api, format and return as a string"""
    raid_list = ["the-eternal-palace","crucible-of-storms","battle-of-dazaralor","uldir"]
    formatted_raidnames = ["Eternal Palace","Crucible of Storms","Battle of Dazaralor","Uldir"]
    url = f"https://raider.io/api/v1/characters/profile?region=us&realm={realm}&name={name}&fields=raid_progression"
    response = requests.get(url).json()
    category = response['raid_progression']
    message = f"{str(name).capitalize()}'s Raid Progression\n" \
              f"---------------------------------------\n"
    for i in range(len(raid_list)):
        total_bosses = category[raid_list[i]]['total_bosses']
        message += f"{formatted_raidnames[i]}: {category[raid_list[i]]['mythic_bosses_killed']}/{total_bosses}M, "
        message += f"{category[raid_list[i]]['heroic_bosses_killed']}/{total_bosses}H, "
        message += f"{category[raid_list[i]]['normal_bosses_killed']}/{total_bosses}N\n"
    message += f"---------------------------------------\n"
    return message