Skip to content

Latest commit

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

sports-schema

TypeScript schema definitions for sports data — athletes, matches, tournaments, teams, and analytics.

Part of SportsFirstData — The Open-Source Sports Data Engine.

Install

npm install sports-schema

Usage

importtype{Athlete,Match,Tournament,Standing}from"sports-schema";constathlete: Athlete={id: "ath-1",firstName: "Lionel",lastName: "Messi",sportId: "football",status: "active",position: "Forward",jerseyNumber: 10,};constmatch: Match={id: "match-1",sportId: "football",startTime: "2025-01-15T20:00:00Z",status: "finished",homeTeamId: "team-1",awayTeamId: "team-2",score: {home: 3,away: 1},};

Schemas

SchemaDescription
SportSport definition (name, positions, scoring)
AthletePlayer profile, status, physical attributes
TeamTeam identity and metadata
VenueStadium/arena with capacity and geo coordinates
MatchGame with score, periods, and events
MatchEventIn-game events (goals, cards, substitutions)
TournamentCompetition with stages and format
StandingLeague table entry with points and record
AthleteStatisticsPer-player stats for a match or tournament
TeamStatisticsPer-team stats for a match or tournament
SeasonRecordAggregated season performance

Utility Types

  • Paginated<T> — Paginated response wrapper
  • ApiResponse<T> — Standard API response with error handling
  • DateRange — Date range filter
  • SortOption — Sort field and direction

Development

npm install
npm run build
npm test

License

MIT

About

SportsFirstData — The Open-Source Sports Data Engine | Athlete Management, Match Data APIs, Tournament Management, and Modular Sports Analytics Platform

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages