Python (3.8+)

Prerequisites

You should have a running environment for Python 3 ready set up. We will utilize the excellent requests library to fetch the data. Check your version and install the library like so:

(base) ~ % python --version
Python 3.8.8
(base) ~ % pip3 install requests

In case there is no Python installed yet, I’d advice to use Anaconda to do so.

Plain request

import requests
import json

uri = 'https://api.football-data.org/v4/matches'
headers = { 'X-Auth-Token': 'UR_TOKEN' }

response = requests.get(uri, headers=headers)
for match in response.json()['matches']:
  print match