REST endpoints

Base URL: https://stats-api.ds2.app/api/v1 — every endpoint requires a Bearer token and returns JSON.

Meta

GET/me
Returns account information: plan, rate limit, list of allowed competitions.

Competitions

GET/competitions
Every competition your token has access to.
GET/competitions/{id}/standings
Standings with positions, points and point differential. Authoritative from DScore.
GET/competitions/{id}/schedule
Matches for the competition. Params: time=upcoming|past|all (default upcoming), limit, round.
GET/competitions/{id}/teams
Teams for the current season with club and logo.

Matches

GET/matches/{id}
Match metadata: teams, score, venue, officials, links.
GET/matches/{id}/box-score
Box score per player (Index/PIR + shooting stats) + team totals + shot chart coordinates.
GET/matches/{id}/play-by-play
Chronological events — type, player, period, clock, x/y for shots.

Players

GET/players/{id}
Player profile, per-match stats, career totals, career records by EBR, shot chart.

WebSocket auth

POST/broadcasting/auth
Pusher-compatible signed auth for private channel subscriptions. Called automatically by Echo/Pusher SDKs.

Example: competition ticker

bash
# 1. Fetch upcoming matches
curl "https://stats-api.ds2.app/api/v1/competitions/4/schedule?time=upcoming&limit=10" \
  -H "Authorization: Bearer YOUR_TOKEN"

# 2. For each match, subscribe to private-match.{id} (WebSocket)
# 3. Apply updates to the UI without polling

Response format

Every response is wrapped in { data: ... }. Lists live directly under data (as an array), or paginated with data.data as the inner array.

json
{
  "data": {
    "teams": [
      { "position": 1, "name": "KK Mega Super", "wins": 19, "losses": 2, "points": 40 },
      { "position": 2, "name": "KK Dynamic BG", "wins": 18, "losses": 3, "points": 39 }
    ]
  }
}

Versioning

V1 is stable. Breaking changes (response shape refactors, field renames) ship as a new version /api/v2 with at least 90 days of deprecation notice. New options and fields may be added to V1 without breaking changes.