• Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
geordie

geordie

euroleague-stats

Euroleague Fantasy Basketball Stats - View and export stats
Public
Like
euroleague-stats
Home
Code
12
api
1
tests
5
types
1
utils
3
.vtignore
AGENTS.md
FIXES.md
README.md
clubs.csv
deno.json
H
main.tsx
test-api-direct.js
Branches
1
Pull requests
Remixes
History
Environment variables
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Sign up now
Code
/
FIXES.md
Code
/
FIXES.md
Search
…
FIXES.md

Fixes Applied Based on Swagger API Spec

Key Changes Made

1. Parameter Names Updated

  • Changed season β†’ seasonCode (API uses seasonCode)
  • Changed teamId β†’ playerCode or clubCode (API uses codes, not IDs)
  • Added gameCode and gameNumber parameters
  • Added convertSeasonToCode() function to convert "2024-25" format to "E2024" format

2. Type Definitions Updated

Based on the Swagger spec schemas:

  • PlayerStats: Now matches SeasonPlayerModel

    • score (points), assistances (assists), totalRebounds, valuation (PIR)
    • clubCode, clubName instead of team object
    • blocksFavour instead of blocks
  • Game: Now matches GameResultModel

    • homeTeam, awayTeam as strings (not objects)
    • homeCode, awayCode for team codes
    • played boolean instead of status string
  • Team: Now matches ClubModel

    • code, clubName, clubAlias instead of id, name, shortName

3. Response Parsing Updated

The API returns different structures:

  • /teams β†’ { clubs: [...] }
  • /results β†’ { gameResults: [...] }
  • /standings β†’ { group: [{ team: [...] }] } (nested structure)
  • /schedules β†’ { item: [...] }
  • /players β†’ Single object (not array) - handled by extracting from teams

4. Players Data Source

Since /players endpoint returns a single player (requires playerCode), we now:

  • Fetch all teams first
  • Extract players from each team's players array
  • Combine into a single list for display

5. Error Handling

  • Added XML detection (API may return XML)
  • Better error messages showing response structure
  • Handles both JSON and XML content types

Testing Checklist

API Endpoints

  • Test /teams?seasonCode=E2024 - should return clubs array
  • Test /results?seasonCode=E2024 - should return gameResults array
  • Test /standings?seasonCode=E2024 - should return group array
  • Test /schedules?seasonCode=E2024 - should return item array
  • Test /players?seasonCode=E2024&playerCode=XXX - should return single player

UI Functionality

  • Season dropdown converts "2024-25" to "E2024" correctly
  • Teams load and display in filter dropdown
  • Players list shows data from teams
  • Games/Results display correctly
  • Standings display correctly
  • Schedules display correctly
  • CSV export works
  • Charts work for player comparison
  • Error messages display when API fails

Known Issues / Limitations

  1. API Authentication: The Swagger spec shows OAuth2 required, but the API might work without it. If you get 401/403 errors, authentication may be needed.

  2. XML Responses: The API may return XML by default. The code detects XML and shows an error. If JSON is available, we may need to add Accept: application/json header more explicitly.

  3. Players Endpoint: The /players endpoint requires a playerCode to get a specific player. We work around this by extracting players from teams.

  4. Season Format: The UI uses "2024-25" format but converts to "E2024" for the API. Make sure this conversion works for all seasons.

Next Steps

  1. Test the deployed app at: https://geordie--07e91f64f32d11f0ac1542dde27851f2.web.val.run
  2. Check browser console for any errors
  3. Verify API responses match expected structure
  4. If API requires authentication, we'll need to add OAuth2 support
  5. If API only returns XML, we may need to add XML parsing or find JSON endpoint
FeaturesVersion controlCode intelligenceCLIMCP
Use cases
TeamsAI agentsSlackGTM
DocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Open Source Pledge
Terms of usePrivacy policyAbuse contact
Β© 2026 Val Town, Inc.