import requests

url = "https://football-prediction-api.p.rapidapi.com/api/v2/predictions"

querystring = {"market":"classic","iso_date":"2022-10-09","federation":"UEFA"} # the date, match type, and competition

headers = {
	"X-RapidAPI-Key": "686830ba27msh513db9752c312c4p1115d7jsn310f307263ee",
	"X-RapidAPI-Host": "football-prediction-api.p.rapidapi.com"
}

response = requests.request("GET", url, headers=headers, params=querystring)

# print(response.text)


teams = response.json().get('data') # set teams equal data
for team in teams:  # teams is a list above
    if team["away_team"] == "PSV Eindhoven":  # this filters for games by PSV
        for key, value in team.items():  # this finds key, value pairs in in this game by PSV
            print(key, value)
home_team Heerenveen
away_team PSV Eindhoven
id 219492
market classic
competition_name Eredivisie
prediction 2
competition_cluster Netherlands
status won
federation UEFA
is_expired True
season 2022 - 2023
result 0 - 1
start_date 2022-10-09T15:45:00
last_update_at 2022-10-09T14:11:45.119363
odds {'1': 5.421, 'X': 4.333, '2': 1.551, '1X': 2.366, 'X2': 1.143, '12': 1.206}