What can I do to reduce the number of steps until I get to the final code result?
Is it possible or is this the way with the least number of lines of code?
import requests
headers = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36"
}
url = f'https://api.sofascore.com/api/v1/event/9567795/graph'
response = requests.get(url, headers=headers).json()
goal_minute = 88
graphs = response['graphPoints']
graph_minutes = graphs[-5:]
minutes_list = []
for minute in graph_minutes:
minutes_list.append(minute["minute"])
if goal_minute in minutes_list:
print('Ok')