import requests
import json


def get_card_updated_data(scryfall_id) -> str:
    """Gets updated data from scryfall

    Args:
        scryfall_id ([type]): [description]

    Returns:
        json: result from scryfalls card api

    ref: https://scryfall.com/docs/api/cards/id
    ex scryfall_id="e9d5aee0-5963-41db-a22b-cfea40a967a3"
    """
    r = requests.get(
        f"https://api.scryfall.com/cards/{scryfall_id}",
    )
    if r.status_code == 200:

        return json.loads(r.text)

    raise Exception("Could not download os save card image")