mirror of
https://github.com/nprasad2077/NBA_Go.git
synced 2026-09-22 14:05:13 +00:00
469 lines
15 KiB
JSON
469 lines
15 KiB
JSON
{
|
||
"schemes": [
|
||
"http"
|
||
],
|
||
"swagger": "2.0",
|
||
"info": {
|
||
"description": "Stats service, now with public access!",
|
||
"title": "NBA_Go API",
|
||
"contact": {},
|
||
"version": "1.0"
|
||
},
|
||
"basePath": "/",
|
||
"paths": {
|
||
"/api/playeradvancedstats": {
|
||
"get": {
|
||
"description": "Returns filtered and paginated player advanced stats",
|
||
"consumes": [
|
||
"application/json"
|
||
],
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"PlayerStats"
|
||
],
|
||
"summary": "Get player advanced stats",
|
||
"parameters": [
|
||
{
|
||
"type": "integer",
|
||
"description": "Season (e.g., 2025)",
|
||
"name": "season",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"type": "string",
|
||
"description": "Team abbreviation (e.g., MIL)",
|
||
"name": "team",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"type": "string",
|
||
"description": "Player ID (e.g., greenaj01)",
|
||
"name": "playerId",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"type": "integer",
|
||
"default": 1,
|
||
"description": "Page number",
|
||
"name": "page",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"type": "integer",
|
||
"default": 20,
|
||
"description": "Page size",
|
||
"name": "pageSize",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"type": "string",
|
||
"default": "winShares",
|
||
"description": "Field to sort by",
|
||
"name": "sortBy",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"type": "boolean",
|
||
"default": false,
|
||
"description": "Sort ascending",
|
||
"name": "ascending",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"type": "boolean",
|
||
"description": "Whether playoffs?",
|
||
"name": "isPlayoff",
|
||
"in": "query"
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"$ref": "#/definitions/controllers.AdvancedStatsResponse"
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"type": "object",
|
||
"additionalProperties": {
|
||
"type": "string"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"x-order": 2
|
||
}
|
||
},
|
||
"/api/playershotchart": {
|
||
"get": {
|
||
"description": "Returns a paginated list of shot-chart points, optionally filtered by various parameters.",
|
||
"consumes": [
|
||
"application/json"
|
||
],
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"PlayerShotChart"
|
||
],
|
||
"summary": "Get shot-chart data",
|
||
"parameters": [
|
||
{
|
||
"type": "integer",
|
||
"description": "Page number for pagination (defaults to 1)",
|
||
"name": "page",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"type": "string",
|
||
"description": "Player ID (e.g., hardeja01)",
|
||
"name": "playerId",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"type": "integer",
|
||
"description": "Season (e.g., 2023)",
|
||
"name": "season",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"type": "string",
|
||
"description": "Game date (e.g., Oct 17, 2018)",
|
||
"name": "date",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"type": "string",
|
||
"description": "Quarter (e.g., 1st Qtr)",
|
||
"name": "qtr",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"type": "boolean",
|
||
"description": "Shot result (true for made, false for missed)",
|
||
"name": "result",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"type": "string",
|
||
"description": "Shot type (e.g., 2-pointer)",
|
||
"name": "shot_type",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"type": "string",
|
||
"description": "Opponent team (e.g., NOP)",
|
||
"name": "opponent",
|
||
"in": "query"
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"type": "array",
|
||
"items": {
|
||
"$ref": "#/definitions/models.PlayerShotChart"
|
||
}
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"type": "object",
|
||
"additionalProperties": {
|
||
"type": "string"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"x-order": 3
|
||
}
|
||
},
|
||
"/api/playertotals": {
|
||
"get": {
|
||
"description": "Filter and paginate player totals",
|
||
"consumes": [
|
||
"application/json"
|
||
],
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"PlayerTotals"
|
||
],
|
||
"summary": "Get player total stats",
|
||
"parameters": [
|
||
{
|
||
"type": "integer",
|
||
"description": "Season (e.g. 2000)",
|
||
"name": "season",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"type": "string",
|
||
"description": "Team abbreviation (e.g. LAL)",
|
||
"name": "team",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"type": "string",
|
||
"description": "Player ID (e.g. greenac01)",
|
||
"name": "playerId",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"type": "integer",
|
||
"default": 1,
|
||
"description": "Page number",
|
||
"name": "page",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"type": "integer",
|
||
"default": 20,
|
||
"description": "Page size",
|
||
"name": "pageSize",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"type": "string",
|
||
"description": "Field to sort by (e.g. points, assists)",
|
||
"name": "sortBy",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"type": "boolean",
|
||
"description": "Sort ascending (default false)",
|
||
"name": "ascending",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"type": "boolean",
|
||
"description": "Whether the stats are for playoffs",
|
||
"name": "isPlayoff",
|
||
"in": "query"
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"type": "object",
|
||
"additionalProperties": true
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"schema": {
|
||
"type": "object",
|
||
"additionalProperties": {
|
||
"type": "string"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"x-order": 1
|
||
}
|
||
}
|
||
},
|
||
"definitions": {
|
||
"controllers.AdvancedStatsResponse": {
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"type": "array",
|
||
"items": {
|
||
"$ref": "#/definitions/models.PlayerAdvancedStat"
|
||
}
|
||
},
|
||
"pagination": {
|
||
"type": "object",
|
||
"properties": {
|
||
"page": {
|
||
"type": "integer"
|
||
},
|
||
"pageSize": {
|
||
"type": "integer"
|
||
},
|
||
"pages": {
|
||
"type": "integer"
|
||
},
|
||
"total": {
|
||
"type": "integer"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"models.PlayerAdvancedStat": {
|
||
"type": "object",
|
||
"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"
|
||
}
|
||
}
|
||
},
|
||
"models.PlayerShotChart": {
|
||
"type": "object",
|
||
"properties": {
|
||
"date": {
|
||
"type": "string"
|
||
},
|
||
"distanceFt": {
|
||
"type": "integer"
|
||
},
|
||
"id": {
|
||
"description": "Auto‑increment 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"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"tags": [
|
||
{
|
||
"name": "PlayerTotals"
|
||
},
|
||
{
|
||
"name": "PlayerStats"
|
||
},
|
||
{
|
||
"name": "PlayerShotChart"
|
||
}
|
||
]
|
||
} |