Get player data and match via PUBG API

The programmer who do not know data analyze is not a good player in PUBG. πŸ™‚

I will show some tool method below

# this function get the player data by PUBG player name and return the json data

def get_player_data(name):
    headers = {
        "Authorization": "Bearer {}".format(PUBG_API_TOKEN),
        "Accept": "application/vnd.api+json",
    }
    payload = {"filter[playerNames]": name}

    result = requests.get("https://api.pubg.com/shards/steam/players", params=payload,headers=headers)
    return result.json()
# this function get the match data by match id and return the match data json
def get_matches_by_id(id):
    headers = {
        "Accept": "application/vnd.api+json",
    }

    result = requests.get("https://api.pubg.com/shards/steam/matches/{}".format(id),headers=headers)
    return result.json()

This post just show the tool function . The next post will show how to use it and extract data!