Files
NBA_Go/docs/swagger.yaml

718 lines
16 KiB
YAML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
basePath: /
definitions:
controllers.AdvancedStatsResponse:
properties:
data:
items:
$ref: '#/definitions/controllers.PlayerAdvancedStatDTO'
type: array
pagination:
properties:
page:
type: integer
pageSize:
type: integer
pages:
type: integer
total:
type: integer
type: object
type: object
controllers.GameResponseDTO:
properties:
arena:
type: string
date:
type: string
gameDuration:
type: string
gameId:
description: ID uint `json:"id"`
type: string
homePts:
type: integer
homeTeam:
type: string
isPlayoff:
type: boolean
lineScores:
description: BoxScoreURL string `json:"boxScoreUrl"`
items:
$ref: '#/definitions/controllers.LineScoreDTO'
type: array
playerGameAdvStats:
items:
$ref: '#/definitions/controllers.PlayerGameAdvStatDTO'
type: array
playerGameBasicStats:
items:
$ref: '#/definitions/controllers.PlayerGameBasicStatDTO'
type: array
startTimeET:
type: string
teamGameAdvStats:
items:
$ref: '#/definitions/controllers.TeamGameAdvStatDTO'
type: array
teamGameBasicStats:
items:
$ref: '#/definitions/controllers.TeamGameBasicStatDTO'
type: array
visitorPts:
type: integer
visitorTeam:
type: string
type: object
controllers.GamesResponse:
properties:
data:
items:
$ref: '#/definitions/controllers.GameResponseDTO'
type: array
pagination:
properties:
page:
type: integer
pageSize:
type: integer
pages:
type: integer
total:
type: integer
type: object
type: object
controllers.LineScoreDTO:
properties:
ot1:
type: integer
ot2:
type: integer
ot3:
type: integer
q1:
type: integer
q2:
type: integer
q3:
type: integer
q4:
type: integer
team:
description: Abbreviation
type: string
total:
type: integer
type: object
controllers.PlayerAdvancedStatDTO:
properties:
age:
type: integer
assistPercent:
type: number
blockPercent:
type: number
box:
type: number
defensiveBox:
type: number
defensiveRBPercent:
type: number
defensiveWS:
type: number
ftr:
type: number
games:
type: integer
isPlayoff:
type: boolean
minutesPlayed:
type: integer
offensiveBox:
type: number
offensiveRBPercent:
type: number
offensiveWS:
type: number
per:
type: number
playerId:
type: string
playerName:
type: string
position:
type: string
season:
type: integer
stealPercent:
type: number
team:
type: string
threePAR:
type: number
totalRBPercent:
type: number
tsPercent:
type: number
turnoverPercent:
type: number
usagePercent:
type: number
vorp:
type: number
winShares:
type: number
winSharesPer:
type: number
type: object
controllers.PlayerGameAdvStatDTO:
properties:
astPercent:
type: number
blkPercent:
type: number
bpm:
type: number
dRtg:
type: integer
drbPercent:
type: number
efgPercent:
type: number
fTr:
type: number
mp:
type: string
oRtg:
type: integer
orbPercent:
type: number
playerId:
type: string
playerName:
type: string
stlPercent:
type: number
team:
description: Abbreviation
type: string
threePAr:
type: number
tovPercent:
type: number
trbPercent:
type: number
tsPercent:
type: number
usgPercent:
type: number
type: object
controllers.PlayerGameBasicStatDTO:
properties:
ast:
type: integer
blk:
type: integer
drb:
type: integer
fg:
type: integer
fgPercent:
type: number
fga:
type: integer
ft:
type: integer
ftPercent:
type: number
fta:
type: integer
gmSc:
type: number
mp:
type: string
orb:
type: integer
pf:
type: integer
playerId:
type: string
playerName:
type: string
plusMinus:
type: integer
pts:
type: integer
status:
type: string
stl:
type: integer
team:
description: Abbreviation
type: string
threeP:
type: integer
threePPercent:
type: number
threePa:
type: integer
tov:
type: integer
trb:
type: integer
type: object
controllers.PlayerTotalStatDTO:
properties:
age:
type: integer
assists:
type: integer
blocks:
type: integer
defensiveRb:
type: integer
effectFgPercent:
type: number
fieldAttempts:
type: integer
fieldGoals:
type: integer
fieldPercent:
type: number
ft:
type: integer
ftAttempts:
type: integer
ftPercent:
type: number
games:
type: integer
gamesStarted:
type: integer
isPlayoff:
type: boolean
minutesPg:
type: number
offensiveRb:
type: integer
personalFouls:
type: integer
playerId:
type: string
playerName:
type: string
points:
type: integer
position:
type: string
season:
type: integer
steals:
type: integer
team:
type: string
threeAttempts:
type: integer
threeFg:
type: integer
threePercent:
type: number
totalRb:
type: integer
turnovers:
type: integer
twoAttempts:
type: integer
twoFg:
type: integer
twoPercent:
type: number
type: object
controllers.PlayerTotalsResponse:
properties:
data:
items:
$ref: '#/definitions/controllers.PlayerTotalStatDTO'
type: array
pagination:
properties:
page:
type: integer
pageSize:
type: integer
pages:
type: integer
total:
type: integer
type: object
type: object
controllers.TeamGameAdvStatDTO:
properties:
astPercent:
type: number
blkPercent:
type: number
dRtg:
type: number
drbPercent:
type: number
efgPercent:
type: number
fTr:
type: number
oRtg:
type: number
orbPercent:
type: number
stlPercent:
type: number
team:
description: Abbreviation
type: string
threePAr:
type: number
tovPercent:
type: number
trbPercent:
type: number
tsPercent:
type: number
type: object
controllers.TeamGameBasicStatDTO:
properties:
ast:
type: integer
blk:
type: integer
drb:
type: integer
fg:
type: integer
fgPercent:
type: number
fga:
type: integer
ft:
type: integer
ftPercent:
type: number
fta:
type: integer
orb:
type: integer
pf:
type: integer
pts:
type: integer
stl:
type: integer
team:
description: Abbreviation
type: string
threeP:
type: integer
threePPercent:
type: number
threePa:
type: integer
tov:
type: integer
trb:
type: integer
type: object
models.PlayerShotChart:
properties:
date:
type: string
distanceFt:
type: integer
id:
description: Autoincrement primary key — works in SQLite and any other DB.
type: integer
lead:
type: boolean
left:
type: integer
opponent:
type: string
opponentTeamScore:
type: integer
playerId:
description: ────────── "identity" columns (the dedup key) ──────────
type: string
playerName:
description: ────────── the rest of the payload ──────────
type: string
qtr:
type: string
result:
type: boolean
season:
type: integer
shotType:
type: string
team:
type: string
teamScore:
type: integer
timeRemaining:
type: string
top:
type: integer
type: object
info:
contact: {}
description: Stats service, now with public access!
title: NBA_Go API
version: "1.0"
paths:
/api/games:
get:
description: Returns a paginated list of games with optional filters and included
associations.
parameters:
- description: Filter by date (YYYY-MM-DD)
in: query
name: date
type: string
- description: Filter by team abbreviation (e.g., LAL)
in: query
name: team
type: string
- description: Filter by a specific Game ID
in: query
name: gameId
type: string
- description: Filter for playoff games
in: query
name: isPlayoff
type: boolean
- default: 1
description: Page number
in: query
name: page
type: integer
- default: 20
description: Page size
in: query
name: pageSize
type: integer
- default: date
description: Field to sort by (e.g., date)
in: query
name: sortBy
type: string
- default: false
description: Sort ascending
in: query
name: ascending
type: boolean
- description: Comma-separated list of associations to include (e.g., lineScores,playerGameBasicStats,teamGameAdvStats)
in: query
name: include
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/controllers.GamesResponse'
"400":
description: Bad Request
schema:
additionalProperties:
type: string
type: object
"500":
description: Internal Server Error
schema:
additionalProperties:
type: string
type: object
summary: Get game data
tags:
- Games
/api/playeradvancedstats:
get:
consumes:
- application/json
description: Returns filtered and paginated player advanced stats
parameters:
- description: Season (e.g., 2025)
in: query
name: season
type: integer
- description: Team abbreviation (e.g., MIL)
in: query
name: team
type: string
- description: Player ID (e.g., greenaj01)
in: query
name: playerId
type: string
- default: 1
description: Page number
in: query
name: page
type: integer
- default: 20
description: Page size
in: query
name: pageSize
type: integer
- default: winShares
description: Field to sort by
in: query
name: sortBy
type: string
- default: false
description: Sort ascending
in: query
name: ascending
type: boolean
- description: Whether playoffs?
in: query
name: isPlayoff
type: boolean
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/controllers.AdvancedStatsResponse'
"500":
description: Internal Server Error
schema:
additionalProperties:
type: string
type: object
summary: Get player advanced stats
tags:
- PlayerStats
x-order: 2
/api/playershotchart:
get:
consumes:
- application/json
description: Returns a paginated list of shot-chart points, optionally filtered
by various parameters.
parameters:
- description: Page number for pagination (defaults to 1)
in: query
name: page
type: integer
- description: Player ID (e.g., hardeja01)
in: query
name: playerId
type: string
- description: Season (e.g., 2023)
in: query
name: season
type: integer
- description: Game date (e.g., Oct 17, 2018)
in: query
name: date
type: string
- description: Quarter (e.g., 1st Qtr)
in: query
name: qtr
type: string
- description: Shot result (true for made, false for missed)
in: query
name: result
type: boolean
- description: Shot type (e.g., 2-pointer)
in: query
name: shot_type
type: string
- description: Opponent team (e.g., NOP)
in: query
name: opponent
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
items:
$ref: '#/definitions/models.PlayerShotChart'
type: array
"500":
description: Internal Server Error
schema:
additionalProperties:
type: string
type: object
summary: Get shot-chart data
tags:
- PlayerShotChart
x-order: 3
/api/playertotals:
get:
consumes:
- application/json
description: Filter and paginate player totals
parameters:
- description: Season (e.g. 2000)
in: query
name: season
type: integer
- description: Team abbreviation (e.g. LAL)
in: query
name: team
type: string
- description: Player ID (e.g. greenac01)
in: query
name: playerId
type: string
- default: 1
description: Page number
in: query
name: page
type: integer
- default: 20
description: Page size
in: query
name: pageSize
type: integer
- description: Field to sort by (e.g. points, assists)
in: query
name: sortBy
type: string
- description: Sort ascending (default false)
in: query
name: ascending
type: boolean
- description: Whether the stats are for playoffs
in: query
name: isPlayoff
type: boolean
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/controllers.PlayerTotalsResponse'
"500":
description: Internal Server Error
schema:
additionalProperties:
type: string
type: object
summary: Get player total stats
tags:
- PlayerTotals
x-order: 1
schemes:
- https
- http
swagger: "2.0"
tags:
- name: Games
- name: PlayerTotals
- name: PlayerStats
- name: PlayerShotChart