Files
NBA_Go/docs/swagger.yaml
T
2025-06-18 22:32:08 -05:00

395 lines
9.3 KiB
YAML
Raw 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/models.PlayerAdvancedStat'
type: array
pagination:
properties:
page:
type: integer
pageSize:
type: integer
pages:
type: integer
total:
type: integer
type: object
type: object
models.PlayerAdvancedStat:
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
id:
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
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/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
/api/playeradvancedstats/scrape:
get:
parameters:
- description: Season (e.g. 2025)
in: query
name: season
required: true
type: integer
- description: Whether playoffs?
in: query
name: isPlayoff
type: boolean
responses:
"200":
description: OK
schema:
additionalProperties:
type: string
type: object
"400":
description: Bad Request
schema:
additionalProperties:
type: string
type: object
"500":
description: Internal Server Error
schema:
additionalProperties:
type: string
type: object
summary: Scrape player advanced stats from BR website
tags:
- PlayerStats
/api/playershotchart:
get:
consumes:
- application/json
description: Returns shot-chart points, optionally filtered by playerId and/or
season
parameters:
- description: Player ID (e.g., hardeja01)
in: query
name: playerId
type: string
- description: Season (e.g., 2023)
in: query
name: season
type: integer
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
/api/playershotchart/scrape:
get:
consumes:
- application/json
description: Scrapes seasons [startSeason…endSeason] for the given playerId
parameters:
- description: Player ID (e.g. derozde01)
in: query
name: playerId
required: true
type: string
- description: Start season (e.g. 2024)
in: query
name: startSeason
required: true
type: integer
- description: End season (e.g. 2021)
in: query
name: endSeason
required: true
type: integer
produces:
- application/json
responses:
"200":
description: OK
schema:
additionalProperties:
type: string
type: object
"400":
description: Bad Request
schema:
additionalProperties:
type: string
type: object
"500":
description: Internal Server Error
schema:
additionalProperties:
type: string
type: object
summary: Scrape a player's shot-chart from BR website
tags:
- PlayerShotChart
/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:
additionalProperties: true
type: object
"500":
description: Internal Server Error
schema:
additionalProperties:
type: string
type: object
summary: Get player total stats
tags:
- PlayerTotals
/api/playertotals/scrape:
get:
parameters:
- description: Season (e.g. 2025)
in: query
name: season
required: true
type: integer
- description: Whether playoffs?
in: query
name: isPlayoff
type: boolean
responses:
"200":
description: OK
schema:
additionalProperties:
type: string
type: object
"400":
description: Bad Request
schema:
additionalProperties:
type: string
type: object
"500":
description: Internal Server Error
schema:
additionalProperties:
type: string
type: object
summary: Scrape player total stats from BR website
tags:
- PlayerTotals
schemes:
- http
- https
swagger: "2.0"