import requests


def fetch_player_history(player_id):
    """ Fetch JSON of a single player's FPL history. """
    url = "https://fantasy.premierleague.com/drf/element-summary/{}".format(player_id)
    r = requests.get(url)
    return r.json()["history_past"]