Sports


Sports API Hub supports multiple sports in a single WordPress installation. Each sport has its own statistics schema, display logic, and permalink base. You enable the sports you need in API & Import > API Config, and the plugin handles the rest.

Supported Sports

SportIDPermalink BaseStatus
🏀 Basketball1/basketball/Available
⚾ Baseball2/baseball/Available
🏏 Cricket3/cricket/Planned
🏈 Rugby4/rugby/Planned
🏒 Ice Hockey5/ice-hockey/Planned
🏈 American Football6/american-football/Planned
🥏 Handball7/handball/Planned
🏐 Volleyball8/volleyball/Planned

Available means full implementation: box scores, career stats, game flow charts, aggregate stats, and sport-specific display logic.

Planned sports will be added in future updates based on customer demand.

🏀 Basketball

The most complete implementation. Features include:

  • Box scores with 25 stat columns (points, rebounds, assists, shooting percentages, etc.)
  • Team statistics comparison with visual comparison bars
  • Play-by-play timeline with scoring events and period breaks
  • Game flow charts (Score Lines + Lead Tracker via ECharts)
  • Career stats with season-by-season averages
  • Home/Away splits, monthly splits, and opponent stats
  • Aggregate stats (season stats, season ranks, leaders, player averages)
  • Highlight chart with SVG ring charts and league rank badges
  • Roster grouping by position: Guards, Forwards, Centers
  • Standings with home/away splits and division/conference levels

Incidents: Goal events (one-point, two-point, three-point), period breaks, overtime breaks. No cards or substitutions.

Display order: US sport convention — Away @ Home (away team listed first).

⚾ Baseball

Full statistical implementation with sport-specific tables:

  • Box scores with separate batting and pitching tables
  • Batting stats (AVG, HR, RBI, OBP, SLG, OPS, and more)
  • Pitching stats (ERA, SO, WHIP, IP, W-L, and more)
  • Career stats with computed rates (batting averages, ERA)
  • R/H/E scoring (Runs, Hits, Errors in period table)
  • Roster grouping by position: Pitchers, Infield, Outfield
  • Unplayed innings displayed as dashes (ESPN convention)

Display order: US sport convention — Away @ Home.

Note

Baseball does not have play-by-play incidents from the API. Team-level aggregate stats (leaders, rankings) are computed from per-game data in the database.

Enabling Sports

  1. Go to API & Import > API Config
  2. In the Sports section, check the sports you want to enable
  3. Click Save Settings

Enabling a sport adds it to admin filters and unlocks import options. Disabling a sport hides it from the admin interface but does not delete existing data — you can re-enable it later and all previously imported data will still be there.

Multi-Sport on One Site

Each sport operates independently:

  • Separate permalink bases/basketball/game/123 and /baseball/game/456 do not conflict
  • Separate statistics tables — basketball and baseball have different stat schemas
  • Separate admin filters — the Games list can be filtered by sport
  • Shared entity tables — teams, players, games share tables but are isolated by sport_id
  • Separate Layout Builder layouts — different page layouts per sport

Display Order: Home vs. Away

The API includes a flag that determines how teams are displayed:

ConventionSportsDisplay
US sportsBasketball, Baseball, Ice Hockey, American FootballAway @ Home (away team listed first)
EuropeanRugby, Cricket, Handball, VolleyballHome vs Away (home team listed first)

This affects game cards, game headers, and all templates. The flag is set per tournament by the API — the plugin reads it and arranges teams accordingly.

API Provider and Sport Availability

ProviderSports
AllSportsAPI2All sports (multi-sport)
BasketAPI1Basketball only
BaseballAPIBaseball only

The provider is a global setting. If you need multiple sports, use AllSportsAPI2. Dedicated providers (BasketAPI1, BaseballAPI) may offer better rate limits for single-sport sites.

📚 Related