crawlora-nba 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/CHANGELOG.md +5 -0
- data/LICENSE +21 -0
- data/README.md +110 -0
- data/lib/crawlora/nba/client.rb +476 -0
- data/lib/crawlora/nba/version.rb +5 -0
- data/lib/crawlora/nba.rb +2 -0
- metadata +52 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 6ba752a7a55e9fc5e7a07b425928527fa752674c80d8e6f82929d431e1a353cc
|
|
4
|
+
data.tar.gz: 81f308b78768ff52b0a85e3c3f9e505937519c801d5144007354fc51a31be0d2
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: f369a910b918eebc7f0f02fed2ac6ad8a7efec6a78def1532e8b4e322f32fcfe2be3519b84304993327a43f05b803bc4f9ea66c4658b9e0c4bb9decb6d533bb2
|
|
7
|
+
data.tar.gz: bc94a38f12ca9a69d097b478151c2ff5040bc10a6d3b10c6c15e08f4aaac5e00dbc7e9f2bdce9d09228d0dd64fe55986188f2ce53c908a7aabf38c489065f926
|
data/CHANGELOG.md
ADDED
data/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Crawlora
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
data/README.md
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
# Crawlora NBA API client for Ruby (`crawlora-nba`)
|
|
2
|
+
|
|
3
|
+
This Ruby gem calls Crawlora's hosted NBA API at `https://api.crawlora.net/api/v1`. It exposes 70 endpoints covering games, standings, player and team statistics, play-by-play, and dashboards; it does not call or scrape NBA directly. Requests require your Crawlora API key and use your account's service plan.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```ruby
|
|
8
|
+
gem "crawlora-nba"
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Create an account at [crawlora.net](https://crawlora.net/signup?utm_source=rubygems&utm_medium=referral&utm_campaign=platform-clients&utm_content=nba-ruby-signup), open the [Crawlora console](https://crawlora.net/app?utm_source=rubygems&utm_medium=referral&utm_campaign=platform-clients&utm_content=nba-ruby-console) to get an API key, and set `CRAWLORA_API_KEY` before running the client:
|
|
12
|
+
|
|
13
|
+
```ruby
|
|
14
|
+
require "json"
|
|
15
|
+
require "crawlora/nba"
|
|
16
|
+
|
|
17
|
+
client = Crawlora::Nba::Client.new
|
|
18
|
+
result = client.request("nba-box-score", JSON.parse("{\"game_id\": \"sample\"}"))
|
|
19
|
+
puts result
|
|
20
|
+
client.close
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Use an operation-specific method for normal calls. `request(operation_id, params = {}, response_type: :auto)` is available for every operation. `response_type: :text` returns raw response text. This gem includes 70 API operations.
|
|
24
|
+
|
|
25
|
+
```ruby
|
|
26
|
+
client = Crawlora::Nba::Client.new(api_key: ENV.fetch("CRAWLORA_API_KEY"), timeout: 30)
|
|
27
|
+
# client.<operation_method>(<endpoint parameters>)
|
|
28
|
+
client.close
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Client options include `api_key`, `base_url`, and `timeout`. Ruby stdlib provides the HTTP and JSON support.
|
|
32
|
+
|
|
33
|
+
## Supported NBA API endpoints
|
|
34
|
+
|
|
35
|
+
Browse every route included in this gem. The [endpoint reference](https://github.com/Crawlora-org/crawlora-nba/blob/main/docs/usage.md) includes parameter and response details.
|
|
36
|
+
|
|
37
|
+
| Method | Endpoint | API operation | Description |
|
|
38
|
+
| --- | --- | --- | --- |
|
|
39
|
+
| `GET` | `/nba/box-score` | `nba-box-score` | NBA traditional box score for one game |
|
|
40
|
+
| `GET` | `/nba/box-score-advanced` | `nba-box-score-advanced` | NBA advanced box score for one game |
|
|
41
|
+
| `GET` | `/nba/box-score-defensive` | `nba-box-score-defensive` | NBA defensive box score |
|
|
42
|
+
| `GET` | `/nba/box-score-four-factors` | `nba-box-score-four-factors` | NBA four-factors box score for one game |
|
|
43
|
+
| `GET` | `/nba/box-score-misc` | `nba-box-score-misc` | NBA miscellaneous box score for one game |
|
|
44
|
+
| `GET` | `/nba/box-score-player-track` | `nba-box-score-player-track` | NBA player-tracking box score for one game |
|
|
45
|
+
| `GET` | `/nba/box-score-scoring` | `nba-box-score-scoring` | NBA scoring-distribution box score for one game |
|
|
46
|
+
| `GET` | `/nba/box-score-summary` | `nba-box-score-summary` | Returns the game summary tables for one game: the game summary itself plus the other summary result sets the upstream returns (line scores and officials among them) |
|
|
47
|
+
| `GET` | `/nba/box-score-usage` | `nba-box-score-usage` | NBA usage box score for one game |
|
|
48
|
+
| `GET` | `/nba/common-all-players` | `nba-common-all-players` | NBA league-wide player listing for a season |
|
|
49
|
+
| `GET` | `/nba/draft-combine-anthro` | `nba-draft-combine-anthro` | NBA draft combine anthropometric measurements |
|
|
50
|
+
| `GET` | `/nba/enums` | `nba-enums` | List the pinned NBA request enum values |
|
|
51
|
+
| `GET` | `/nba/franchise-history` | `nba-franchise-history` | NBA franchise history, including defunct teams |
|
|
52
|
+
| `GET` | `/nba/game-detail` | `nba-game-detail` | NBA game summary detail from nba.com |
|
|
53
|
+
| `GET` | `/nba/games` | `nba-games` | Current NBA games from nba.com's own page state |
|
|
54
|
+
| `GET` | `/nba/homepage-leaders` | `nba-homepage-leaders` | NBA homepage leader board |
|
|
55
|
+
| `GET` | `/nba/homepage-v2` | `nba-homepage-v2` | Returns the homepagev2 leader board for one stat type, scope and subject |
|
|
56
|
+
| `GET` | `/nba/hustle-player` | `nba-hustle-player` | Returns the league's player hustle table: contested shots, deflections, charges drawn, screen assists and points, loose balls recovered and box-outs, one row per player |
|
|
57
|
+
| `GET` | `/nba/hustle-stats` | `nba-hustle-stats` | NBA hustle statistics for one game |
|
|
58
|
+
| `GET` | `/nba/hustle-team` | `nba-hustle-team` | Returns the league's team hustle table: contested shots, deflections, charges drawn, screen assists and points, loose balls recovered and box-outs |
|
|
59
|
+
| `GET` | `/nba/league-game-log` | `nba-league-game-log` | NBA game log for a season, by team or by player |
|
|
60
|
+
| `GET` | `/nba/lineup-shot-chart` | `nba-lineup-shot-chart` | Returns the shot chart for one team's five-man lineups: one row per lineup shot with the lineup id, the game, the shooter, the period, action and shot type, the zone, distance, court coordinates and the made flag |
|
|
61
|
+
| `GET` | `/nba/lineups` | `nba-lineups` | NBA lineup dashboard |
|
|
62
|
+
| `GET` | `/nba/news` | `nba-news` | NBA news articles from nba.com |
|
|
63
|
+
| `GET` | `/nba/opp-pt-shot` | `nba-opp-pt-shot` | Returns the league's opponent shooting table: one row per team with the shooting it allows, split overall and from three |
|
|
64
|
+
| `GET` | `/nba/play-by-play` | `nba-play-by-play` | NBA play-by-play for one game |
|
|
65
|
+
| `GET` | `/nba/player-awards` | `nba-player-awards` | NBA player award history |
|
|
66
|
+
| `GET` | `/nba/player-bio-stats` | `nba-player-bio-stats` | NBA league bio table |
|
|
67
|
+
| `GET` | `/nba/player-career-stats` | `nba-player-career-stats` | NBA player season-by-season and career statistics |
|
|
68
|
+
| `GET` | `/nba/player-clutch` | `nba-player-clutch` | Returns the league's clutch player table for one clutch window and score margin: the players' clutch shooting and counting stats |
|
|
69
|
+
| `GET` | `/nba/player-compare` | `nba-player-compare` | NBA two-sided player comparison |
|
|
70
|
+
| `GET` | `/nba/player-dash-by-clutch` | `nba-player-dash-by-clutch` | Returns one player's by clutch splits as several result sets |
|
|
71
|
+
| `GET` | `/nba/player-dash-by-game-splits` | `nba-player-dash-by-game-splits` | Returns one player's by game splits splits as several result sets |
|
|
72
|
+
| `GET` | `/nba/player-dash-by-last-n-games` | `nba-player-dash-by-last-n-games` | Returns one player's by last n games splits as several result sets |
|
|
73
|
+
| `GET` | `/nba/player-dash-by-opponent` | `nba-player-dash-by-opponent` | Returns one player's by opponent splits as several result sets |
|
|
74
|
+
| `GET` | `/nba/player-dash-pt-pass` | `nba-player-dash-pt-pass` | NBA player passing dashboard |
|
|
75
|
+
| `GET` | `/nba/player-dash-pt-reb` | `nba-player-dash-pt-reb` | NBA player rebound dashboard |
|
|
76
|
+
| `GET` | `/nba/player-dash-pt-shots` | `nba-player-dash-pt-shots` | NBA player tracking shot dashboard |
|
|
77
|
+
| `GET` | `/nba/player-game-logs` | `nba-player-game-logs` | Returns one player's game log for a season, one row per game with the player's box-score line |
|
|
78
|
+
| `GET` | `/nba/player-info` | `nba-player-info` | NBA player profile |
|
|
79
|
+
| `GET` | `/nba/player-profile-v2` | `nba-player-profile-v2` | Returns one player's full profile stat set: the season-by-season regular-season line, the career regular-season totals and the postseason equivalents |
|
|
80
|
+
| `GET` | `/nba/player-pt-shot` | `nba-player-pt-shot` | Returns the league's player shooting table: one row per player with the shooting line, split overall and from three |
|
|
81
|
+
| `GET` | `/nba/player-stats` | `nba-player-stats` | NBA league-wide player statistics table |
|
|
82
|
+
| `GET` | `/nba/player-streak-finder` | `nba-player-streak-finder` | Returns player game streaks for a season: the streak rows the upstream computes, one row per streak, with the player identity and streak totals |
|
|
83
|
+
| `GET` | `/nba/players` | `nba-players` | NBA player index: every player id for a season |
|
|
84
|
+
| `GET` | `/nba/playoff-picture` | `nba-playoff-picture` | NBA playoff picture by conference |
|
|
85
|
+
| `GET` | `/nba/playoff-series` | `nba-playoff-series` | NBA playoff series index |
|
|
86
|
+
| `GET` | `/nba/pt-defend` | `nba-pt-defend` | NBA defensive tracking dashboard |
|
|
87
|
+
| `GET` | `/nba/pt-stats` | `nba-pt-stats` | NBA player-tracking dashboard |
|
|
88
|
+
| `GET` | `/nba/scoreboard` | `nba-scoreboard` | NBA scoreboard for one game day |
|
|
89
|
+
| `GET` | `/nba/shot-chart` | `nba-shot-chart` | NBA shot chart |
|
|
90
|
+
| `GET` | `/nba/standings` | `nba-standings` | NBA standings for a season and season type |
|
|
91
|
+
| `GET` | `/nba/synergy-play-types` | `nba-synergy-play-types` | NBA synergy play-type dashboard |
|
|
92
|
+
| `GET` | `/nba/team-dash-by-clutch` | `nba-team-dash-by-clutch` | Returns one team's by clutch splits as several result sets |
|
|
93
|
+
| `GET` | `/nba/team-dash-by-game-splits` | `nba-team-dash-by-game-splits` | Returns one team's by game splits splits as several result sets |
|
|
94
|
+
| `GET` | `/nba/team-dash-by-last-n-games` | `nba-team-dash-by-last-n-games` | Returns one team's by last n games splits as several result sets |
|
|
95
|
+
| `GET` | `/nba/team-dash-by-opponent` | `nba-team-dash-by-opponent` | Returns one team's by opponent splits as several result sets |
|
|
96
|
+
| `GET` | `/nba/team-dash-pt-pass` | `nba-team-dash-pt-pass` | Returns one team's passing dashboard: the pass-type breakdowns the upstream computes for that team, as several result sets |
|
|
97
|
+
| `GET` | `/nba/team-dash-pt-reb` | `nba-team-dash-pt-reb` | NBA team rebound dashboard |
|
|
98
|
+
| `GET` | `/nba/team-dash-pt-shots` | `nba-team-dash-pt-shots` | Returns one team's tracking shot dashboard: the shot breakdowns the upstream computes for that team (by touch time and shot type), as several result sets |
|
|
99
|
+
| `GET` | `/nba/team-details` | `nba-team-details` | NBA franchise background, season history and awards |
|
|
100
|
+
| `GET` | `/nba/team-game-logs` | `nba-team-game-logs` | Returns one team's game log for a season, one row per game with the team's box-score line (field goals, threes, rebounds, assists, steals, blocks, turnovers, points and plus-minus) |
|
|
101
|
+
| `GET` | `/nba/team-info-common` | `nba-team-info-common` | Returns one team's identity and season summary: city, name, abbreviation, code, conference and division, the win/loss record and per-game team averages, plus the team's available seasons |
|
|
102
|
+
| `GET` | `/nba/team-on-off` | `nba-team-on-off` | Returns a team's on-court/off-court player splits: the on-court and off-court rows the upstream computes, with each player's minutes and rating impact |
|
|
103
|
+
| `GET` | `/nba/team-pt-shot` | `nba-team-pt-shot` | Returns the league's team shooting table: one row per team with the shooting line, split overall and from three |
|
|
104
|
+
| `GET` | `/nba/team-roster` | `nba-team-roster` | NBA team roster for a season |
|
|
105
|
+
| `GET` | `/nba/team-shot-locations` | `nba-team-shot-locations` | NBA team shot-location dashboard |
|
|
106
|
+
| `GET` | `/nba/team-stats` | `nba-team-stats` | NBA league-wide team statistics table |
|
|
107
|
+
| `GET` | `/nba/team-stats-leaders` | `nba-team-stats-leaders` | NBA league leaders for one statistical category |
|
|
108
|
+
| `GET` | `/nba/team-years` | `nba-team-years` | Returns every franchise and the range of seasons it has played, one row per team |
|
|
109
|
+
|
|
110
|
+
See [Crawlora](https://crawlora.net/?utm_source=rubygems&utm_medium=referral&utm_campaign=platform-clients&utm_content=nba-ruby-homepage), the [API documentation](https://crawlora.net/docs?utm_source=rubygems&utm_medium=referral&utm_campaign=platform-clients&utm_content=nba-ruby-api-docs), and [the package repository](https://github.com/Crawlora-org/crawlora-nba) for account setup, the API operation reference, and release history.
|
|
@@ -0,0 +1,476 @@
|
|
|
1
|
+
require "json"
|
|
2
|
+
require "net/http"
|
|
3
|
+
require "uri"
|
|
4
|
+
|
|
5
|
+
module Crawlora
|
|
6
|
+
module Nba
|
|
7
|
+
module Errors
|
|
8
|
+
class Error < StandardError
|
|
9
|
+
attr_reader :status, :operation_id, :body
|
|
10
|
+
|
|
11
|
+
def initialize(message, status: nil, operation_id: nil, body: nil)
|
|
12
|
+
super(message)
|
|
13
|
+
@status, @operation_id, @body = status, operation_id, body
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
class ClientError < Error; end
|
|
17
|
+
class ServerError < Error; end
|
|
18
|
+
class NetworkError < Error; end
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
OPERATIONS = JSON.parse(<<~'JSON').freeze
|
|
22
|
+
{"nba-box-score": {"bodyParam": null, "bodyRequired": false, "id": "nba-box-score", "method": "GET", "params": [{"description": "Ten-digit game id from nba-scoreboard", "in": "query", "name": "game_id", "required": true, "type": "string", "x-example": "0022600196"}, {"description": "League id; only 00 (NBA) is verified", "enum": ["00"], "in": "query", "name": "league_id", "type": "string", "x-example": "00"}, {"description": "First period to include, 0 to 14; 0 means from the start example(0)", "in": "query", "name": "start_period", "type": "integer", "x-example": 0}, {"description": "Last period to include, 0 to 14; 0 means through the end example(14)", "in": "query", "name": "end_period", "type": "integer", "x-example": 14}], "path": "/nba/box-score", "pathParams": [], "produces": ["application/json"], "queryParams": [{"in": "query", "name": "game_id", "required": true, "type": "string"}, {"enum": ["00"], "in": "query", "name": "league_id", "type": "string"}, {"in": "query", "name": "start_period", "type": "integer"}, {"in": "query", "name": "end_period", "type": "integer"}], "security": ["ApiKeyAuth"]}, "nba-box-score-advanced": {"bodyParam": null, "bodyRequired": false, "id": "nba-box-score-advanced", "method": "GET", "params": [{"description": "Ten-digit game id from nba-scoreboard", "in": "query", "name": "game_id", "required": true, "type": "string", "x-example": "0022600196"}, {"description": "League id; only 00 (NBA) is verified", "enum": ["00"], "in": "query", "name": "league_id", "type": "string", "x-example": "00"}, {"description": "First period to include, 0 to 14; 0 means from the start", "in": "query", "name": "start_period", "type": "integer", "x-example": 0}, {"description": "Last period to include, 0 to 14; 0 means through the end", "in": "query", "name": "end_period", "type": "integer", "x-example": 14}], "path": "/nba/box-score-advanced", "pathParams": [], "produces": ["application/json"], "queryParams": [{"in": "query", "name": "game_id", "required": true, "type": "string"}, {"enum": ["00"], "in": "query", "name": "league_id", "type": "string"}, {"in": "query", "name": "start_period", "type": "integer"}, {"in": "query", "name": "end_period", "type": "integer"}], "security": ["ApiKeyAuth"]}, "nba-box-score-defensive": {"bodyParam": null, "bodyRequired": false, "id": "nba-box-score-defensive", "method": "GET", "params": [{"description": "Ten-digit game id from nba-scoreboard", "in": "query", "name": "game_id", "required": true, "type": "string", "x-example": "0022600196"}], "path": "/nba/box-score-defensive", "pathParams": [], "produces": ["application/json"], "queryParams": [{"in": "query", "name": "game_id", "required": true, "type": "string"}], "security": ["ApiKeyAuth"]}, "nba-box-score-four-factors": {"bodyParam": null, "bodyRequired": false, "id": "nba-box-score-four-factors", "method": "GET", "params": [{"description": "Ten-digit game id from nba-scoreboard", "in": "query", "name": "game_id", "required": true, "type": "string", "x-example": "0022600196"}, {"description": "League id; only 00 (NBA) is verified", "enum": ["00"], "in": "query", "name": "league_id", "type": "string", "x-example": "00"}, {"description": "First period to include, 0 to 14; 0 means from the start", "in": "query", "name": "start_period", "type": "integer", "x-example": 0}, {"description": "Last period to include, 0 to 14; 0 means through the end", "in": "query", "name": "end_period", "type": "integer", "x-example": 14}], "path": "/nba/box-score-four-factors", "pathParams": [], "produces": ["application/json"], "queryParams": [{"in": "query", "name": "game_id", "required": true, "type": "string"}, {"enum": ["00"], "in": "query", "name": "league_id", "type": "string"}, {"in": "query", "name": "start_period", "type": "integer"}, {"in": "query", "name": "end_period", "type": "integer"}], "security": ["ApiKeyAuth"]}, "nba-box-score-misc": {"bodyParam": null, "bodyRequired": false, "id": "nba-box-score-misc", "method": "GET", "params": [{"description": "Ten-digit game id from nba-scoreboard", "in": "query", "name": "game_id", "required": true, "type": "string", "x-example": "0022600196"}, {"description": "League id; only 00 (NBA) is verified", "enum": ["00"], "in": "query", "name": "league_id", "type": "string", "x-example": "00"}, {"description": "First period to include, 0 to 14; 0 means from the start", "in": "query", "name": "start_period", "type": "integer", "x-example": 0}, {"description": "Last period to include, 0 to 14; 0 means through the end", "in": "query", "name": "end_period", "type": "integer", "x-example": 14}], "path": "/nba/box-score-misc", "pathParams": [], "produces": ["application/json"], "queryParams": [{"in": "query", "name": "game_id", "required": true, "type": "string"}, {"enum": ["00"], "in": "query", "name": "league_id", "type": "string"}, {"in": "query", "name": "start_period", "type": "integer"}, {"in": "query", "name": "end_period", "type": "integer"}], "security": ["ApiKeyAuth"]}, "nba-box-score-player-track": {"bodyParam": null, "bodyRequired": false, "id": "nba-box-score-player-track", "method": "GET", "params": [{"description": "Ten-digit game id from nba-scoreboard", "in": "query", "name": "game_id", "required": true, "type": "string", "x-example": "0022600196"}], "path": "/nba/box-score-player-track", "pathParams": [], "produces": ["application/json"], "queryParams": [{"in": "query", "name": "game_id", "required": true, "type": "string"}], "security": ["ApiKeyAuth"]}, "nba-box-score-scoring": {"bodyParam": null, "bodyRequired": false, "id": "nba-box-score-scoring", "method": "GET", "params": [{"description": "Ten-digit game id from nba-scoreboard", "in": "query", "name": "game_id", "required": true, "type": "string", "x-example": "0022600196"}, {"description": "League id; only 00 (NBA) is verified", "enum": ["00"], "in": "query", "name": "league_id", "type": "string", "x-example": "00"}, {"description": "First period to include, 0 to 14; 0 means from the start", "in": "query", "name": "start_period", "type": "integer", "x-example": 0}, {"description": "Last period to include, 0 to 14; 0 means through the end", "in": "query", "name": "end_period", "type": "integer", "x-example": 14}], "path": "/nba/box-score-scoring", "pathParams": [], "produces": ["application/json"], "queryParams": [{"in": "query", "name": "game_id", "required": true, "type": "string"}, {"enum": ["00"], "in": "query", "name": "league_id", "type": "string"}, {"in": "query", "name": "start_period", "type": "integer"}, {"in": "query", "name": "end_period", "type": "integer"}], "security": ["ApiKeyAuth"]}, "nba-box-score-summary": {"bodyParam": null, "bodyRequired": false, "id": "nba-box-score-summary", "method": "GET", "params": [{"description": "Ten-digit game id from nba-scoreboard", "in": "query", "name": "game_id", "required": true, "type": "string", "x-example": "0022600196"}], "path": "/nba/box-score-summary", "pathParams": [], "produces": ["application/json"], "queryParams": [{"in": "query", "name": "game_id", "required": true, "type": "string"}], "security": ["ApiKeyAuth"]}, "nba-box-score-usage": {"bodyParam": null, "bodyRequired": false, "id": "nba-box-score-usage", "method": "GET", "params": [{"description": "Ten-digit game id from nba-scoreboard", "in": "query", "name": "game_id", "required": true, "type": "string", "x-example": "0022600196"}, {"description": "League id; only 00 (NBA) is verified", "enum": ["00"], "in": "query", "name": "league_id", "type": "string", "x-example": "00"}, {"description": "First period to include, 0 to 14; 0 means from the start", "in": "query", "name": "start_period", "type": "integer", "x-example": 0}, {"description": "Last period to include, 0 to 14; 0 means through the end", "in": "query", "name": "end_period", "type": "integer", "x-example": 14}], "path": "/nba/box-score-usage", "pathParams": [], "produces": ["application/json"], "queryParams": [{"in": "query", "name": "game_id", "required": true, "type": "string"}, {"enum": ["00"], "in": "query", "name": "league_id", "type": "string"}, {"in": "query", "name": "start_period", "type": "integer"}, {"in": "query", "name": "end_period", "type": "integer"}], "security": ["ApiKeyAuth"]}, "nba-common-all-players": {"bodyParam": null, "bodyRequired": false, "id": "nba-common-all-players", "method": "GET", "params": [{"description": "League id; only 00 (NBA) is verified", "enum": ["00"], "in": "query", "name": "league_id", "type": "string", "x-example": "00"}, {"description": "Season in YYYY-YY form; defaults to the current NBA season", "in": "query", "name": "season", "type": "string", "x-example": "2026-27"}, {"description": "When true, only players on a current roster are returned", "in": "query", "name": "is_only_current_season", "type": "boolean"}], "path": "/nba/common-all-players", "pathParams": [], "produces": ["application/json"], "queryParams": [{"enum": ["00"], "in": "query", "name": "league_id", "type": "string"}, {"in": "query", "name": "season", "type": "string"}, {"in": "query", "name": "is_only_current_season", "type": "boolean"}], "security": ["ApiKeyAuth"]}, "nba-draft-combine-anthro": {"bodyParam": null, "bodyRequired": false, "id": "nba-draft-combine-anthro", "method": "GET", "params": [{"description": "Four-digit draft year", "in": "query", "name": "season_year", "required": true, "type": "string", "x-example": "2025"}, {"description": "League id; only 00 (NBA) is verified", "enum": ["00"], "in": "query", "name": "league_id", "type": "string", "x-example": "00"}], "path": "/nba/draft-combine-anthro", "pathParams": [], "produces": ["application/json"], "queryParams": [{"in": "query", "name": "season_year", "required": true, "type": "string"}, {"enum": ["00"], "in": "query", "name": "league_id", "type": "string"}], "security": ["ApiKeyAuth"]}, "nba-enums": {"bodyParam": null, "bodyRequired": false, "id": "nba-enums", "method": "GET", "params": [], "path": "/nba/enums", "pathParams": [], "produces": ["application/json"], "queryParams": [], "security": ["ApiKeyAuth"]}, "nba-franchise-history": {"bodyParam": null, "bodyRequired": false, "id": "nba-franchise-history", "method": "GET", "params": [{"description": "League id; only 00 (NBA) is verified", "enum": ["00"], "in": "query", "name": "league_id", "type": "string", "x-example": "00"}, {"description": "Optional team id from nba-standings; narrows the history to that franchise", "in": "query", "name": "team_id", "type": "integer", "x-example": 1610612741}], "path": "/nba/franchise-history", "pathParams": [], "produces": ["application/json"], "queryParams": [{"enum": ["00"], "in": "query", "name": "league_id", "type": "string"}, {"in": "query", "name": "team_id", "type": "integer"}], "security": ["ApiKeyAuth"]}, "nba-game-detail": {"bodyParam": null, "bodyRequired": false, "id": "nba-game-detail", "method": "GET", "params": [{"description": "Ten-digit game id from nba-scoreboard", "in": "query", "name": "game_id", "required": true, "type": "string", "x-example": "0022600196"}], "path": "/nba/game-detail", "pathParams": [], "produces": ["application/json"], "queryParams": [{"in": "query", "name": "game_id", "required": true, "type": "string"}], "security": ["ApiKeyAuth"]}, "nba-games": {"bodyParam": null, "bodyRequired": false, "id": "nba-games", "method": "GET", "params": [], "path": "/nba/games", "pathParams": [], "produces": ["application/json"], "queryParams": [], "security": ["ApiKeyAuth"]}, "nba-homepage-leaders": {"bodyParam": null, "bodyRequired": false, "id": "nba-homepage-leaders", "method": "GET", "params": [{"description": "League id; only 00 (NBA) is verified", "enum": ["00"], "in": "query", "name": "league_id", "type": "string", "x-example": "00"}, {"description": "Leader category", "enum": ["Points", "Rebounds"], "in": "query", "name": "stat_category", "type": "string", "x-example": "Points"}, {"description": "Subject", "enum": ["Team"], "in": "query", "name": "player_or_team", "type": "string", "x-example": "Team"}, {"description": "Player pool", "in": "query", "name": "player_scope", "type": "string", "x-example": "All Players"}, {"description": "Game window", "enum": ["Season"], "in": "query", "name": "game_scope", "type": "string", "x-example": "Season"}], "path": "/nba/homepage-leaders", "pathParams": [], "produces": ["application/json"], "queryParams": [{"enum": ["00"], "in": "query", "name": "league_id", "type": "string"}, {"enum": ["Points", "Rebounds"], "in": "query", "name": "stat_category", "type": "string"}, {"enum": ["Team"], "in": "query", "name": "player_or_team", "type": "string"}, {"in": "query", "name": "player_scope", "type": "string"}, {"enum": ["Season"], "in": "query", "name": "game_scope", "type": "string"}], "security": ["ApiKeyAuth"]}, "nba-homepage-v2": {"bodyParam": null, "bodyRequired": false, "id": "nba-homepage-v2", "method": "GET", "params": [{"description": "League id; only 00 (NBA) is verified", "enum": ["00"], "in": "query", "name": "league_id", "type": "string", "x-example": "00"}, {"description": "Season in YYYY-YY form; defaults to the current season", "in": "query", "name": "season", "type": "string", "x-example": "2026-27"}, {"description": "Season type", "enum": ["Regular Season"], "in": "query", "name": "season_type", "type": "string", "x-example": "Regular Season"}, {"description": "Game window; only Season is verified", "enum": ["Season"], "in": "query", "name": "game_scope", "type": "string", "x-example": "Season"}, {"description": "Player pool; only All Players is verified", "in": "query", "name": "player_scope", "type": "string", "x-example": "All Players"}, {"description": "Subject; only Player is verified here", "enum": ["Player"], "in": "query", "name": "player_or_team", "type": "string", "x-example": "Player"}, {"description": "Statistic family; only Traditional is verified", "enum": ["Traditional"], "in": "query", "name": "stat_type", "type": "string", "x-example": "Traditional"}], "path": "/nba/homepage-v2", "pathParams": [], "produces": ["application/json"], "queryParams": [{"enum": ["00"], "in": "query", "name": "league_id", "type": "string"}, {"in": "query", "name": "season", "type": "string"}, {"enum": ["Regular Season"], "in": "query", "name": "season_type", "type": "string"}, {"enum": ["Season"], "in": "query", "name": "game_scope", "type": "string"}, {"in": "query", "name": "player_scope", "type": "string"}, {"enum": ["Player"], "in": "query", "name": "player_or_team", "type": "string"}, {"enum": ["Traditional"], "in": "query", "name": "stat_type", "type": "string"}], "security": ["ApiKeyAuth"]}, "nba-hustle-player": {"bodyParam": null, "bodyRequired": false, "id": "nba-hustle-player", "method": "GET", "params": [{"description": "League id; only 00 (NBA) is verified", "enum": ["00"], "in": "query", "name": "league_id", "type": "string", "x-example": "00"}, {"description": "Season in YYYY-YY form; defaults to the current season", "in": "query", "name": "season", "type": "string", "x-example": "2026-27"}, {"description": "Season type", "enum": ["Regular Season"], "in": "query", "name": "season_type", "type": "string", "x-example": "Regular Season"}, {"description": "Aggregation", "enum": ["PerGame"], "in": "query", "name": "per_mode", "type": "string", "x-example": "PerGame"}], "path": "/nba/hustle-player", "pathParams": [], "produces": ["application/json"], "queryParams": [{"enum": ["00"], "in": "query", "name": "league_id", "type": "string"}, {"in": "query", "name": "season", "type": "string"}, {"enum": ["Regular Season"], "in": "query", "name": "season_type", "type": "string"}, {"enum": ["PerGame"], "in": "query", "name": "per_mode", "type": "string"}], "security": ["ApiKeyAuth"]}, "nba-hustle-stats": {"bodyParam": null, "bodyRequired": false, "id": "nba-hustle-stats", "method": "GET", "params": [{"description": "Ten-digit game id from nba-scoreboard", "in": "query", "name": "game_id", "required": true, "type": "string", "x-example": "0022600196"}], "path": "/nba/hustle-stats", "pathParams": [], "produces": ["application/json"], "queryParams": [{"in": "query", "name": "game_id", "required": true, "type": "string"}], "security": ["ApiKeyAuth"]}, "nba-hustle-team": {"bodyParam": null, "bodyRequired": false, "id": "nba-hustle-team", "method": "GET", "params": [{"description": "Optional league id; only 00 (NBA) is verified.", "enum": ["00"], "in": "query", "name": "league_id", "type": "string"}, {"description": "Optional season in YYYY-YY form; defaults to the current NBA season.", "in": "query", "name": "season", "type": "string"}, {"description": "Optional season type.", "enum": ["Regular Season", "Playoffs", "Pre Season", "All Star"], "in": "query", "name": "season_type", "type": "string"}, {"description": "Optional aggregation.", "enum": ["PerGame", "Totals", "Per36", "Per48", "Per100Possessions", "MinutesPer", "PerPossession"], "in": "query", "name": "per_mode", "type": "string"}], "path": "/nba/hustle-team", "pathParams": [], "produces": ["application/json"], "queryParams": [{"enum": ["00"], "in": "query", "name": "league_id", "type": "string"}, {"in": "query", "name": "season", "type": "string"}, {"enum": ["Regular Season", "Playoffs", "Pre Season", "All Star"], "in": "query", "name": "season_type", "type": "string"}, {"enum": ["PerGame", "Totals", "Per36", "Per48", "Per100Possessions", "MinutesPer", "PerPossession"], "in": "query", "name": "per_mode", "type": "string"}], "security": ["ApiKeyAuth"]}, "nba-league-game-log": {"bodyParam": null, "bodyRequired": false, "id": "nba-league-game-log", "method": "GET", "params": [{"description": "League id; only 00 (NBA) is verified", "enum": ["00"], "in": "query", "name": "league_id", "type": "string", "x-example": "00"}, {"description": "Season in YYYY-YY form; defaults to the current NBA season", "in": "query", "name": "season", "type": "string", "x-example": "2026-27"}, {"description": "Season type", "enum": ["Regular Season"], "in": "query", "name": "season_type", "type": "string", "x-example": "Regular Season"}, {"description": "Ordering; ASC or DESC", "enum": ["DESC"], "in": "query", "name": "direction", "type": "string", "x-example": "DESC"}, {"description": "T for one row per team, P for one row per player", "enum": ["T"], "in": "query", "name": "player_or_team", "type": "string", "x-example": "T"}, {"description": "Sort key; only DATE is verified", "enum": ["DATE"], "in": "query", "name": "sorter", "type": "string", "x-example": "DATE"}], "path": "/nba/league-game-log", "pathParams": [], "produces": ["application/json"], "queryParams": [{"enum": ["00"], "in": "query", "name": "league_id", "type": "string"}, {"in": "query", "name": "season", "type": "string"}, {"enum": ["Regular Season"], "in": "query", "name": "season_type", "type": "string"}, {"enum": ["DESC"], "in": "query", "name": "direction", "type": "string"}, {"enum": ["T"], "in": "query", "name": "player_or_team", "type": "string"}, {"enum": ["DATE"], "in": "query", "name": "sorter", "type": "string"}], "security": ["ApiKeyAuth"]}, "nba-lineup-shot-chart": {"bodyParam": null, "bodyRequired": false, "id": "nba-lineup-shot-chart", "method": "GET", "params": [{"description": "Team id from nba-standings", "in": "query", "name": "team_id", "required": true, "type": "integer", "x-example": 1610612738}, {"description": "League id; only 00 (NBA) is verified", "enum": ["00"], "in": "query", "name": "league_id", "type": "string", "x-example": "00"}, {"description": "Season in YYYY-YY form; defaults to the current season", "in": "query", "name": "season", "type": "string", "x-example": "2026-27"}, {"description": "Season type", "enum": ["Regular Season"], "in": "query", "name": "season_type", "type": "string", "x-example": "Regular Season"}, {"description": "Shot-chart base event", "enum": ["FGA", "FG_PCT"], "in": "query", "name": "context_measure", "type": "string", "x-example": "FG_PCT"}, {"description": "Lineup size; only 5 is verified", "enum": [5], "in": "query", "name": "group_quantity", "type": "integer", "x-example": 5}, {"description": "Period selector; 0 means the whole game", "in": "query", "name": "period", "type": "integer", "x-example": 0}], "path": "/nba/lineup-shot-chart", "pathParams": [], "produces": ["application/json"], "queryParams": [{"in": "query", "name": "team_id", "required": true, "type": "integer"}, {"enum": ["00"], "in": "query", "name": "league_id", "type": "string"}, {"in": "query", "name": "season", "type": "string"}, {"enum": ["Regular Season"], "in": "query", "name": "season_type", "type": "string"}, {"enum": ["FGA", "FG_PCT"], "in": "query", "name": "context_measure", "type": "string"}, {"enum": ["5"], "in": "query", "name": "group_quantity", "type": "integer"}, {"in": "query", "name": "period", "type": "integer"}], "security": ["ApiKeyAuth"]}, "nba-lineups": {"bodyParam": null, "bodyRequired": false, "id": "nba-lineups", "method": "GET", "params": [{"description": "League id; only 00 (NBA) is verified", "enum": ["00"], "in": "query", "name": "league_id", "type": "string", "x-example": "00"}, {"description": "Season in YYYY-YY form; defaults to the current NBA season", "in": "query", "name": "season", "type": "string", "x-example": "2026-27"}, {"description": "Season type", "enum": ["Regular Season"], "in": "query", "name": "season_type", "type": "string", "x-example": "Regular Season"}, {"description": "Statistic family", "enum": ["Base"], "in": "query", "name": "measure_type", "type": "string", "x-example": "Base"}, {"description": "Aggregation", "enum": ["PerGame"], "in": "query", "name": "per_mode", "type": "string", "x-example": "PerGame"}, {"description": "Lineup size; only 5 is verified", "enum": [5], "in": "query", "name": "group_quantity", "type": "integer", "x-example": 5}], "path": "/nba/lineups", "pathParams": [], "produces": ["application/json"], "queryParams": [{"enum": ["00"], "in": "query", "name": "league_id", "type": "string"}, {"in": "query", "name": "season", "type": "string"}, {"enum": ["Regular Season"], "in": "query", "name": "season_type", "type": "string"}, {"enum": ["Base"], "in": "query", "name": "measure_type", "type": "string"}, {"enum": ["PerGame"], "in": "query", "name": "per_mode", "type": "string"}, {"enum": ["5"], "in": "query", "name": "group_quantity", "type": "integer"}], "security": ["ApiKeyAuth"]}, "nba-news": {"bodyParam": null, "bodyRequired": false, "id": "nba-news", "method": "GET", "params": [], "path": "/nba/news", "pathParams": [], "produces": ["application/json"], "queryParams": [], "security": ["ApiKeyAuth"]}, "nba-opp-pt-shot": {"bodyParam": null, "bodyRequired": false, "id": "nba-opp-pt-shot", "method": "GET", "params": [{"description": "Optional league id; only 00 (NBA) is verified.", "enum": ["00"], "in": "query", "name": "league_id", "type": "string"}, {"description": "Optional season in YYYY-YY form; defaults to the current NBA season.", "in": "query", "name": "season", "type": "string"}, {"description": "Optional season type.", "enum": ["Regular Season", "Playoffs", "Pre Season", "All Star"], "in": "query", "name": "season_type", "type": "string"}, {"description": "Optional aggregation.", "enum": ["PerGame", "Totals", "Per36", "Per48", "Per100Possessions", "MinutesPer", "PerPossession"], "in": "query", "name": "per_mode", "type": "string"}], "path": "/nba/opp-pt-shot", "pathParams": [], "produces": ["application/json"], "queryParams": [{"enum": ["00"], "in": "query", "name": "league_id", "type": "string"}, {"in": "query", "name": "season", "type": "string"}, {"enum": ["Regular Season", "Playoffs", "Pre Season", "All Star"], "in": "query", "name": "season_type", "type": "string"}, {"enum": ["PerGame", "Totals", "Per36", "Per48", "Per100Possessions", "MinutesPer", "PerPossession"], "in": "query", "name": "per_mode", "type": "string"}], "security": ["ApiKeyAuth"]}, "nba-play-by-play": {"bodyParam": null, "bodyRequired": false, "id": "nba-play-by-play", "method": "GET", "params": [{"description": "Ten-digit game id from nba-scoreboard", "in": "query", "name": "game_id", "required": true, "type": "string", "x-example": "0022600196"}, {"description": "First period to include, 0 to 14; 0 means from the start example(0)", "in": "query", "name": "start_period", "type": "integer", "x-example": 0}, {"description": "Last period to include, 0 to 14; 0 means through the end example(14)", "in": "query", "name": "end_period", "type": "integer", "x-example": 14}], "path": "/nba/play-by-play", "pathParams": [], "produces": ["application/json"], "queryParams": [{"in": "query", "name": "game_id", "required": true, "type": "string"}, {"in": "query", "name": "start_period", "type": "integer"}, {"in": "query", "name": "end_period", "type": "integer"}], "security": ["ApiKeyAuth"]}, "nba-player-awards": {"bodyParam": null, "bodyRequired": false, "id": "nba-player-awards", "method": "GET", "params": [{"description": "Player id from nba-players or nba-team-roster", "in": "query", "name": "player_id", "required": true, "type": "integer", "x-example": 1628398}], "path": "/nba/player-awards", "pathParams": [], "produces": ["application/json"], "queryParams": [{"in": "query", "name": "player_id", "required": true, "type": "integer"}], "security": ["ApiKeyAuth"]}, "nba-player-bio-stats": {"bodyParam": null, "bodyRequired": false, "id": "nba-player-bio-stats", "method": "GET", "params": [{"description": "League id; only 00 (NBA) is verified", "enum": ["00"], "in": "query", "name": "league_id", "type": "string", "x-example": "00"}, {"description": "Season in YYYY-YY form; defaults to the current NBA season", "in": "query", "name": "season", "type": "string", "x-example": "2026-27"}, {"description": "Season type", "enum": ["Regular Season"], "in": "query", "name": "season_type", "type": "string", "x-example": "Regular Season"}, {"description": "Aggregation", "enum": ["PerGame"], "in": "query", "name": "per_mode", "type": "string", "x-example": "PerGame"}], "path": "/nba/player-bio-stats", "pathParams": [], "produces": ["application/json"], "queryParams": [{"enum": ["00"], "in": "query", "name": "league_id", "type": "string"}, {"in": "query", "name": "season", "type": "string"}, {"enum": ["Regular Season"], "in": "query", "name": "season_type", "type": "string"}, {"enum": ["PerGame"], "in": "query", "name": "per_mode", "type": "string"}], "security": ["ApiKeyAuth"]}, "nba-player-career-stats": {"bodyParam": null, "bodyRequired": false, "id": "nba-player-career-stats", "method": "GET", "params": [{"description": "Player id from nba-players or nba-team-roster", "in": "query", "name": "player_id", "required": true, "type": "integer", "x-example": 1628398}, {"description": "Aggregation; PerGame or Totals", "enum": ["PerGame"], "in": "query", "name": "per_mode", "type": "string", "x-example": "PerGame"}, {"description": "League id; only 00 (NBA) is verified", "enum": ["00"], "in": "query", "name": "league_id", "type": "string", "x-example": "00"}], "path": "/nba/player-career-stats", "pathParams": [], "produces": ["application/json"], "queryParams": [{"in": "query", "name": "player_id", "required": true, "type": "integer"}, {"enum": ["PerGame"], "in": "query", "name": "per_mode", "type": "string"}, {"enum": ["00"], "in": "query", "name": "league_id", "type": "string"}], "security": ["ApiKeyAuth"]}, "nba-player-clutch": {"bodyParam": null, "bodyRequired": false, "id": "nba-player-clutch", "method": "GET", "params": [{"description": "Optional league id; only 00 (NBA) is verified.", "enum": ["00"], "in": "query", "name": "league_id", "type": "string"}, {"description": "Optional season in YYYY-YY form; defaults to the current NBA season.", "in": "query", "name": "season", "type": "string"}, {"description": "Optional season type.", "enum": ["Regular Season", "Playoffs", "Pre Season", "All Star"], "in": "query", "name": "season_type", "type": "string"}, {"description": "Optional aggregation.", "enum": ["PerGame", "Totals", "Per36", "Per48", "Per100Possessions", "MinutesPer", "PerPossession"], "in": "query", "name": "per_mode", "type": "string"}, {"description": "Optional statistic family.", "enum": ["Base", "Advanced", "Misc", "Scoring", "Defense", "Opponent"], "in": "query", "name": "measure_type", "type": "string"}, {"description": "Optional clutch window; only 'Last 5 Minutes' is verified.", "enum": ["Last 5 Minutes"], "in": "query", "name": "clutch_time", "type": "string"}, {"description": "Optional score-margin filter; only 'Ahead or Behind' is verified.", "enum": ["Ahead or Behind"], "in": "query", "name": "ahead_behind", "type": "string"}, {"description": "Optional point margin; only 5 is verified.", "enum": [5], "in": "query", "name": "point_diff", "type": "integer"}], "path": "/nba/player-clutch", "pathParams": [], "produces": ["application/json"], "queryParams": [{"enum": ["00"], "in": "query", "name": "league_id", "type": "string"}, {"in": "query", "name": "season", "type": "string"}, {"enum": ["Regular Season", "Playoffs", "Pre Season", "All Star"], "in": "query", "name": "season_type", "type": "string"}, {"enum": ["PerGame", "Totals", "Per36", "Per48", "Per100Possessions", "MinutesPer", "PerPossession"], "in": "query", "name": "per_mode", "type": "string"}, {"enum": ["Base", "Advanced", "Misc", "Scoring", "Defense", "Opponent"], "in": "query", "name": "measure_type", "type": "string"}, {"enum": ["Last 5 Minutes"], "in": "query", "name": "clutch_time", "type": "string"}, {"enum": ["Ahead or Behind"], "in": "query", "name": "ahead_behind", "type": "string"}, {"enum": ["5"], "in": "query", "name": "point_diff", "type": "integer"}], "security": ["ApiKeyAuth"]}, "nba-player-compare": {"bodyParam": null, "bodyRequired": false, "id": "nba-player-compare", "method": "GET", "params": [{"collectionFormat": "multi", "description": "Player ids for the left side; repeated or comma-separated", "in": "query", "items": {"type": "string"}, "name": "player_ids", "required": true, "type": "array", "x-example": "1628398"}, {"collectionFormat": "multi", "description": "Player ids for the right side; repeated or comma-separated", "in": "query", "items": {"type": "string"}, "name": "vs_player_ids", "required": true, "type": "array", "x-example": "2544"}, {"description": "League id; only 00 (NBA) is verified", "enum": ["00"], "in": "query", "name": "league_id", "type": "string", "x-example": "00"}, {"description": "Season in YYYY-YY form; defaults to the current season", "in": "query", "name": "season", "type": "string", "x-example": "2026-27"}, {"description": "Season type", "enum": ["Regular Season", "Playoffs", "Pre Season", "All Star"], "in": "query", "name": "season_type", "type": "string", "x-example": "Regular Season"}, {"description": "Aggregation", "enum": ["PerGame", "Totals", "Per36", "Per48", "Per100Possessions", "MinutesPer", "PerPossession"], "in": "query", "name": "per_mode", "type": "string", "x-example": "PerGame"}, {"description": "Statistic family; required upstream", "enum": ["Base", "Advanced", "Misc", "Scoring", "Defense", "Opponent"], "in": "query", "name": "measure_type", "type": "string", "x-example": "Base"}], "path": "/nba/player-compare", "pathParams": [], "produces": ["application/json"], "queryParams": [{"collectionFormat": "multi", "in": "query", "name": "player_ids", "required": true, "type": "array"}, {"collectionFormat": "multi", "in": "query", "name": "vs_player_ids", "required": true, "type": "array"}, {"enum": ["00"], "in": "query", "name": "league_id", "type": "string"}, {"in": "query", "name": "season", "type": "string"}, {"enum": ["Regular Season", "Playoffs", "Pre Season", "All Star"], "in": "query", "name": "season_type", "type": "string"}, {"enum": ["PerGame", "Totals", "Per36", "Per48", "Per100Possessions", "MinutesPer", "PerPossession"], "in": "query", "name": "per_mode", "type": "string"}, {"enum": ["Base", "Advanced", "Misc", "Scoring", "Defense", "Opponent"], "in": "query", "name": "measure_type", "type": "string"}], "security": ["ApiKeyAuth"]}, "nba-player-dash-by-clutch": {"bodyParam": null, "bodyRequired": false, "id": "nba-player-dash-by-clutch", "method": "GET", "params": [{"description": "Player id from nba-players or nba-team-roster", "in": "query", "name": "player_id", "required": true, "type": "integer", "x-example": 1628398}, {"description": "League id; only 00 (NBA) is verified", "enum": ["00"], "in": "query", "name": "league_id", "type": "string", "x-example": "00"}, {"description": "Season in YYYY-YY form; defaults to the current season", "in": "query", "name": "season", "type": "string", "x-example": "2026-27"}, {"description": "Season type", "enum": ["Regular Season"], "in": "query", "name": "season_type", "type": "string", "x-example": "Regular Season"}, {"description": "Aggregation", "enum": ["PerGame"], "in": "query", "name": "per_mode", "type": "string", "x-example": "PerGame"}, {"description": "Statistic family; required upstream", "enum": ["Base", "Advanced", "Misc", "Scoring", "Defense", "Opponent"], "in": "query", "name": "measure_type", "type": "string", "x-example": "Base"}], "path": "/nba/player-dash-by-clutch", "pathParams": [], "produces": ["application/json"], "queryParams": [{"in": "query", "name": "player_id", "required": true, "type": "integer"}, {"enum": ["00"], "in": "query", "name": "league_id", "type": "string"}, {"in": "query", "name": "season", "type": "string"}, {"enum": ["Regular Season"], "in": "query", "name": "season_type", "type": "string"}, {"enum": ["PerGame"], "in": "query", "name": "per_mode", "type": "string"}, {"enum": ["Base", "Advanced", "Misc", "Scoring", "Defense", "Opponent"], "in": "query", "name": "measure_type", "type": "string"}], "security": ["ApiKeyAuth"]}, "nba-player-dash-by-game-splits": {"bodyParam": null, "bodyRequired": false, "id": "nba-player-dash-by-game-splits", "method": "GET", "params": [{"description": "Player id from nba-players or nba-team-roster", "in": "query", "name": "player_id", "required": true, "type": "integer", "x-example": 1628398}, {"description": "League id; only 00 (NBA) is verified", "enum": ["00"], "in": "query", "name": "league_id", "type": "string", "x-example": "00"}, {"description": "Season in YYYY-YY form; defaults to the current season", "in": "query", "name": "season", "type": "string", "x-example": "2026-27"}, {"description": "Season type", "enum": ["Regular Season"], "in": "query", "name": "season_type", "type": "string", "x-example": "Regular Season"}, {"description": "Aggregation", "enum": ["PerGame"], "in": "query", "name": "per_mode", "type": "string", "x-example": "PerGame"}, {"description": "Statistic family; required upstream", "enum": ["Base", "Advanced", "Misc", "Scoring", "Defense", "Opponent"], "in": "query", "name": "measure_type", "type": "string", "x-example": "Base"}], "path": "/nba/player-dash-by-game-splits", "pathParams": [], "produces": ["application/json"], "queryParams": [{"in": "query", "name": "player_id", "required": true, "type": "integer"}, {"enum": ["00"], "in": "query", "name": "league_id", "type": "string"}, {"in": "query", "name": "season", "type": "string"}, {"enum": ["Regular Season"], "in": "query", "name": "season_type", "type": "string"}, {"enum": ["PerGame"], "in": "query", "name": "per_mode", "type": "string"}, {"enum": ["Base", "Advanced", "Misc", "Scoring", "Defense", "Opponent"], "in": "query", "name": "measure_type", "type": "string"}], "security": ["ApiKeyAuth"]}, "nba-player-dash-by-last-n-games": {"bodyParam": null, "bodyRequired": false, "id": "nba-player-dash-by-last-n-games", "method": "GET", "params": [{"description": "Player id from nba-players or nba-team-roster", "in": "query", "name": "player_id", "required": true, "type": "integer", "x-example": 1628398}, {"description": "League id; only 00 (NBA) is verified", "enum": ["00"], "in": "query", "name": "league_id", "type": "string", "x-example": "00"}, {"description": "Season in YYYY-YY form; defaults to the current season", "in": "query", "name": "season", "type": "string", "x-example": "2026-27"}, {"description": "Season type", "enum": ["Regular Season"], "in": "query", "name": "season_type", "type": "string", "x-example": "Regular Season"}, {"description": "Aggregation", "enum": ["PerGame"], "in": "query", "name": "per_mode", "type": "string", "x-example": "PerGame"}, {"description": "Statistic family; required upstream", "enum": ["Base", "Advanced", "Misc", "Scoring", "Defense", "Opponent"], "in": "query", "name": "measure_type", "type": "string", "x-example": "Base"}], "path": "/nba/player-dash-by-last-n-games", "pathParams": [], "produces": ["application/json"], "queryParams": [{"in": "query", "name": "player_id", "required": true, "type": "integer"}, {"enum": ["00"], "in": "query", "name": "league_id", "type": "string"}, {"in": "query", "name": "season", "type": "string"}, {"enum": ["Regular Season"], "in": "query", "name": "season_type", "type": "string"}, {"enum": ["PerGame"], "in": "query", "name": "per_mode", "type": "string"}, {"enum": ["Base", "Advanced", "Misc", "Scoring", "Defense", "Opponent"], "in": "query", "name": "measure_type", "type": "string"}], "security": ["ApiKeyAuth"]}, "nba-player-dash-by-opponent": {"bodyParam": null, "bodyRequired": false, "id": "nba-player-dash-by-opponent", "method": "GET", "params": [{"description": "Player id from nba-players or nba-team-roster", "in": "query", "name": "player_id", "required": true, "type": "integer", "x-example": 1628398}, {"description": "League id; only 00 (NBA) is verified", "enum": ["00"], "in": "query", "name": "league_id", "type": "string", "x-example": "00"}, {"description": "Season in YYYY-YY form; defaults to the current season", "in": "query", "name": "season", "type": "string", "x-example": "2026-27"}, {"description": "Season type", "enum": ["Regular Season"], "in": "query", "name": "season_type", "type": "string", "x-example": "Regular Season"}, {"description": "Aggregation", "enum": ["PerGame"], "in": "query", "name": "per_mode", "type": "string", "x-example": "PerGame"}, {"description": "Statistic family; required upstream", "enum": ["Base", "Advanced", "Misc", "Scoring", "Defense", "Opponent"], "in": "query", "name": "measure_type", "type": "string", "x-example": "Base"}], "path": "/nba/player-dash-by-opponent", "pathParams": [], "produces": ["application/json"], "queryParams": [{"in": "query", "name": "player_id", "required": true, "type": "integer"}, {"enum": ["00"], "in": "query", "name": "league_id", "type": "string"}, {"in": "query", "name": "season", "type": "string"}, {"enum": ["Regular Season"], "in": "query", "name": "season_type", "type": "string"}, {"enum": ["PerGame"], "in": "query", "name": "per_mode", "type": "string"}, {"enum": ["Base", "Advanced", "Misc", "Scoring", "Defense", "Opponent"], "in": "query", "name": "measure_type", "type": "string"}], "security": ["ApiKeyAuth"]}, "nba-player-dash-pt-pass": {"bodyParam": null, "bodyRequired": false, "id": "nba-player-dash-pt-pass", "method": "GET", "params": [{"description": "Player id from nba-players or nba-team-roster", "in": "query", "name": "player_id", "required": true, "type": "integer", "x-example": 1628398}, {"description": "League id; only 00 (NBA) is verified", "enum": ["00"], "in": "query", "name": "league_id", "type": "string", "x-example": "00"}, {"description": "Season in YYYY-YY form; defaults to the current season", "in": "query", "name": "season", "type": "string", "x-example": "2026-27"}, {"description": "Season type", "enum": ["Regular Season"], "in": "query", "name": "season_type", "type": "string", "x-example": "Regular Season"}, {"description": "Aggregation", "enum": ["PerGame"], "in": "query", "name": "per_mode", "type": "string", "x-example": "PerGame"}], "path": "/nba/player-dash-pt-pass", "pathParams": [], "produces": ["application/json"], "queryParams": [{"in": "query", "name": "player_id", "required": true, "type": "integer"}, {"enum": ["00"], "in": "query", "name": "league_id", "type": "string"}, {"in": "query", "name": "season", "type": "string"}, {"enum": ["Regular Season"], "in": "query", "name": "season_type", "type": "string"}, {"enum": ["PerGame"], "in": "query", "name": "per_mode", "type": "string"}], "security": ["ApiKeyAuth"]}, "nba-player-dash-pt-reb": {"bodyParam": null, "bodyRequired": false, "id": "nba-player-dash-pt-reb", "method": "GET", "params": [{"description": "Player id from nba-players or nba-team-roster", "in": "query", "name": "player_id", "required": true, "type": "integer", "x-example": 1628398}, {"description": "League id; only 00 (NBA) is verified", "enum": ["00"], "in": "query", "name": "league_id", "type": "string", "x-example": "00"}, {"description": "Season in YYYY-YY form; defaults to the current season", "in": "query", "name": "season", "type": "string", "x-example": "2026-27"}, {"description": "Season type", "enum": ["Regular Season"], "in": "query", "name": "season_type", "type": "string", "x-example": "Regular Season"}, {"description": "Aggregation", "enum": ["PerGame"], "in": "query", "name": "per_mode", "type": "string", "x-example": "PerGame"}], "path": "/nba/player-dash-pt-reb", "pathParams": [], "produces": ["application/json"], "queryParams": [{"in": "query", "name": "player_id", "required": true, "type": "integer"}, {"enum": ["00"], "in": "query", "name": "league_id", "type": "string"}, {"in": "query", "name": "season", "type": "string"}, {"enum": ["Regular Season"], "in": "query", "name": "season_type", "type": "string"}, {"enum": ["PerGame"], "in": "query", "name": "per_mode", "type": "string"}], "security": ["ApiKeyAuth"]}, "nba-player-dash-pt-shots": {"bodyParam": null, "bodyRequired": false, "id": "nba-player-dash-pt-shots", "method": "GET", "params": [{"description": "Player id from nba-players or nba-team-roster", "in": "query", "name": "player_id", "required": true, "type": "integer", "x-example": 1628398}, {"description": "League id; only 00 (NBA) is verified", "enum": ["00"], "in": "query", "name": "league_id", "type": "string", "x-example": "00"}, {"description": "Season in YYYY-YY form; defaults to the current NBA season", "in": "query", "name": "season", "type": "string", "x-example": "2026-27"}, {"description": "Season type", "enum": ["Regular Season"], "in": "query", "name": "season_type", "type": "string", "x-example": "Regular Season"}, {"description": "Aggregation", "enum": ["PerGame"], "in": "query", "name": "per_mode", "type": "string", "x-example": "PerGame"}], "path": "/nba/player-dash-pt-shots", "pathParams": [], "produces": ["application/json"], "queryParams": [{"in": "query", "name": "player_id", "required": true, "type": "integer"}, {"enum": ["00"], "in": "query", "name": "league_id", "type": "string"}, {"in": "query", "name": "season", "type": "string"}, {"enum": ["Regular Season"], "in": "query", "name": "season_type", "type": "string"}, {"enum": ["PerGame"], "in": "query", "name": "per_mode", "type": "string"}], "security": ["ApiKeyAuth"]}, "nba-player-game-logs": {"bodyParam": null, "bodyRequired": false, "id": "nba-player-game-logs", "method": "GET", "params": [{"description": "Optional league id; only 00 (NBA) is verified.", "enum": ["00"], "in": "query", "name": "league_id", "type": "string"}, {"description": "Optional season in YYYY-YY form; defaults to the current NBA season.", "in": "query", "name": "season", "type": "string"}, {"description": "Optional season type.", "enum": ["Regular Season", "Playoffs", "Pre Season", "All Star"], "in": "query", "name": "season_type", "type": "string"}, {"description": "Required player id from nba-players or nba-team-roster.", "in": "query", "name": "player_id", "required": true, "type": "integer"}], "path": "/nba/player-game-logs", "pathParams": [], "produces": ["application/json"], "queryParams": [{"enum": ["00"], "in": "query", "name": "league_id", "type": "string"}, {"in": "query", "name": "season", "type": "string"}, {"enum": ["Regular Season", "Playoffs", "Pre Season", "All Star"], "in": "query", "name": "season_type", "type": "string"}, {"in": "query", "name": "player_id", "required": true, "type": "integer"}], "security": ["ApiKeyAuth"]}, "nba-player-info": {"bodyParam": null, "bodyRequired": false, "id": "nba-player-info", "method": "GET", "params": [{"description": "Player id from nba-players or nba-team-roster", "in": "query", "name": "player_id", "required": true, "type": "integer", "x-example": 1628398}, {"description": "League id; only 00 (NBA) is verified", "enum": ["00"], "in": "query", "name": "league_id", "type": "string", "x-example": "00"}], "path": "/nba/player-info", "pathParams": [], "produces": ["application/json"], "queryParams": [{"in": "query", "name": "player_id", "required": true, "type": "integer"}, {"enum": ["00"], "in": "query", "name": "league_id", "type": "string"}], "security": ["ApiKeyAuth"]}, "nba-player-profile-v2": {"bodyParam": null, "bodyRequired": false, "id": "nba-player-profile-v2", "method": "GET", "params": [{"description": "Required player id from nba-players or nba-team-roster.", "in": "query", "name": "player_id", "required": true, "type": "integer"}, {"description": "Optional aggregation.", "enum": ["PerGame", "Totals", "Per36", "Per48", "Per100Possessions", "MinutesPer", "PerPossession"], "in": "query", "name": "per_mode", "type": "string"}], "path": "/nba/player-profile-v2", "pathParams": [], "produces": ["application/json"], "queryParams": [{"in": "query", "name": "player_id", "required": true, "type": "integer"}, {"enum": ["PerGame", "Totals", "Per36", "Per48", "Per100Possessions", "MinutesPer", "PerPossession"], "in": "query", "name": "per_mode", "type": "string"}], "security": ["ApiKeyAuth"]}, "nba-player-pt-shot": {"bodyParam": null, "bodyRequired": false, "id": "nba-player-pt-shot", "method": "GET", "params": [{"description": "Optional league id; only 00 (NBA) is verified.", "enum": ["00"], "in": "query", "name": "league_id", "type": "string"}, {"description": "Optional season in YYYY-YY form; defaults to the current NBA season.", "in": "query", "name": "season", "type": "string"}, {"description": "Optional season type.", "enum": ["Regular Season", "Playoffs", "Pre Season", "All Star"], "in": "query", "name": "season_type", "type": "string"}, {"description": "Optional aggregation.", "enum": ["PerGame", "Totals", "Per36", "Per48", "Per100Possessions", "MinutesPer", "PerPossession"], "in": "query", "name": "per_mode", "type": "string"}], "path": "/nba/player-pt-shot", "pathParams": [], "produces": ["application/json"], "queryParams": [{"enum": ["00"], "in": "query", "name": "league_id", "type": "string"}, {"in": "query", "name": "season", "type": "string"}, {"enum": ["Regular Season", "Playoffs", "Pre Season", "All Star"], "in": "query", "name": "season_type", "type": "string"}, {"enum": ["PerGame", "Totals", "Per36", "Per48", "Per100Possessions", "MinutesPer", "PerPossession"], "in": "query", "name": "per_mode", "type": "string"}], "security": ["ApiKeyAuth"]}, "nba-player-stats": {"bodyParam": null, "bodyRequired": false, "id": "nba-player-stats", "method": "GET", "params": [{"description": "League id; only 00 (NBA) is verified", "enum": ["00"], "in": "query", "name": "league_id", "type": "string", "x-example": "00"}, {"description": "Season in YYYY-YY form; defaults to the current NBA season", "in": "query", "name": "season", "type": "string", "x-example": "2026-27"}, {"description": "Season type; Regular Season or Playoffs", "enum": ["Regular Season", "Playoffs", "Pre Season", "All Star"], "in": "query", "name": "season_type", "type": "string", "x-example": "Regular Season"}, {"description": "Statistic family; Base or Advanced", "enum": ["Base", "Advanced", "Misc", "Scoring", "Defense", "Opponent"], "in": "query", "name": "measure_type", "type": "string", "x-example": "Base"}, {"description": "Aggregation; PerGame or Totals", "enum": ["PerGame", "Totals", "Per36", "Per48", "Per100Possessions", "MinutesPer", "PerPossession"], "in": "query", "name": "per_mode", "type": "string", "x-example": "PerGame"}], "path": "/nba/player-stats", "pathParams": [], "produces": ["application/json"], "queryParams": [{"enum": ["00"], "in": "query", "name": "league_id", "type": "string"}, {"in": "query", "name": "season", "type": "string"}, {"enum": ["Regular Season", "Playoffs", "Pre Season", "All Star"], "in": "query", "name": "season_type", "type": "string"}, {"enum": ["Base", "Advanced", "Misc", "Scoring", "Defense", "Opponent"], "in": "query", "name": "measure_type", "type": "string"}, {"enum": ["PerGame", "Totals", "Per36", "Per48", "Per100Possessions", "MinutesPer", "PerPossession"], "in": "query", "name": "per_mode", "type": "string"}], "security": ["ApiKeyAuth"]}, "nba-player-streak-finder": {"bodyParam": null, "bodyRequired": false, "id": "nba-player-streak-finder", "method": "GET", "params": [{"description": "Optional league id; only 00 (NBA) is verified.", "enum": ["00"], "in": "query", "name": "league_id", "type": "string"}, {"description": "Optional season in YYYY-YY form; defaults to the current NBA season.", "in": "query", "name": "season", "type": "string"}, {"description": "Optional season type.", "enum": ["Regular Season", "Playoffs", "Pre Season", "All Star"], "in": "query", "name": "season_type", "type": "string"}, {"description": "Optional player id from nba-players; narrows the streaks to one player.", "in": "query", "name": "player_id", "type": "integer"}, {"description": "Optional minimum streak length in games.", "in": "query", "name": "min_games", "type": "integer"}], "path": "/nba/player-streak-finder", "pathParams": [], "produces": ["application/json"], "queryParams": [{"enum": ["00"], "in": "query", "name": "league_id", "type": "string"}, {"in": "query", "name": "season", "type": "string"}, {"enum": ["Regular Season", "Playoffs", "Pre Season", "All Star"], "in": "query", "name": "season_type", "type": "string"}, {"in": "query", "name": "player_id", "type": "integer"}, {"in": "query", "name": "min_games", "type": "integer"}], "security": ["ApiKeyAuth"]}, "nba-players": {"bodyParam": null, "bodyRequired": false, "id": "nba-players", "method": "GET", "params": [{"description": "League id; only 00 (NBA) is verified", "enum": ["00"], "in": "query", "name": "league_id", "type": "string", "x-example": "00"}, {"description": "Season in YYYY-YY form; defaults to the current NBA season", "in": "query", "name": "season", "type": "string", "x-example": "2026-27"}, {"description": "Optional team id from nba-standings; narrows the index to that roster example(1610612741)", "in": "query", "name": "team_id", "type": "integer", "x-example": 1610612741}, {"description": "When true, keep only players active in the season", "in": "query", "name": "active", "type": "boolean"}], "path": "/nba/players", "pathParams": [], "produces": ["application/json"], "queryParams": [{"enum": ["00"], "in": "query", "name": "league_id", "type": "string"}, {"in": "query", "name": "season", "type": "string"}, {"in": "query", "name": "team_id", "type": "integer"}, {"in": "query", "name": "active", "type": "boolean"}], "security": ["ApiKeyAuth"]}, "nba-playoff-picture": {"bodyParam": null, "bodyRequired": false, "id": "nba-playoff-picture", "method": "GET", "params": [{"description": "League id; only 00 (NBA) is verified", "enum": ["00"], "in": "query", "name": "league_id", "type": "string", "x-example": "00"}, {"description": "Five-digit season id such as 22026; defaults to the current season", "in": "query", "name": "season_id", "type": "string", "x-example": "22026"}], "path": "/nba/playoff-picture", "pathParams": [], "produces": ["application/json"], "queryParams": [{"enum": ["00"], "in": "query", "name": "league_id", "type": "string"}, {"in": "query", "name": "season_id", "type": "string"}], "security": ["ApiKeyAuth"]}, "nba-playoff-series": {"bodyParam": null, "bodyRequired": false, "id": "nba-playoff-series", "method": "GET", "params": [{"description": "League id; only 00 (NBA) is verified", "enum": ["00"], "in": "query", "name": "league_id", "type": "string", "x-example": "00"}, {"description": "Season in YYYY-YY form; defaults to the current season", "in": "query", "name": "season", "type": "string", "x-example": "2026-27"}], "path": "/nba/playoff-series", "pathParams": [], "produces": ["application/json"], "queryParams": [{"enum": ["00"], "in": "query", "name": "league_id", "type": "string"}, {"in": "query", "name": "season", "type": "string"}], "security": ["ApiKeyAuth"]}, "nba-pt-defend": {"bodyParam": null, "bodyRequired": false, "id": "nba-pt-defend", "method": "GET", "params": [{"description": "League id; only 00 (NBA) is verified", "enum": ["00"], "in": "query", "name": "league_id", "type": "string", "x-example": "00"}, {"description": "Season in YYYY-YY form; defaults to the current NBA season", "in": "query", "name": "season", "type": "string", "x-example": "2026-27"}, {"description": "Season type", "enum": ["Regular Season"], "in": "query", "name": "season_type", "type": "string", "x-example": "Regular Season"}, {"description": "Aggregation", "enum": ["PerGame"], "in": "query", "name": "per_mode", "type": "string", "x-example": "PerGame"}, {"description": "Defended-shot category", "enum": ["Overall", "3 Pointers"], "in": "query", "name": "defense_category", "type": "string", "x-example": "Overall"}], "path": "/nba/pt-defend", "pathParams": [], "produces": ["application/json"], "queryParams": [{"enum": ["00"], "in": "query", "name": "league_id", "type": "string"}, {"in": "query", "name": "season", "type": "string"}, {"enum": ["Regular Season"], "in": "query", "name": "season_type", "type": "string"}, {"enum": ["PerGame"], "in": "query", "name": "per_mode", "type": "string"}, {"enum": ["Overall", "3 Pointers"], "in": "query", "name": "defense_category", "type": "string"}], "security": ["ApiKeyAuth"]}, "nba-pt-stats": {"bodyParam": null, "bodyRequired": false, "id": "nba-pt-stats", "method": "GET", "params": [{"description": "League id; only 00 (NBA) is verified", "enum": ["00"], "in": "query", "name": "league_id", "type": "string", "x-example": "00"}, {"description": "Season in YYYY-YY form; defaults to the current NBA season", "in": "query", "name": "season", "type": "string", "x-example": "2026-27"}, {"description": "Season type", "enum": ["Regular Season"], "in": "query", "name": "season_type", "type": "string", "x-example": "Regular Season"}, {"description": "Aggregation", "enum": ["PerGame"], "in": "query", "name": "per_mode", "type": "string", "x-example": "PerGame"}, {"description": "Tracking measure; only SpeedDistance is verified", "enum": ["SpeedDistance"], "in": "query", "name": "pt_measure_type", "type": "string", "x-example": "SpeedDistance"}], "path": "/nba/pt-stats", "pathParams": [], "produces": ["application/json"], "queryParams": [{"enum": ["00"], "in": "query", "name": "league_id", "type": "string"}, {"in": "query", "name": "season", "type": "string"}, {"enum": ["Regular Season"], "in": "query", "name": "season_type", "type": "string"}, {"enum": ["PerGame"], "in": "query", "name": "per_mode", "type": "string"}, {"enum": ["SpeedDistance"], "in": "query", "name": "pt_measure_type", "type": "string"}], "security": ["ApiKeyAuth"]}, "nba-scoreboard": {"bodyParam": null, "bodyRequired": false, "id": "nba-scoreboard", "method": "GET", "params": [{"description": "League id; only 00 (NBA) is verified", "enum": ["00"], "in": "query", "name": "league_id", "type": "string", "x-example": "00"}, {"description": "Game day in MM/DD/YYYY form; defaults to the current UTC date", "in": "query", "name": "game_date", "type": "string", "x-example": "11/08/2026"}, {"description": "Whole-day offset applied to the game day example(0)", "in": "query", "name": "day_offset", "type": "integer", "x-example": 0}], "path": "/nba/scoreboard", "pathParams": [], "produces": ["application/json"], "queryParams": [{"enum": ["00"], "in": "query", "name": "league_id", "type": "string"}, {"in": "query", "name": "game_date", "type": "string"}, {"in": "query", "name": "day_offset", "type": "integer"}], "security": ["ApiKeyAuth"]}, "nba-shot-chart": {"bodyParam": null, "bodyRequired": false, "id": "nba-shot-chart", "method": "GET", "params": [{"description": "Player id from nba-players; supply this or team_id", "in": "query", "name": "player_id", "type": "integer", "x-example": 1628398}, {"description": "Team id from nba-standings; supply this or player_id", "in": "query", "name": "team_id", "type": "integer"}, {"description": "League id; only 00 (NBA) is verified", "enum": ["00"], "in": "query", "name": "league_id", "type": "string", "x-example": "00"}, {"description": "Season in YYYY-YY form; defaults to the current season", "in": "query", "name": "season", "type": "string", "x-example": "2026-27"}, {"description": "Season type", "enum": ["Regular Season"], "in": "query", "name": "season_type", "type": "string", "x-example": "Regular Season"}, {"description": "Shot-chart base event", "enum": ["FGA", "FG_PCT"], "in": "query", "name": "context_measure", "type": "string", "x-example": "FGA"}], "path": "/nba/shot-chart", "pathParams": [], "produces": ["application/json"], "queryParams": [{"in": "query", "name": "player_id", "type": "integer"}, {"in": "query", "name": "team_id", "type": "integer"}, {"enum": ["00"], "in": "query", "name": "league_id", "type": "string"}, {"in": "query", "name": "season", "type": "string"}, {"enum": ["Regular Season"], "in": "query", "name": "season_type", "type": "string"}, {"enum": ["FGA", "FG_PCT"], "in": "query", "name": "context_measure", "type": "string"}], "security": ["ApiKeyAuth"]}, "nba-standings": {"bodyParam": null, "bodyRequired": false, "id": "nba-standings", "method": "GET", "params": [{"description": "League id; only 00 (NBA) is verified", "enum": ["00"], "in": "query", "name": "league_id", "type": "string", "x-example": "00"}, {"description": "Season in YYYY-YY form; defaults to the current NBA season", "in": "query", "name": "season", "type": "string", "x-example": "2026-27"}, {"description": "Season type; Regular Season or Playoffs", "enum": ["Regular Season", "Playoffs", "Pre Season", "All Star"], "in": "query", "name": "season_type", "type": "string", "x-example": "Regular Season"}], "path": "/nba/standings", "pathParams": [], "produces": ["application/json"], "queryParams": [{"enum": ["00"], "in": "query", "name": "league_id", "type": "string"}, {"in": "query", "name": "season", "type": "string"}, {"enum": ["Regular Season", "Playoffs", "Pre Season", "All Star"], "in": "query", "name": "season_type", "type": "string"}], "security": ["ApiKeyAuth"]}, "nba-synergy-play-types": {"bodyParam": null, "bodyRequired": false, "id": "nba-synergy-play-types", "method": "GET", "params": [{"description": "League id; only 00 (NBA) is verified", "enum": ["00"], "in": "query", "name": "league_id", "type": "string", "x-example": "00"}, {"description": "Four-digit season year such as 2026; defaults to the current season", "in": "query", "name": "season_year", "type": "string", "x-example": "2026"}, {"description": "Season type", "enum": ["Regular Season"], "in": "query", "name": "season_type", "type": "string", "x-example": "Regular Season"}, {"description": "Synergy play type; only Isolation is verified", "enum": ["Isolation"], "in": "query", "name": "play_type", "type": "string", "x-example": "Isolation"}, {"description": "Aggregation", "enum": ["PerGame"], "in": "query", "name": "per_mode", "type": "string", "x-example": "PerGame"}, {"description": "Subject", "enum": ["T"], "in": "query", "name": "player_or_team", "type": "string", "x-example": "T"}, {"description": "Grouping", "enum": ["offensive"], "in": "query", "name": "type_grouping", "type": "string", "x-example": "offensive"}], "path": "/nba/synergy-play-types", "pathParams": [], "produces": ["application/json"], "queryParams": [{"enum": ["00"], "in": "query", "name": "league_id", "type": "string"}, {"in": "query", "name": "season_year", "type": "string"}, {"enum": ["Regular Season"], "in": "query", "name": "season_type", "type": "string"}, {"enum": ["Isolation"], "in": "query", "name": "play_type", "type": "string"}, {"enum": ["PerGame"], "in": "query", "name": "per_mode", "type": "string"}, {"enum": ["T"], "in": "query", "name": "player_or_team", "type": "string"}, {"enum": ["offensive"], "in": "query", "name": "type_grouping", "type": "string"}], "security": ["ApiKeyAuth"]}, "nba-team-dash-by-clutch": {"bodyParam": null, "bodyRequired": false, "id": "nba-team-dash-by-clutch", "method": "GET", "params": [{"description": "Team id from nba-standings", "in": "query", "name": "team_id", "required": true, "type": "integer", "x-example": 1610612738}, {"description": "League id; only 00 (NBA) is verified", "enum": ["00"], "in": "query", "name": "league_id", "type": "string", "x-example": "00"}, {"description": "Season in YYYY-YY form; defaults to the current season", "in": "query", "name": "season", "type": "string", "x-example": "2026-27"}, {"description": "Season type", "enum": ["Regular Season"], "in": "query", "name": "season_type", "type": "string", "x-example": "Regular Season"}, {"description": "Aggregation", "enum": ["PerGame"], "in": "query", "name": "per_mode", "type": "string", "x-example": "PerGame"}, {"description": "Statistic family; required upstream", "enum": ["Base", "Advanced", "Misc", "Scoring", "Defense", "Opponent"], "in": "query", "name": "measure_type", "type": "string", "x-example": "Base"}], "path": "/nba/team-dash-by-clutch", "pathParams": [], "produces": ["application/json"], "queryParams": [{"in": "query", "name": "team_id", "required": true, "type": "integer"}, {"enum": ["00"], "in": "query", "name": "league_id", "type": "string"}, {"in": "query", "name": "season", "type": "string"}, {"enum": ["Regular Season"], "in": "query", "name": "season_type", "type": "string"}, {"enum": ["PerGame"], "in": "query", "name": "per_mode", "type": "string"}, {"enum": ["Base", "Advanced", "Misc", "Scoring", "Defense", "Opponent"], "in": "query", "name": "measure_type", "type": "string"}], "security": ["ApiKeyAuth"]}, "nba-team-dash-by-game-splits": {"bodyParam": null, "bodyRequired": false, "id": "nba-team-dash-by-game-splits", "method": "GET", "params": [{"description": "Team id from nba-standings", "in": "query", "name": "team_id", "required": true, "type": "integer", "x-example": 1610612738}, {"description": "League id; only 00 (NBA) is verified", "enum": ["00"], "in": "query", "name": "league_id", "type": "string", "x-example": "00"}, {"description": "Season in YYYY-YY form; defaults to the current season", "in": "query", "name": "season", "type": "string", "x-example": "2026-27"}, {"description": "Season type", "enum": ["Regular Season"], "in": "query", "name": "season_type", "type": "string", "x-example": "Regular Season"}, {"description": "Aggregation", "enum": ["PerGame"], "in": "query", "name": "per_mode", "type": "string", "x-example": "PerGame"}, {"description": "Statistic family; required upstream", "enum": ["Base", "Advanced", "Misc", "Scoring", "Defense", "Opponent"], "in": "query", "name": "measure_type", "type": "string", "x-example": "Base"}], "path": "/nba/team-dash-by-game-splits", "pathParams": [], "produces": ["application/json"], "queryParams": [{"in": "query", "name": "team_id", "required": true, "type": "integer"}, {"enum": ["00"], "in": "query", "name": "league_id", "type": "string"}, {"in": "query", "name": "season", "type": "string"}, {"enum": ["Regular Season"], "in": "query", "name": "season_type", "type": "string"}, {"enum": ["PerGame"], "in": "query", "name": "per_mode", "type": "string"}, {"enum": ["Base", "Advanced", "Misc", "Scoring", "Defense", "Opponent"], "in": "query", "name": "measure_type", "type": "string"}], "security": ["ApiKeyAuth"]}, "nba-team-dash-by-last-n-games": {"bodyParam": null, "bodyRequired": false, "id": "nba-team-dash-by-last-n-games", "method": "GET", "params": [{"description": "Team id from nba-standings", "in": "query", "name": "team_id", "required": true, "type": "integer", "x-example": 1610612738}, {"description": "League id; only 00 (NBA) is verified", "enum": ["00"], "in": "query", "name": "league_id", "type": "string", "x-example": "00"}, {"description": "Season in YYYY-YY form; defaults to the current season", "in": "query", "name": "season", "type": "string", "x-example": "2026-27"}, {"description": "Season type", "enum": ["Regular Season"], "in": "query", "name": "season_type", "type": "string", "x-example": "Regular Season"}, {"description": "Aggregation", "enum": ["PerGame"], "in": "query", "name": "per_mode", "type": "string", "x-example": "PerGame"}, {"description": "Statistic family; required upstream", "enum": ["Base", "Advanced", "Misc", "Scoring", "Defense", "Opponent"], "in": "query", "name": "measure_type", "type": "string", "x-example": "Base"}], "path": "/nba/team-dash-by-last-n-games", "pathParams": [], "produces": ["application/json"], "queryParams": [{"in": "query", "name": "team_id", "required": true, "type": "integer"}, {"enum": ["00"], "in": "query", "name": "league_id", "type": "string"}, {"in": "query", "name": "season", "type": "string"}, {"enum": ["Regular Season"], "in": "query", "name": "season_type", "type": "string"}, {"enum": ["PerGame"], "in": "query", "name": "per_mode", "type": "string"}, {"enum": ["Base", "Advanced", "Misc", "Scoring", "Defense", "Opponent"], "in": "query", "name": "measure_type", "type": "string"}], "security": ["ApiKeyAuth"]}, "nba-team-dash-by-opponent": {"bodyParam": null, "bodyRequired": false, "id": "nba-team-dash-by-opponent", "method": "GET", "params": [{"description": "Team id from nba-standings", "in": "query", "name": "team_id", "required": true, "type": "integer", "x-example": 1610612738}, {"description": "League id; only 00 (NBA) is verified", "enum": ["00"], "in": "query", "name": "league_id", "type": "string", "x-example": "00"}, {"description": "Season in YYYY-YY form; defaults to the current season", "in": "query", "name": "season", "type": "string", "x-example": "2026-27"}, {"description": "Season type", "enum": ["Regular Season"], "in": "query", "name": "season_type", "type": "string", "x-example": "Regular Season"}, {"description": "Aggregation", "enum": ["PerGame"], "in": "query", "name": "per_mode", "type": "string", "x-example": "PerGame"}, {"description": "Statistic family; required upstream", "enum": ["Base", "Advanced", "Misc", "Scoring", "Defense", "Opponent"], "in": "query", "name": "measure_type", "type": "string", "x-example": "Base"}], "path": "/nba/team-dash-by-opponent", "pathParams": [], "produces": ["application/json"], "queryParams": [{"in": "query", "name": "team_id", "required": true, "type": "integer"}, {"enum": ["00"], "in": "query", "name": "league_id", "type": "string"}, {"in": "query", "name": "season", "type": "string"}, {"enum": ["Regular Season"], "in": "query", "name": "season_type", "type": "string"}, {"enum": ["PerGame"], "in": "query", "name": "per_mode", "type": "string"}, {"enum": ["Base", "Advanced", "Misc", "Scoring", "Defense", "Opponent"], "in": "query", "name": "measure_type", "type": "string"}], "security": ["ApiKeyAuth"]}, "nba-team-dash-pt-pass": {"bodyParam": null, "bodyRequired": false, "id": "nba-team-dash-pt-pass", "method": "GET", "params": [{"description": "Optional league id; only 00 (NBA) is verified.", "enum": ["00"], "in": "query", "name": "league_id", "type": "string"}, {"description": "Optional season in YYYY-YY form; defaults to the current NBA season.", "in": "query", "name": "season", "type": "string"}, {"description": "Optional season type.", "enum": ["Regular Season", "Playoffs", "Pre Season", "All Star"], "in": "query", "name": "season_type", "type": "string"}, {"description": "Optional aggregation.", "enum": ["PerGame", "Totals", "Per36", "Per48", "Per100Possessions", "MinutesPer", "PerPossession"], "in": "query", "name": "per_mode", "type": "string"}, {"description": "Required team id from nba-standings.", "in": "query", "name": "team_id", "required": true, "type": "integer"}], "path": "/nba/team-dash-pt-pass", "pathParams": [], "produces": ["application/json"], "queryParams": [{"enum": ["00"], "in": "query", "name": "league_id", "type": "string"}, {"in": "query", "name": "season", "type": "string"}, {"enum": ["Regular Season", "Playoffs", "Pre Season", "All Star"], "in": "query", "name": "season_type", "type": "string"}, {"enum": ["PerGame", "Totals", "Per36", "Per48", "Per100Possessions", "MinutesPer", "PerPossession"], "in": "query", "name": "per_mode", "type": "string"}, {"in": "query", "name": "team_id", "required": true, "type": "integer"}], "security": ["ApiKeyAuth"]}, "nba-team-dash-pt-reb": {"bodyParam": null, "bodyRequired": false, "id": "nba-team-dash-pt-reb", "method": "GET", "params": [{"description": "Team id from nba-standings", "in": "query", "name": "team_id", "required": true, "type": "integer", "x-example": 1610612738}, {"description": "League id; only 00 (NBA) is verified", "enum": ["00"], "in": "query", "name": "league_id", "type": "string", "x-example": "00"}, {"description": "Season in YYYY-YY form; defaults to the current season", "in": "query", "name": "season", "type": "string", "x-example": "2026-27"}, {"description": "Season type", "enum": ["Regular Season"], "in": "query", "name": "season_type", "type": "string", "x-example": "Regular Season"}, {"description": "Aggregation", "enum": ["PerGame"], "in": "query", "name": "per_mode", "type": "string", "x-example": "PerGame"}], "path": "/nba/team-dash-pt-reb", "pathParams": [], "produces": ["application/json"], "queryParams": [{"in": "query", "name": "team_id", "required": true, "type": "integer"}, {"enum": ["00"], "in": "query", "name": "league_id", "type": "string"}, {"in": "query", "name": "season", "type": "string"}, {"enum": ["Regular Season"], "in": "query", "name": "season_type", "type": "string"}, {"enum": ["PerGame"], "in": "query", "name": "per_mode", "type": "string"}], "security": ["ApiKeyAuth"]}, "nba-team-dash-pt-shots": {"bodyParam": null, "bodyRequired": false, "id": "nba-team-dash-pt-shots", "method": "GET", "params": [{"description": "Optional league id; only 00 (NBA) is verified.", "enum": ["00"], "in": "query", "name": "league_id", "type": "string"}, {"description": "Optional season in YYYY-YY form; defaults to the current NBA season.", "in": "query", "name": "season", "type": "string"}, {"description": "Optional season type.", "enum": ["Regular Season", "Playoffs", "Pre Season", "All Star"], "in": "query", "name": "season_type", "type": "string"}, {"description": "Optional aggregation.", "enum": ["PerGame", "Totals", "Per36", "Per48", "Per100Possessions", "MinutesPer", "PerPossession"], "in": "query", "name": "per_mode", "type": "string"}, {"description": "Required team id from nba-standings.", "in": "query", "name": "team_id", "required": true, "type": "integer"}], "path": "/nba/team-dash-pt-shots", "pathParams": [], "produces": ["application/json"], "queryParams": [{"enum": ["00"], "in": "query", "name": "league_id", "type": "string"}, {"in": "query", "name": "season", "type": "string"}, {"enum": ["Regular Season", "Playoffs", "Pre Season", "All Star"], "in": "query", "name": "season_type", "type": "string"}, {"enum": ["PerGame", "Totals", "Per36", "Per48", "Per100Possessions", "MinutesPer", "PerPossession"], "in": "query", "name": "per_mode", "type": "string"}, {"in": "query", "name": "team_id", "required": true, "type": "integer"}], "security": ["ApiKeyAuth"]}, "nba-team-details": {"bodyParam": null, "bodyRequired": false, "id": "nba-team-details", "method": "GET", "params": [{"description": "Team id from nba-standings", "in": "query", "name": "team_id", "required": true, "type": "integer", "x-example": 1610612741}, {"description": "League id; only 00 (NBA) is verified", "enum": ["00"], "in": "query", "name": "league_id", "type": "string", "x-example": "00"}], "path": "/nba/team-details", "pathParams": [], "produces": ["application/json"], "queryParams": [{"in": "query", "name": "team_id", "required": true, "type": "integer"}, {"enum": ["00"], "in": "query", "name": "league_id", "type": "string"}], "security": ["ApiKeyAuth"]}, "nba-team-game-logs": {"bodyParam": null, "bodyRequired": false, "id": "nba-team-game-logs", "method": "GET", "params": [{"description": "Optional league id; only 00 (NBA) is verified.", "enum": ["00"], "in": "query", "name": "league_id", "type": "string"}, {"description": "Optional season in YYYY-YY form; defaults to the current NBA season.", "in": "query", "name": "season", "type": "string"}, {"description": "Optional season type.", "enum": ["Regular Season", "Playoffs", "Pre Season", "All Star"], "in": "query", "name": "season_type", "type": "string"}, {"description": "Required team id from nba-standings.", "in": "query", "name": "team_id", "required": true, "type": "integer"}], "path": "/nba/team-game-logs", "pathParams": [], "produces": ["application/json"], "queryParams": [{"enum": ["00"], "in": "query", "name": "league_id", "type": "string"}, {"in": "query", "name": "season", "type": "string"}, {"enum": ["Regular Season", "Playoffs", "Pre Season", "All Star"], "in": "query", "name": "season_type", "type": "string"}, {"in": "query", "name": "team_id", "required": true, "type": "integer"}], "security": ["ApiKeyAuth"]}, "nba-team-info-common": {"bodyParam": null, "bodyRequired": false, "id": "nba-team-info-common", "method": "GET", "params": [{"description": "Optional league id; only 00 (NBA) is verified.", "enum": ["00"], "in": "query", "name": "league_id", "type": "string"}, {"description": "Optional season in YYYY-YY form; defaults to the current NBA season.", "in": "query", "name": "season", "type": "string"}, {"description": "Optional season type.", "enum": ["Regular Season", "Playoffs", "Pre Season", "All Star"], "in": "query", "name": "season_type", "type": "string"}, {"description": "Required team id from nba-standings.", "in": "query", "name": "team_id", "required": true, "type": "integer"}], "path": "/nba/team-info-common", "pathParams": [], "produces": ["application/json"], "queryParams": [{"enum": ["00"], "in": "query", "name": "league_id", "type": "string"}, {"in": "query", "name": "season", "type": "string"}, {"enum": ["Regular Season", "Playoffs", "Pre Season", "All Star"], "in": "query", "name": "season_type", "type": "string"}, {"in": "query", "name": "team_id", "required": true, "type": "integer"}], "security": ["ApiKeyAuth"]}, "nba-team-on-off": {"bodyParam": null, "bodyRequired": false, "id": "nba-team-on-off", "method": "GET", "params": [{"description": "Optional league id; only 00 (NBA) is verified.", "enum": ["00"], "in": "query", "name": "league_id", "type": "string"}, {"description": "Optional season in YYYY-YY form; defaults to the current NBA season.", "in": "query", "name": "season", "type": "string"}, {"description": "Optional season type.", "enum": ["Regular Season", "Playoffs", "Pre Season", "All Star"], "in": "query", "name": "season_type", "type": "string"}, {"description": "Optional aggregation.", "enum": ["PerGame", "Totals", "Per36", "Per48", "Per100Possessions", "MinutesPer", "PerPossession"], "in": "query", "name": "per_mode", "type": "string"}, {"description": "Optional statistic family.", "enum": ["Base", "Advanced", "Misc", "Scoring", "Defense", "Opponent"], "in": "query", "name": "measure_type", "type": "string"}, {"description": "Required team id from nba-standings.", "in": "query", "name": "team_id", "required": true, "type": "integer"}], "path": "/nba/team-on-off", "pathParams": [], "produces": ["application/json"], "queryParams": [{"enum": ["00"], "in": "query", "name": "league_id", "type": "string"}, {"in": "query", "name": "season", "type": "string"}, {"enum": ["Regular Season", "Playoffs", "Pre Season", "All Star"], "in": "query", "name": "season_type", "type": "string"}, {"enum": ["PerGame", "Totals", "Per36", "Per48", "Per100Possessions", "MinutesPer", "PerPossession"], "in": "query", "name": "per_mode", "type": "string"}, {"enum": ["Base", "Advanced", "Misc", "Scoring", "Defense", "Opponent"], "in": "query", "name": "measure_type", "type": "string"}, {"in": "query", "name": "team_id", "required": true, "type": "integer"}], "security": ["ApiKeyAuth"]}, "nba-team-pt-shot": {"bodyParam": null, "bodyRequired": false, "id": "nba-team-pt-shot", "method": "GET", "params": [{"description": "Optional league id; only 00 (NBA) is verified.", "enum": ["00"], "in": "query", "name": "league_id", "type": "string"}, {"description": "Optional season in YYYY-YY form; defaults to the current NBA season.", "in": "query", "name": "season", "type": "string"}, {"description": "Optional season type.", "enum": ["Regular Season", "Playoffs", "Pre Season", "All Star"], "in": "query", "name": "season_type", "type": "string"}, {"description": "Optional aggregation.", "enum": ["PerGame", "Totals", "Per36", "Per48", "Per100Possessions", "MinutesPer", "PerPossession"], "in": "query", "name": "per_mode", "type": "string"}], "path": "/nba/team-pt-shot", "pathParams": [], "produces": ["application/json"], "queryParams": [{"enum": ["00"], "in": "query", "name": "league_id", "type": "string"}, {"in": "query", "name": "season", "type": "string"}, {"enum": ["Regular Season", "Playoffs", "Pre Season", "All Star"], "in": "query", "name": "season_type", "type": "string"}, {"enum": ["PerGame", "Totals", "Per36", "Per48", "Per100Possessions", "MinutesPer", "PerPossession"], "in": "query", "name": "per_mode", "type": "string"}], "security": ["ApiKeyAuth"]}, "nba-team-roster": {"bodyParam": null, "bodyRequired": false, "id": "nba-team-roster", "method": "GET", "params": [{"description": "Team id from nba-standings", "in": "query", "name": "team_id", "required": true, "type": "integer", "x-example": 1610612741}, {"description": "League id; only 00 (NBA) is verified", "enum": ["00"], "in": "query", "name": "league_id", "type": "string", "x-example": "00"}, {"description": "Season in YYYY-YY form; defaults to the current NBA season", "in": "query", "name": "season", "type": "string", "x-example": "2026-27"}], "path": "/nba/team-roster", "pathParams": [], "produces": ["application/json"], "queryParams": [{"in": "query", "name": "team_id", "required": true, "type": "integer"}, {"enum": ["00"], "in": "query", "name": "league_id", "type": "string"}, {"in": "query", "name": "season", "type": "string"}], "security": ["ApiKeyAuth"]}, "nba-team-shot-locations": {"bodyParam": null, "bodyRequired": false, "id": "nba-team-shot-locations", "method": "GET", "params": [{"description": "League id; only 00 (NBA) is verified", "enum": ["00"], "in": "query", "name": "league_id", "type": "string", "x-example": "00"}, {"description": "Season in YYYY-YY form; defaults to the current NBA season", "in": "query", "name": "season", "type": "string", "x-example": "2026-27"}, {"description": "Season type", "enum": ["Regular Season"], "in": "query", "name": "season_type", "type": "string", "x-example": "Regular Season"}, {"description": "Statistic family", "enum": ["Base"], "in": "query", "name": "measure_type", "type": "string", "x-example": "Base"}, {"description": "Aggregation", "enum": ["PerGame"], "in": "query", "name": "per_mode", "type": "string", "x-example": "PerGame"}, {"description": "Distance bucket set; only By Zone is verified", "in": "query", "name": "distance_range", "type": "string", "x-example": "By Zone"}], "path": "/nba/team-shot-locations", "pathParams": [], "produces": ["application/json"], "queryParams": [{"enum": ["00"], "in": "query", "name": "league_id", "type": "string"}, {"in": "query", "name": "season", "type": "string"}, {"enum": ["Regular Season"], "in": "query", "name": "season_type", "type": "string"}, {"enum": ["Base"], "in": "query", "name": "measure_type", "type": "string"}, {"enum": ["PerGame"], "in": "query", "name": "per_mode", "type": "string"}, {"in": "query", "name": "distance_range", "type": "string"}], "security": ["ApiKeyAuth"]}, "nba-team-stats": {"bodyParam": null, "bodyRequired": false, "id": "nba-team-stats", "method": "GET", "params": [{"description": "League id; only 00 (NBA) is verified", "enum": ["00"], "in": "query", "name": "league_id", "type": "string", "x-example": "00"}, {"description": "Season in YYYY-YY form; defaults to the current NBA season", "in": "query", "name": "season", "type": "string", "x-example": "2026-27"}, {"description": "Season type; Regular Season or Playoffs", "enum": ["Regular Season", "Playoffs", "Pre Season", "All Star"], "in": "query", "name": "season_type", "type": "string", "x-example": "Regular Season"}, {"description": "Statistic family; Base or Advanced", "enum": ["Base", "Advanced", "Misc", "Scoring", "Defense", "Opponent"], "in": "query", "name": "measure_type", "type": "string", "x-example": "Base"}, {"description": "Aggregation; PerGame or Totals", "enum": ["PerGame", "Totals", "Per36", "Per48", "Per100Possessions", "MinutesPer", "PerPossession"], "in": "query", "name": "per_mode", "type": "string", "x-example": "PerGame"}], "path": "/nba/team-stats", "pathParams": [], "produces": ["application/json"], "queryParams": [{"enum": ["00"], "in": "query", "name": "league_id", "type": "string"}, {"in": "query", "name": "season", "type": "string"}, {"enum": ["Regular Season", "Playoffs", "Pre Season", "All Star"], "in": "query", "name": "season_type", "type": "string"}, {"enum": ["Base", "Advanced", "Misc", "Scoring", "Defense", "Opponent"], "in": "query", "name": "measure_type", "type": "string"}, {"enum": ["PerGame", "Totals", "Per36", "Per48", "Per100Possessions", "MinutesPer", "PerPossession"], "in": "query", "name": "per_mode", "type": "string"}], "security": ["ApiKeyAuth"]}, "nba-team-stats-leaders": {"bodyParam": null, "bodyRequired": false, "id": "nba-team-stats-leaders", "method": "GET", "params": [{"description": "Ranked statistic; PTS, REB or AST", "enum": ["PTS", "REB", "AST", "BLK", "STL", "TOV"], "in": "query", "name": "stat_category", "required": true, "type": "string", "x-example": "PTS"}, {"description": "League id; only 00 (NBA) is verified", "enum": ["00"], "in": "query", "name": "league_id", "type": "string", "x-example": "00"}, {"description": "Season in YYYY-YY form; defaults to the current NBA season", "in": "query", "name": "season", "type": "string", "x-example": "2026-27"}, {"description": "Season type; Regular Season or Playoffs", "enum": ["Regular Season", "Playoffs", "Pre Season", "All Star"], "in": "query", "name": "season_type", "type": "string", "x-example": "Regular Season"}, {"description": "Aggregation; PerGame or Totals", "enum": ["PerGame", "Totals", "Per36", "Per48", "Per100Possessions", "MinutesPer", "PerPossession"], "in": "query", "name": "per_mode", "type": "string", "x-example": "PerGame"}, {"description": "Player-pool scope; S is all players (the only verified value)", "enum": ["S"], "in": "query", "name": "scope", "type": "string", "x-example": "S"}], "path": "/nba/team-stats-leaders", "pathParams": [], "produces": ["application/json"], "queryParams": [{"enum": ["PTS", "REB", "AST", "BLK", "STL", "TOV"], "in": "query", "name": "stat_category", "required": true, "type": "string"}, {"enum": ["00"], "in": "query", "name": "league_id", "type": "string"}, {"in": "query", "name": "season", "type": "string"}, {"enum": ["Regular Season", "Playoffs", "Pre Season", "All Star"], "in": "query", "name": "season_type", "type": "string"}, {"enum": ["PerGame", "Totals", "Per36", "Per48", "Per100Possessions", "MinutesPer", "PerPossession"], "in": "query", "name": "per_mode", "type": "string"}, {"enum": ["S"], "in": "query", "name": "scope", "type": "string"}], "security": ["ApiKeyAuth"]}, "nba-team-years": {"bodyParam": null, "bodyRequired": false, "id": "nba-team-years", "method": "GET", "params": [{"description": "Optional league id; only 00 (NBA) is verified.", "enum": ["00"], "in": "query", "name": "league_id", "type": "string"}], "path": "/nba/team-years", "pathParams": [], "produces": ["application/json"], "queryParams": [{"enum": ["00"], "in": "query", "name": "league_id", "type": "string"}], "security": ["ApiKeyAuth"]}}
|
|
23
|
+
JSON
|
|
24
|
+
OPERATION_IDS = JSON.parse(<<~'JSON').freeze
|
|
25
|
+
["nba-box-score", "nba-box-score-advanced", "nba-box-score-defensive", "nba-box-score-four-factors", "nba-box-score-misc", "nba-box-score-player-track", "nba-box-score-scoring", "nba-box-score-summary", "nba-box-score-usage", "nba-common-all-players", "nba-draft-combine-anthro", "nba-enums", "nba-franchise-history", "nba-game-detail", "nba-games", "nba-homepage-leaders", "nba-homepage-v2", "nba-hustle-player", "nba-hustle-stats", "nba-hustle-team", "nba-league-game-log", "nba-lineup-shot-chart", "nba-lineups", "nba-news", "nba-opp-pt-shot", "nba-play-by-play", "nba-player-awards", "nba-player-bio-stats", "nba-player-career-stats", "nba-player-clutch", "nba-player-compare", "nba-player-dash-by-clutch", "nba-player-dash-by-game-splits", "nba-player-dash-by-last-n-games", "nba-player-dash-by-opponent", "nba-player-dash-pt-pass", "nba-player-dash-pt-reb", "nba-player-dash-pt-shots", "nba-player-game-logs", "nba-player-info", "nba-player-profile-v2", "nba-player-pt-shot", "nba-player-stats", "nba-player-streak-finder", "nba-players", "nba-playoff-picture", "nba-playoff-series", "nba-pt-defend", "nba-pt-stats", "nba-scoreboard", "nba-shot-chart", "nba-standings", "nba-synergy-play-types", "nba-team-dash-by-clutch", "nba-team-dash-by-game-splits", "nba-team-dash-by-last-n-games", "nba-team-dash-by-opponent", "nba-team-dash-pt-pass", "nba-team-dash-pt-reb", "nba-team-dash-pt-shots", "nba-team-details", "nba-team-game-logs", "nba-team-info-common", "nba-team-on-off", "nba-team-pt-shot", "nba-team-roster", "nba-team-shot-locations", "nba-team-stats", "nba-team-stats-leaders", "nba-team-years"]
|
|
26
|
+
JSON
|
|
27
|
+
OPERATION_COUNT = OPERATION_IDS.length
|
|
28
|
+
|
|
29
|
+
class Client
|
|
30
|
+
attr_reader :base_url
|
|
31
|
+
|
|
32
|
+
def initialize(api_key: ENV["CRAWLORA_API_KEY"], base_url: "https://api.crawlora.net/api/v1", timeout: 30, user_agent: "crawlora-nba-ruby/0.1.1", transport: nil)
|
|
33
|
+
@api_key = api_key
|
|
34
|
+
@base_url = base_url.to_s.sub(%r{/+$}, "")
|
|
35
|
+
@timeout = Float(timeout)
|
|
36
|
+
@user_agent = user_agent
|
|
37
|
+
@transport = transport
|
|
38
|
+
@closed = false
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def request(operation_id, params = {}, response_type: :auto)
|
|
42
|
+
raise Errors::ClientError, "client is closed" if @closed
|
|
43
|
+
operation_id = operation_id.to_s
|
|
44
|
+
operation = OPERATIONS[operation_id]
|
|
45
|
+
raise Errors::ClientError.new("unknown operation: #{operation_id}", operation_id: operation_id) unless operation
|
|
46
|
+
raise Errors::ClientError.new("Crawlora API key is required", operation_id: operation_id) if @api_key.nil? || @api_key.to_s.empty?
|
|
47
|
+
normalized = params.each_with_object({}) { |(key, value), out| out[key.to_s] = value }
|
|
48
|
+
payload = request_body(operation, normalized)
|
|
49
|
+
url = build_url(operation, normalized)
|
|
50
|
+
uri = URI.parse(url)
|
|
51
|
+
request = operation["method"] == "POST" ? Net::HTTP::Post.new(uri) : Net::HTTP::Get.new(uri)
|
|
52
|
+
unless payload.nil?
|
|
53
|
+
request.body = payload
|
|
54
|
+
request["Content-Type"] = "application/json"
|
|
55
|
+
end
|
|
56
|
+
request["x-api-key"] = @api_key
|
|
57
|
+
request["User-Agent"] = @user_agent
|
|
58
|
+
request["Accept"] = operation["produces"].include?("text/plain") ? "application/json, text/plain" : "application/json"
|
|
59
|
+
begin
|
|
60
|
+
if @transport
|
|
61
|
+
response = if operation["method"] == "POST"
|
|
62
|
+
@transport.call(url, request.to_hash, @timeout, "POST", payload)
|
|
63
|
+
else
|
|
64
|
+
@transport.call(url, request.to_hash, @timeout)
|
|
65
|
+
end
|
|
66
|
+
status = Integer(response.fetch(:status) { response.fetch("status") })
|
|
67
|
+
body = response.fetch(:body) { response.fetch("body", "") }
|
|
68
|
+
headers = response.fetch(:headers) { response.fetch("headers", {}) }
|
|
69
|
+
content_type = headers["content-type"] || headers["Content-Type"]
|
|
70
|
+
else
|
|
71
|
+
http = Net::HTTP.new(uri.host, uri.port)
|
|
72
|
+
http.use_ssl = uri.scheme == "https"
|
|
73
|
+
http.open_timeout = @timeout
|
|
74
|
+
http.read_timeout = @timeout
|
|
75
|
+
response = http.start { |connection| connection.request(request) }
|
|
76
|
+
status = response.code.to_i
|
|
77
|
+
body = response.body
|
|
78
|
+
content_type = response["content-type"]
|
|
79
|
+
end
|
|
80
|
+
rescue Timeout::Error, SocketError, SystemCallError, IOError, EOFError, Net::HTTPBadResponse, Net::ProtocolError, OpenSSL::SSL::SSLError => error
|
|
81
|
+
raise Errors::NetworkError.new("Crawlora request failed: #{error.message}", operation_id: operation_id)
|
|
82
|
+
end
|
|
83
|
+
unless status >= 200 && status < 300
|
|
84
|
+
klass = status >= 500 ? Errors::ServerError : Errors::ClientError
|
|
85
|
+
raise klass.new("Crawlora returned HTTP #{status}", status: status, operation_id: operation_id, body: body)
|
|
86
|
+
end
|
|
87
|
+
parse_response(body, content_type, operation, normalized, response_type)
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
def close
|
|
91
|
+
@closed = true
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
def closed?
|
|
95
|
+
@closed
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
def with
|
|
99
|
+
return self unless block_given?
|
|
100
|
+
yield self
|
|
101
|
+
ensure
|
|
102
|
+
close if block_given?
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
def self.operation_count
|
|
106
|
+
OPERATION_COUNT
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
def self.operation_ids
|
|
110
|
+
OPERATION_IDS
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
def self.operations
|
|
114
|
+
OPERATIONS
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
define_method('box_score') do |**params|
|
|
118
|
+
response_type = params.delete(:response_type) || params.delete(:_response_type) || :auto
|
|
119
|
+
request('nba-box-score', params, response_type: response_type)
|
|
120
|
+
end
|
|
121
|
+
define_method('box_score_advanced') do |**params|
|
|
122
|
+
response_type = params.delete(:response_type) || params.delete(:_response_type) || :auto
|
|
123
|
+
request('nba-box-score-advanced', params, response_type: response_type)
|
|
124
|
+
end
|
|
125
|
+
define_method('box_score_defensive') do |**params|
|
|
126
|
+
response_type = params.delete(:response_type) || params.delete(:_response_type) || :auto
|
|
127
|
+
request('nba-box-score-defensive', params, response_type: response_type)
|
|
128
|
+
end
|
|
129
|
+
define_method('box_score_four_factors') do |**params|
|
|
130
|
+
response_type = params.delete(:response_type) || params.delete(:_response_type) || :auto
|
|
131
|
+
request('nba-box-score-four-factors', params, response_type: response_type)
|
|
132
|
+
end
|
|
133
|
+
define_method('box_score_misc') do |**params|
|
|
134
|
+
response_type = params.delete(:response_type) || params.delete(:_response_type) || :auto
|
|
135
|
+
request('nba-box-score-misc', params, response_type: response_type)
|
|
136
|
+
end
|
|
137
|
+
define_method('box_score_player_track') do |**params|
|
|
138
|
+
response_type = params.delete(:response_type) || params.delete(:_response_type) || :auto
|
|
139
|
+
request('nba-box-score-player-track', params, response_type: response_type)
|
|
140
|
+
end
|
|
141
|
+
define_method('box_score_scoring') do |**params|
|
|
142
|
+
response_type = params.delete(:response_type) || params.delete(:_response_type) || :auto
|
|
143
|
+
request('nba-box-score-scoring', params, response_type: response_type)
|
|
144
|
+
end
|
|
145
|
+
define_method('box_score_summary') do |**params|
|
|
146
|
+
response_type = params.delete(:response_type) || params.delete(:_response_type) || :auto
|
|
147
|
+
request('nba-box-score-summary', params, response_type: response_type)
|
|
148
|
+
end
|
|
149
|
+
define_method('box_score_usage') do |**params|
|
|
150
|
+
response_type = params.delete(:response_type) || params.delete(:_response_type) || :auto
|
|
151
|
+
request('nba-box-score-usage', params, response_type: response_type)
|
|
152
|
+
end
|
|
153
|
+
define_method('common_all_players') do |**params|
|
|
154
|
+
response_type = params.delete(:response_type) || params.delete(:_response_type) || :auto
|
|
155
|
+
request('nba-common-all-players', params, response_type: response_type)
|
|
156
|
+
end
|
|
157
|
+
define_method('draft_combine_anthro') do |**params|
|
|
158
|
+
response_type = params.delete(:response_type) || params.delete(:_response_type) || :auto
|
|
159
|
+
request('nba-draft-combine-anthro', params, response_type: response_type)
|
|
160
|
+
end
|
|
161
|
+
define_method('enums') do |**params|
|
|
162
|
+
response_type = params.delete(:response_type) || params.delete(:_response_type) || :auto
|
|
163
|
+
request('nba-enums', params, response_type: response_type)
|
|
164
|
+
end
|
|
165
|
+
define_method('franchise_history') do |**params|
|
|
166
|
+
response_type = params.delete(:response_type) || params.delete(:_response_type) || :auto
|
|
167
|
+
request('nba-franchise-history', params, response_type: response_type)
|
|
168
|
+
end
|
|
169
|
+
define_method('game_detail') do |**params|
|
|
170
|
+
response_type = params.delete(:response_type) || params.delete(:_response_type) || :auto
|
|
171
|
+
request('nba-game-detail', params, response_type: response_type)
|
|
172
|
+
end
|
|
173
|
+
define_method('games') do |**params|
|
|
174
|
+
response_type = params.delete(:response_type) || params.delete(:_response_type) || :auto
|
|
175
|
+
request('nba-games', params, response_type: response_type)
|
|
176
|
+
end
|
|
177
|
+
define_method('homepage_leaders') do |**params|
|
|
178
|
+
response_type = params.delete(:response_type) || params.delete(:_response_type) || :auto
|
|
179
|
+
request('nba-homepage-leaders', params, response_type: response_type)
|
|
180
|
+
end
|
|
181
|
+
define_method('homepage_v2') do |**params|
|
|
182
|
+
response_type = params.delete(:response_type) || params.delete(:_response_type) || :auto
|
|
183
|
+
request('nba-homepage-v2', params, response_type: response_type)
|
|
184
|
+
end
|
|
185
|
+
define_method('hustle_player') do |**params|
|
|
186
|
+
response_type = params.delete(:response_type) || params.delete(:_response_type) || :auto
|
|
187
|
+
request('nba-hustle-player', params, response_type: response_type)
|
|
188
|
+
end
|
|
189
|
+
define_method('hustle_stats') do |**params|
|
|
190
|
+
response_type = params.delete(:response_type) || params.delete(:_response_type) || :auto
|
|
191
|
+
request('nba-hustle-stats', params, response_type: response_type)
|
|
192
|
+
end
|
|
193
|
+
define_method('hustle_team') do |**params|
|
|
194
|
+
response_type = params.delete(:response_type) || params.delete(:_response_type) || :auto
|
|
195
|
+
request('nba-hustle-team', params, response_type: response_type)
|
|
196
|
+
end
|
|
197
|
+
define_method('league_game_log') do |**params|
|
|
198
|
+
response_type = params.delete(:response_type) || params.delete(:_response_type) || :auto
|
|
199
|
+
request('nba-league-game-log', params, response_type: response_type)
|
|
200
|
+
end
|
|
201
|
+
define_method('lineup_shot_chart') do |**params|
|
|
202
|
+
response_type = params.delete(:response_type) || params.delete(:_response_type) || :auto
|
|
203
|
+
request('nba-lineup-shot-chart', params, response_type: response_type)
|
|
204
|
+
end
|
|
205
|
+
define_method('lineups') do |**params|
|
|
206
|
+
response_type = params.delete(:response_type) || params.delete(:_response_type) || :auto
|
|
207
|
+
request('nba-lineups', params, response_type: response_type)
|
|
208
|
+
end
|
|
209
|
+
define_method('news') do |**params|
|
|
210
|
+
response_type = params.delete(:response_type) || params.delete(:_response_type) || :auto
|
|
211
|
+
request('nba-news', params, response_type: response_type)
|
|
212
|
+
end
|
|
213
|
+
define_method('opp_pt_shot') do |**params|
|
|
214
|
+
response_type = params.delete(:response_type) || params.delete(:_response_type) || :auto
|
|
215
|
+
request('nba-opp-pt-shot', params, response_type: response_type)
|
|
216
|
+
end
|
|
217
|
+
define_method('play_by_play') do |**params|
|
|
218
|
+
response_type = params.delete(:response_type) || params.delete(:_response_type) || :auto
|
|
219
|
+
request('nba-play-by-play', params, response_type: response_type)
|
|
220
|
+
end
|
|
221
|
+
define_method('player_awards') do |**params|
|
|
222
|
+
response_type = params.delete(:response_type) || params.delete(:_response_type) || :auto
|
|
223
|
+
request('nba-player-awards', params, response_type: response_type)
|
|
224
|
+
end
|
|
225
|
+
define_method('player_bio_stats') do |**params|
|
|
226
|
+
response_type = params.delete(:response_type) || params.delete(:_response_type) || :auto
|
|
227
|
+
request('nba-player-bio-stats', params, response_type: response_type)
|
|
228
|
+
end
|
|
229
|
+
define_method('player_career_stats') do |**params|
|
|
230
|
+
response_type = params.delete(:response_type) || params.delete(:_response_type) || :auto
|
|
231
|
+
request('nba-player-career-stats', params, response_type: response_type)
|
|
232
|
+
end
|
|
233
|
+
define_method('player_clutch') do |**params|
|
|
234
|
+
response_type = params.delete(:response_type) || params.delete(:_response_type) || :auto
|
|
235
|
+
request('nba-player-clutch', params, response_type: response_type)
|
|
236
|
+
end
|
|
237
|
+
define_method('player_compare') do |**params|
|
|
238
|
+
response_type = params.delete(:response_type) || params.delete(:_response_type) || :auto
|
|
239
|
+
request('nba-player-compare', params, response_type: response_type)
|
|
240
|
+
end
|
|
241
|
+
define_method('player_dash_by_clutch') do |**params|
|
|
242
|
+
response_type = params.delete(:response_type) || params.delete(:_response_type) || :auto
|
|
243
|
+
request('nba-player-dash-by-clutch', params, response_type: response_type)
|
|
244
|
+
end
|
|
245
|
+
define_method('player_dash_by_game_splits') do |**params|
|
|
246
|
+
response_type = params.delete(:response_type) || params.delete(:_response_type) || :auto
|
|
247
|
+
request('nba-player-dash-by-game-splits', params, response_type: response_type)
|
|
248
|
+
end
|
|
249
|
+
define_method('player_dash_by_last_n_games') do |**params|
|
|
250
|
+
response_type = params.delete(:response_type) || params.delete(:_response_type) || :auto
|
|
251
|
+
request('nba-player-dash-by-last-n-games', params, response_type: response_type)
|
|
252
|
+
end
|
|
253
|
+
define_method('player_dash_by_opponent') do |**params|
|
|
254
|
+
response_type = params.delete(:response_type) || params.delete(:_response_type) || :auto
|
|
255
|
+
request('nba-player-dash-by-opponent', params, response_type: response_type)
|
|
256
|
+
end
|
|
257
|
+
define_method('player_dash_pt_pass') do |**params|
|
|
258
|
+
response_type = params.delete(:response_type) || params.delete(:_response_type) || :auto
|
|
259
|
+
request('nba-player-dash-pt-pass', params, response_type: response_type)
|
|
260
|
+
end
|
|
261
|
+
define_method('player_dash_pt_reb') do |**params|
|
|
262
|
+
response_type = params.delete(:response_type) || params.delete(:_response_type) || :auto
|
|
263
|
+
request('nba-player-dash-pt-reb', params, response_type: response_type)
|
|
264
|
+
end
|
|
265
|
+
define_method('player_dash_pt_shots') do |**params|
|
|
266
|
+
response_type = params.delete(:response_type) || params.delete(:_response_type) || :auto
|
|
267
|
+
request('nba-player-dash-pt-shots', params, response_type: response_type)
|
|
268
|
+
end
|
|
269
|
+
define_method('player_game_logs') do |**params|
|
|
270
|
+
response_type = params.delete(:response_type) || params.delete(:_response_type) || :auto
|
|
271
|
+
request('nba-player-game-logs', params, response_type: response_type)
|
|
272
|
+
end
|
|
273
|
+
define_method('player_info') do |**params|
|
|
274
|
+
response_type = params.delete(:response_type) || params.delete(:_response_type) || :auto
|
|
275
|
+
request('nba-player-info', params, response_type: response_type)
|
|
276
|
+
end
|
|
277
|
+
define_method('player_profile_v2') do |**params|
|
|
278
|
+
response_type = params.delete(:response_type) || params.delete(:_response_type) || :auto
|
|
279
|
+
request('nba-player-profile-v2', params, response_type: response_type)
|
|
280
|
+
end
|
|
281
|
+
define_method('player_pt_shot') do |**params|
|
|
282
|
+
response_type = params.delete(:response_type) || params.delete(:_response_type) || :auto
|
|
283
|
+
request('nba-player-pt-shot', params, response_type: response_type)
|
|
284
|
+
end
|
|
285
|
+
define_method('player_stats') do |**params|
|
|
286
|
+
response_type = params.delete(:response_type) || params.delete(:_response_type) || :auto
|
|
287
|
+
request('nba-player-stats', params, response_type: response_type)
|
|
288
|
+
end
|
|
289
|
+
define_method('player_streak_finder') do |**params|
|
|
290
|
+
response_type = params.delete(:response_type) || params.delete(:_response_type) || :auto
|
|
291
|
+
request('nba-player-streak-finder', params, response_type: response_type)
|
|
292
|
+
end
|
|
293
|
+
define_method('players') do |**params|
|
|
294
|
+
response_type = params.delete(:response_type) || params.delete(:_response_type) || :auto
|
|
295
|
+
request('nba-players', params, response_type: response_type)
|
|
296
|
+
end
|
|
297
|
+
define_method('playoff_picture') do |**params|
|
|
298
|
+
response_type = params.delete(:response_type) || params.delete(:_response_type) || :auto
|
|
299
|
+
request('nba-playoff-picture', params, response_type: response_type)
|
|
300
|
+
end
|
|
301
|
+
define_method('playoff_series') do |**params|
|
|
302
|
+
response_type = params.delete(:response_type) || params.delete(:_response_type) || :auto
|
|
303
|
+
request('nba-playoff-series', params, response_type: response_type)
|
|
304
|
+
end
|
|
305
|
+
define_method('pt_defend') do |**params|
|
|
306
|
+
response_type = params.delete(:response_type) || params.delete(:_response_type) || :auto
|
|
307
|
+
request('nba-pt-defend', params, response_type: response_type)
|
|
308
|
+
end
|
|
309
|
+
define_method('pt_stats') do |**params|
|
|
310
|
+
response_type = params.delete(:response_type) || params.delete(:_response_type) || :auto
|
|
311
|
+
request('nba-pt-stats', params, response_type: response_type)
|
|
312
|
+
end
|
|
313
|
+
define_method('scoreboard') do |**params|
|
|
314
|
+
response_type = params.delete(:response_type) || params.delete(:_response_type) || :auto
|
|
315
|
+
request('nba-scoreboard', params, response_type: response_type)
|
|
316
|
+
end
|
|
317
|
+
define_method('shot_chart') do |**params|
|
|
318
|
+
response_type = params.delete(:response_type) || params.delete(:_response_type) || :auto
|
|
319
|
+
request('nba-shot-chart', params, response_type: response_type)
|
|
320
|
+
end
|
|
321
|
+
define_method('standings') do |**params|
|
|
322
|
+
response_type = params.delete(:response_type) || params.delete(:_response_type) || :auto
|
|
323
|
+
request('nba-standings', params, response_type: response_type)
|
|
324
|
+
end
|
|
325
|
+
define_method('synergy_play_types') do |**params|
|
|
326
|
+
response_type = params.delete(:response_type) || params.delete(:_response_type) || :auto
|
|
327
|
+
request('nba-synergy-play-types', params, response_type: response_type)
|
|
328
|
+
end
|
|
329
|
+
define_method('team_dash_by_clutch') do |**params|
|
|
330
|
+
response_type = params.delete(:response_type) || params.delete(:_response_type) || :auto
|
|
331
|
+
request('nba-team-dash-by-clutch', params, response_type: response_type)
|
|
332
|
+
end
|
|
333
|
+
define_method('team_dash_by_game_splits') do |**params|
|
|
334
|
+
response_type = params.delete(:response_type) || params.delete(:_response_type) || :auto
|
|
335
|
+
request('nba-team-dash-by-game-splits', params, response_type: response_type)
|
|
336
|
+
end
|
|
337
|
+
define_method('team_dash_by_last_n_games') do |**params|
|
|
338
|
+
response_type = params.delete(:response_type) || params.delete(:_response_type) || :auto
|
|
339
|
+
request('nba-team-dash-by-last-n-games', params, response_type: response_type)
|
|
340
|
+
end
|
|
341
|
+
define_method('team_dash_by_opponent') do |**params|
|
|
342
|
+
response_type = params.delete(:response_type) || params.delete(:_response_type) || :auto
|
|
343
|
+
request('nba-team-dash-by-opponent', params, response_type: response_type)
|
|
344
|
+
end
|
|
345
|
+
define_method('team_dash_pt_pass') do |**params|
|
|
346
|
+
response_type = params.delete(:response_type) || params.delete(:_response_type) || :auto
|
|
347
|
+
request('nba-team-dash-pt-pass', params, response_type: response_type)
|
|
348
|
+
end
|
|
349
|
+
define_method('team_dash_pt_reb') do |**params|
|
|
350
|
+
response_type = params.delete(:response_type) || params.delete(:_response_type) || :auto
|
|
351
|
+
request('nba-team-dash-pt-reb', params, response_type: response_type)
|
|
352
|
+
end
|
|
353
|
+
define_method('team_dash_pt_shots') do |**params|
|
|
354
|
+
response_type = params.delete(:response_type) || params.delete(:_response_type) || :auto
|
|
355
|
+
request('nba-team-dash-pt-shots', params, response_type: response_type)
|
|
356
|
+
end
|
|
357
|
+
define_method('team_details') do |**params|
|
|
358
|
+
response_type = params.delete(:response_type) || params.delete(:_response_type) || :auto
|
|
359
|
+
request('nba-team-details', params, response_type: response_type)
|
|
360
|
+
end
|
|
361
|
+
define_method('team_game_logs') do |**params|
|
|
362
|
+
response_type = params.delete(:response_type) || params.delete(:_response_type) || :auto
|
|
363
|
+
request('nba-team-game-logs', params, response_type: response_type)
|
|
364
|
+
end
|
|
365
|
+
define_method('team_info_common') do |**params|
|
|
366
|
+
response_type = params.delete(:response_type) || params.delete(:_response_type) || :auto
|
|
367
|
+
request('nba-team-info-common', params, response_type: response_type)
|
|
368
|
+
end
|
|
369
|
+
define_method('team_on_off') do |**params|
|
|
370
|
+
response_type = params.delete(:response_type) || params.delete(:_response_type) || :auto
|
|
371
|
+
request('nba-team-on-off', params, response_type: response_type)
|
|
372
|
+
end
|
|
373
|
+
define_method('team_pt_shot') do |**params|
|
|
374
|
+
response_type = params.delete(:response_type) || params.delete(:_response_type) || :auto
|
|
375
|
+
request('nba-team-pt-shot', params, response_type: response_type)
|
|
376
|
+
end
|
|
377
|
+
define_method('team_roster') do |**params|
|
|
378
|
+
response_type = params.delete(:response_type) || params.delete(:_response_type) || :auto
|
|
379
|
+
request('nba-team-roster', params, response_type: response_type)
|
|
380
|
+
end
|
|
381
|
+
define_method('team_shot_locations') do |**params|
|
|
382
|
+
response_type = params.delete(:response_type) || params.delete(:_response_type) || :auto
|
|
383
|
+
request('nba-team-shot-locations', params, response_type: response_type)
|
|
384
|
+
end
|
|
385
|
+
define_method('team_stats') do |**params|
|
|
386
|
+
response_type = params.delete(:response_type) || params.delete(:_response_type) || :auto
|
|
387
|
+
request('nba-team-stats', params, response_type: response_type)
|
|
388
|
+
end
|
|
389
|
+
define_method('team_stats_leaders') do |**params|
|
|
390
|
+
response_type = params.delete(:response_type) || params.delete(:_response_type) || :auto
|
|
391
|
+
request('nba-team-stats-leaders', params, response_type: response_type)
|
|
392
|
+
end
|
|
393
|
+
define_method('team_years') do |**params|
|
|
394
|
+
response_type = params.delete(:response_type) || params.delete(:_response_type) || :auto
|
|
395
|
+
request('nba-team-years', params, response_type: response_type)
|
|
396
|
+
end
|
|
397
|
+
|
|
398
|
+
private
|
|
399
|
+
|
|
400
|
+
# POST operations take their JSON body under the body parameter name or "body".
|
|
401
|
+
def request_body(operation, params)
|
|
402
|
+
name = operation["bodyParam"]
|
|
403
|
+
return nil if name.nil?
|
|
404
|
+
value = params.key?(name) ? params[name] : params["body"]
|
|
405
|
+
if value.nil?
|
|
406
|
+
raise Errors::ClientError.new("missing request body: #{name}", operation_id: operation["id"]) if operation["bodyRequired"]
|
|
407
|
+
return nil
|
|
408
|
+
end
|
|
409
|
+
value.is_a?(String) ? value : JSON.generate(value)
|
|
410
|
+
end
|
|
411
|
+
|
|
412
|
+
def build_url(operation, params)
|
|
413
|
+
known = operation["params"].map { |param| param["name"] }
|
|
414
|
+
known << "body" if operation["bodyParam"]
|
|
415
|
+
unknown = params.keys - known
|
|
416
|
+
raise Errors::ClientError.new("unknown parameters: #{unknown.join(', ')}", operation_id: operation["id"]) unless unknown.empty?
|
|
417
|
+
path = operation["path"].dup
|
|
418
|
+
operation["params"].select { |param| param["in"] == "path" }.each do |param|
|
|
419
|
+
value = params[param["name"]]
|
|
420
|
+
raise Errors::ClientError.new("missing path parameter: #{param['name']}", operation_id: operation["id"]) if value.nil?
|
|
421
|
+
path.sub!("{" + param["name"] + "}", percent_encode(value.to_s))
|
|
422
|
+
end
|
|
423
|
+
pairs = []
|
|
424
|
+
operation["queryParams"].each do |param|
|
|
425
|
+
name = param["name"]
|
|
426
|
+
value = params.key?(name) ? params[name] : param["default"]
|
|
427
|
+
if value.nil?
|
|
428
|
+
raise Errors::ClientError.new("missing query parameter: #{name}", operation_id: operation["id"]) if param["required"]
|
|
429
|
+
next
|
|
430
|
+
end
|
|
431
|
+
enum_values = param["enum"] || (param["items"] && param["items"]["enum"])
|
|
432
|
+
if enum_values && !(value.is_a?(Array) ? value : [value]).all? { |item| enum_values.map(&:to_s).include?(item.to_s) }
|
|
433
|
+
raise Errors::ClientError.new("invalid value for #{name}", operation_id: operation["id"])
|
|
434
|
+
end
|
|
435
|
+
if value.is_a?(Array)
|
|
436
|
+
format = param["collectionFormat"] || "csv"
|
|
437
|
+
if format == "multi"
|
|
438
|
+
value.each { |item| pairs << [name, scalar(item)] }
|
|
439
|
+
else
|
|
440
|
+
separator = {"csv" => ",", "ssv" => " ", "tsv" => "\t", "pipes" => "|"}[format] || ","
|
|
441
|
+
pairs << [name, value.map { |item| scalar(item) }.join(separator)]
|
|
442
|
+
end
|
|
443
|
+
else
|
|
444
|
+
pairs << [name, scalar(value)]
|
|
445
|
+
end
|
|
446
|
+
end
|
|
447
|
+
query = pairs.map { |name, value| "#{percent_encode(name)}=#{percent_encode(value)}" }.join("&")
|
|
448
|
+
@base_url + path + (query.empty? ? "" : "?" + query)
|
|
449
|
+
end
|
|
450
|
+
|
|
451
|
+
def scalar(value)
|
|
452
|
+
value == true ? "true" : (value == false ? "false" : value.to_s)
|
|
453
|
+
end
|
|
454
|
+
|
|
455
|
+
def percent_encode(value)
|
|
456
|
+
URI::DEFAULT_PARSER.escape(value.to_s, /[^A-Za-z0-9\-._~]/)
|
|
457
|
+
end
|
|
458
|
+
|
|
459
|
+
def parse_response(body, content_type, operation, params, response_type)
|
|
460
|
+
type = response_type.to_s
|
|
461
|
+
raise Errors::ClientError.new("response_type must be auto, json, or text", operation_id: operation["id"]) unless %w[auto json text].include?(type)
|
|
462
|
+
format = operation["params"].find { |param| param["name"] == "format" }
|
|
463
|
+
text_formats = format && format["enum"] ? format["enum"].reject { |value| %w[json application/json].include?(value.to_s.downcase) } : []
|
|
464
|
+
raw_format = params["format"] && text_formats.include?(params["format"].to_s)
|
|
465
|
+
json_format = format && format["enum"] && format["enum"].any? { |value| %w[json application/json].include?(value.to_s.downcase) } && %w[json application/json].include?(params["format"].to_s.downcase)
|
|
466
|
+
is_json = json_format || content_type.to_s.downcase.include?("json") || operation["produces"] == ["application/json"]
|
|
467
|
+
return body if type == "text" || raw_format || (type == "auto" && !is_json)
|
|
468
|
+
JSON.parse(body)
|
|
469
|
+
rescue JSON::ParserError => error
|
|
470
|
+
raise Errors::Error.new("invalid JSON response from Crawlora: #{error.message}", operation_id: operation["id"], body: body)
|
|
471
|
+
end
|
|
472
|
+
|
|
473
|
+
public
|
|
474
|
+
end
|
|
475
|
+
end
|
|
476
|
+
end
|
data/lib/crawlora/nba.rb
ADDED
metadata
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: crawlora-nba
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.1.1
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Crawlora
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: bin
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2026-11-28 00:00:00.000000000 Z
|
|
12
|
+
dependencies: []
|
|
13
|
+
description: Ruby client for Crawlora's hosted NBA API. Covers games, standings, player
|
|
14
|
+
and team statistics, play-by-play, and dashboards across 70 endpoints.
|
|
15
|
+
email:
|
|
16
|
+
executables: []
|
|
17
|
+
extensions: []
|
|
18
|
+
extra_rdoc_files: []
|
|
19
|
+
files:
|
|
20
|
+
- CHANGELOG.md
|
|
21
|
+
- LICENSE
|
|
22
|
+
- README.md
|
|
23
|
+
- lib/crawlora/nba.rb
|
|
24
|
+
- lib/crawlora/nba/client.rb
|
|
25
|
+
- lib/crawlora/nba/version.rb
|
|
26
|
+
homepage: https://crawlora.net/?utm_source=rubygems&utm_medium=referral&utm_campaign=platform-clients&utm_content=nba-ruby-homepage
|
|
27
|
+
licenses:
|
|
28
|
+
- MIT
|
|
29
|
+
metadata:
|
|
30
|
+
source_code_uri: https://github.com/Crawlora-org/crawlora-nba
|
|
31
|
+
documentation_uri: https://github.com/Crawlora-org/crawlora-nba/blob/main/ruby/README.md
|
|
32
|
+
rubygems_mfa_required: 'true'
|
|
33
|
+
post_install_message:
|
|
34
|
+
rdoc_options: []
|
|
35
|
+
require_paths:
|
|
36
|
+
- lib
|
|
37
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
38
|
+
requirements:
|
|
39
|
+
- - ">="
|
|
40
|
+
- !ruby/object:Gem::Version
|
|
41
|
+
version: '2.6'
|
|
42
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
43
|
+
requirements:
|
|
44
|
+
- - ">="
|
|
45
|
+
- !ruby/object:Gem::Version
|
|
46
|
+
version: '0'
|
|
47
|
+
requirements: []
|
|
48
|
+
rubygems_version: 3.4.19
|
|
49
|
+
signing_key:
|
|
50
|
+
specification_version: 4
|
|
51
|
+
summary: NBA API client for Crawlora (70 endpoints)
|
|
52
|
+
test_files: []
|