Fix
Season year naming bugs: 2025 vs 2024-25 joins
Short answer: the same winter day belongs to season 2025 in football, 2026 in basketball and 20252026 in hockey. Convert every season to one key, the calendar year in which it starts, as soon as the data enters your system, and join on that key.
The symptoms
Season label bugs rarely throw an error. Most of them return a valid answer for the wrong year. These are the usual signs:
- A cross-sport table has football at 2025 and basketball at 2025, but the basketball row describes the season that ended in the spring of 2025, not the one starting in autumn.
- A season join drops every row for one sport, because one table holds
20252026as text and the other holds2025as a number. - A study of "last season" pulls the wrong year for one sport, and the sample looks smaller, older or newer than expected.
- An API call fails with a 400 on a season value that worked for another sport.
- A chart shows a year-over-year jump that is really a one-season misalignment between two sports.
All of these come from one fact: there is no single season convention in sport, and each league's data follows its own.
What each API means by a season
We checked each convention on December 6, 2026 by asking every API for games on a fixed winter date and reading the season it reported.
| Sport | API | Param type | Meaning | January 2026 value |
|---|---|---|---|---|
| Hockey | PuckAPI | text, 8 digits | start year then end year | "20252026" |
| Football | EndzoneAPI | number or text | year the regular season starts | 2025 |
| Basketball | DunkAPI | number or text | year the season ends | 2026 |
| Soccer, European leagues | StrikerAPI | number or text | year the season starts | 2025 |
| Soccer, MLS and others | StrikerAPI | number or text | calendar year | 2026 for an April 2026 game |
| Baseball | FastballAPI | number or text | calendar year | 2025 for a September 2025 game |
For basketball, the WNBA is the exception to the end-year rule, and uses the calendar year. For soccer, the calendar-year leagues are MLS, the NWSL, Liga MX, Brazil and Argentina. Football has a wrinkle that matters when you work with dates: season 2025 includes the playoffs and the championship game in January and February 2026, so a game on January 25, 2026 still carries season 2025. A calendar-year cut would put it in 2026.
The hockey API is the strictest. A bare year such as "2025" is refused with HTTP 400 and a message that says a bare year is ambiguous, and a number is refused as well, because the parameter must be a string. The forms 20252026 and 2025-26 both work. The strictness is useful, because a wrong hockey season fails loudly instead of returning the wrong year.
Cause: three conventions hide behind the same integer
The trap is that 2025 and 2026 are both valid integers in every sport, so a type check cannot catch the mistake. A football season of 2025 and a basketball season of 2026 describe the same stretch of the calendar. A football season of 2025 and a basketball season of 2025 describe two different stretches, a year apart. A hockey id carries both years, which is the one case where the label cannot be misread.
A second source of drift is date filtering. Several APIs let you pass a date as well as a season, and the date semantics differ. In the basketball and baseball tools, a single date is a US Eastern day. In the soccer tool, a date is a UTC day unless you pass a timezone, so an evening kickoff in the Americas can land on the next day. In the hockey tool, each game has a local gameDate and a UTC startTime. If you assign seasons by date instead of by the API's own season field, you will put some late-night games in the wrong place, and games in the first days of January in the wrong season.
The fix is to stop reading the season from a number and start reading it from a rule per API.
Step 1: see the labels for yourself
This script asks four APIs for one game each on a winter date, and prints the raw season next to a normalized start year. Set the key environment variables or use your own method of loading keys. Each call costs 2 to 5 credits.
import json, os, subprocess, urllib.request
def post(brand, tool, body, key):
req = urllib.request.Request(f"https://mcp.{brand}.com/v1/{tool}", data=json.dumps(body).encode(),
headers={"Content-Type": "application/json", "x-api-key": key})
with urllib.request.urlopen(req, timeout=30) as resp:
print("HTTP", resp.status, brand, tool)
return json.load(resp)["data"]
def start_year(brand, season):
"""One key for every brand: the calendar year a season begins."""
if brand == "puckapi": # "20252026" -> 2025
return int(str(season)[:4])
if brand == "dunkapi": # 2026 means 2025-26
return int(season) - 1
return int(season) # football, European soccer, baseball
checks = [
("puckapi", "get_games", {"date": "2026-01-10", "limit": 1}),
("endzoneapi", "get_games", {"date_from": "2026-01-10", "date_to": "2026-01-10", "limit": 1}),
("dunkapi", "list_games", {"date": "2026-01-10", "limit": 1}),
("strikerapi", "list_games", {"date": "2026-01-17", "limit": 1}),
]
for brand, tool, body in checks:
game = post(brand, tool, body, os.environ[brand.upper() + "_KEY"])["games"][0]
print(f' {brand:11} raw season {game["season"]!r:11} -> start year {start_year(brand, game["season"])}')On the verified run all four calls returned HTTP 200. Hockey returned '20252026', football returned 2025, basketball returned 2026 and soccer returned 2025. After normalization all four became 2025, which is the right answer, because all four games belong to the season that started in the autumn of 2025.
Step 2: handle the calendar-year leagues by name
The start_year function above is correct for European soccer, but not for the calendar-year leagues. For an MLS game on April 4, 2026 the soccer API returned a season of 2026, and the season began in 2026 as well, so the integer passes through unchanged and the function is right for that league too. The case to guard against is the opposite one, where you assume every soccer league follows the autumn rule and add or subtract a year. Keep a small table keyed by API and league, and write the rule down next to each entry. Do not infer it from the sport name.
For basketball, remember that the WNBA uses the calendar year, so the subtract-one rule applies to the NBA and the other leagues in that API that follow the end-year rule, and not to the WNBA. Check the league parameter before you convert.
Step 3: reject bad seasons instead of guessing
Hockey shows a good pattern. A bare year is refused with a clear message, so your code never returns a wrong season. You can copy that behavior in your own loader:
def hockey_id(start):
return f"{start}{start + 1}" # 2025 -> "20252026"
assert hockey_id(2025) == "20252026"Build the hockey id from the start year, never from a user's text, and send it as a string. For every other API, send the year in that API's own convention and keep the conversion in one function that has tests. A test per API that pins one known game to one start year catches a change in convention before it reaches a report.
Step 4: store both the raw label and the key
Keep the API's raw season in one column and your normalized start year in another. When something looks off, the raw value tells you what the API said, and the key tells you how you read it. Join cross-sport tables on the start year, plus the sport in the key, so a basketball season and a football season never collide.
When not to use this
- You only use one API. Within one API the convention is stable, and you can use its own season value as the join key.
- You need games by exact date. A season label does not tell you when a game happened. Use the date fields, and read their time zone rules.
- You compare seasons that straddle a lockout or split schedule. A shortened season still has one label, so plan for that in your analysis instead of in the key.
Checked against the live API on 2026-12-06. Questions: hello@sportsdatahq.com.