A TypeScript web application for viewing, filtering, and exporting Euroleague basketball statistics for fantasy basketball leagues. Built for deployment on Val Town.
Now using API v3 - Migrated from v1 to v3 for JSON responses and richer data!
/
├── main.tsx # Main HTTP val entry point (serves HTML + handles API)
├── types/
│ └── euroleague.ts # TypeScript interfaces for API responses
├── api/
│ └── client.ts # Euroleague API client wrapper
├── utils/
│ ├── csv.ts # CSV export utilities
│ └── formatters.ts # Data formatting helpers
└── README.md # This file
Use the Val Town MCP tools to create a new val:
Create a new HTTP val named "euroleague-stats"
Copy the contents of main.tsx into the val's main file
The app will be available at the val's endpoint URL
main.tsx into the editorThe app serves both the frontend and API endpoints:
GET / - Serves the main HTML page with React appGET /api/players?seasonCode=E2024&teamCode=XXX - Get player traditional stats (v3)GET /api/games?seasonCode=E2024 - Get gamesGET /api/results?seasonCode=E2024 - Get game resultsGET /api/standings?seasonCode=E2024&roundNumber=1 - Get basic standings (v3)GET /api/schedules?seasonCode=E2024 - Get schedulesGET /api/teams or GET /api/clubs - Get all clubs/teams (v3)For local development (not Val Town):
Install dependencies (if using a bundler):
npm install
Run a local server (e.g., using Deno):
deno run --allow-net --allow-read main.tsx
Open http://localhost:8000 in your browser
This app uses the Euroleague API v3:
https://api-live.euroleague.net/v3/clubs - Get all clubs with pagination/competitions/{competitionCode}/statistics/players/traditional - Player traditional stats/competitions/{competitionCode}/statistics/players/advanced - Player advanced stats/competitions/{competitionCode}/statistics/players/scoring - Player scoring stats/competitions/{competitionCode}/statistics/players/misc - Player misc stats/competitions/{competitionCode}/statistics/players/leaders - Player leaders/competitions/{competitionCode}/seasons/{seasonCode}/rounds/{roundNumber}/basicstandings - Basic standings/competitions/{competitionCode}/seasons/{seasonCode}/rounds/{roundNumber}/calendarstandings - Calendar standings/competitions/{competitionCode}/seasons/{seasonCode}/rounds/{roundNumber}/streaks - Streak standings/competitions/{competitionCode}/seasons/{seasonCode}/rounds/{roundNumber}/aheadbehind - Ahead/Behind standings/competitions/{competitionCode}/seasons/{seasonCode}/rounds/{roundNumber}/margins - Margins standings/competitions/{competitionCode}/seasons/{seasonCode}/games/{gameCode}/report - Game reports/competitions/{competitionCode}/seasons/{seasonCode}/games/{gameCode}/stats - Game stats/competitions/{competitionCode}/seasons/{seasonCode}/games/{gameCode}/teamsComparison - Teams comparisonThe application has been fully migrated from API v1 to v3:
/v1 → /v3Comprehensive tests are available in tests/api-v3.test.ts:
Run tests with:
deno test tests/api-v3.test.ts --allow-net
The CSV export includes:
players_2024-25_Regular_Season.csv)This project is provided as-is for educational and personal use.
For issues or questions:
main.tsx