Which football games in a JSON feed list a UK broadcaster?
I help maintain TVEvents. One detail that's easy to miss when building a football TV guide is that the competition and the TV audience can be in different countries. An Italian league match can have a UK broadcaster. For
I help maintain TVEvents. One detail that's easy to miss when building a football TV guide is that the competition and the TV audience can be in different countries. An Italian league match can have a UK broadcaster. For this example I select matches by the labels in their broadcast listings.
Here's a small Python script you can try without an API key or extra packages. It looks at five upcoming fixtures, prints any broadcaster explicitly labelled (Gbr), and gives you the match page so you can check the rest of the listings.
from urllib.request import urlopen
import json
url = "https://tvevents.org/api/v1/matches?sport=soccer&status=prematch&limit=5"
with urlopen(url, timeout=15) as response:
matches = json.load(response)["matches"]
for match in matches:
labels = match.get("tv_channels", [])
uk_labels = [label for label in labels if label.casefold().endswith("(gbr)")]
if uk_labels:
print(f"{match['home_team']} v {match['away_team']} | {', '.join(uk_labels)}")
print(match["match_url"])
If you're using an older Windows console, run the file with python -X utf8 fixtures.py so it can print names like Deportivo Alavés.
On 28 November, the feed returned Inter Milan v Genoa with the label DAZN (Gbr). Another fixture, Real Madrid v Deportivo Alavés, had two UK-labelled entries. These are examples from that snapshot. The same request will return different games as the schedule moves on.
One limitation matters if you're building a guide. An empty result means the sample contains no matching label. A broadcaster without a country suffix will be missed. You can't infer that a match is unavailable in the UK, or that a listed channel is free to watch.
The TVEvents API documentation covers the response fields and non-commercial usage terms. If you adapt this into a dashboard, cache responses and allow at least five seconds between requests.
Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.