Skip to content

Latest commit

 

History

History
123 lines (98 loc) · 3.41 KB

sports-data.md

File metadata and controls

123 lines (98 loc) · 3.41 KB

Sports Data API Documentation

Available Endpoints

NBA

  • GET /api/v1/nba/games - Get today's NBA games
  • GET /api/v1/nba/standings - Get current NBA standings
  • GET /api/v1/nba/teams/:teamId/leaders - Get team leaders (e.g., /api/v1/nba/teams/POR/leaders for Portland)
  • GET /api/v1/nba/teams/:teamId/stats?category={category} - Get team statistics
    • Optional query parameter: category (points, rebounds, assists, steals, blocks)
  • GET /api/v1/nba/teams/:teamId/roster - Get team roster
  • GET /api/v1/nba/teams/:teamId/schedule - Get team schedule
  • GET /api/v1/nba/teams/:teamId/players?name={playerName} - Search for player and get their stats
    • Example: /api/v1/nba/teams/POR/players?name=Simons
  • GET /api/v1/nba/teams/:teamId/players/:playerId/stats - Get player stats by ID
    • Optional query parameter: category (points, rebounds, assists, steals, blocks)

WNBA

  • GET /api/v1/wnba/games - Get today's WNBA games

NHL

  • GET /api/v1/nhl/games - Get today's NHL games

NFL

  • GET /api/v1/nfl/games - Get today's NFL games

Golf

  • GET /api/v1/golf/pga/leaderboard - Get current PGA tournament leaderboard
  • GET /api/v1/golf/lpga/leaderboard - Get current LPGA tournament leaderboard

Team IDs

  • Western Conference:

    • POR: Portland Trail Blazers
    • LAL: Los Angeles Lakers
    • GSW: Golden State Warriors
    • DEN: Denver Nuggets
    • PHX: Phoenix Suns
    • LAC: LA Clippers
    • SAC: Sacramento Kings
    • MEM: Memphis Grizzlies
  • Eastern Conference:

    • BOS: Boston Celtics
    • MIA: Miami Heat
    • MIL: Milwaukee Bucks
    • PHI: Philadelphia 76ers
    • NYK: New York Knicks
    • BKN: Brooklyn Nets
    • CLE: Cleveland Cavaliers
    • ATL: Atlanta Hawks

Features

Completed

  • ✅ Full team and player statistics integration
  • ✅ Well-organized data structure with categorized stats
  • ✅ In-memory caching system
  • ✅ Rate limiting (60 requests per minute)
  • ✅ Error handling with fallbacks
  • ✅ ESPN API integration
  • ✅ Comprehensive testing suite
  • ✅ TypeScript type safety
  • ✅ Documentation and examples

In Progress

  • 🔄 Additional team ID mappings
  • 🔄 Historical player data
  • 🔄 Advanced filtering options
  • 🔄 WebSocket support for live updates

Planned

  1. Data Enhancement

    • Historical stats comparison
    • Player career statistics
    • Team comparison endpoints
    • Custom date ranges
    • Season-specific queries
  2. Additional Sports

    • MLB Baseball
    • Soccer (Premier League, La Liga)
    • College Sports (NCAA)
    • Formula 1 Racing
  3. Technical Improvements

    • API versioning
    • Response compression
    • Performance optimization
    • Automated deployment
    • Monitoring and alerts
    • Enhanced logging
  4. Documentation

    • OpenAPI/Swagger documentation
    • Integration guides
    • Example applications
    • Performance benchmarks

Rate Limiting

All endpoints are rate-limited to 60 requests per minute per IP address.

Caching

  • Game data is cached for 1 minute
  • Player and team stats are cached for 1 hour
  • Roster data is cached for 12 hours
  • Leaderboard data is cached for 5 minutes

Error Handling

  • Automatic fallback to alternative data sources
  • Detailed error messages
  • HTTP status codes for different scenarios
  • Rate limit headers included in responses

Contributing

Contributions are welcome! Please see our contributing guidelines for more information.

Support

For issues and feature requests, please use the GitHub issue tracker.