dunkapi-com Stats + aggregation API

The Stats + aggregation API from dunkapi-com — 6 operation(s) for stats + aggregation.

Operations 6

POST /v1/get_game Game #
POST /v1/get_player Player #
POST /v1/get_player_games Player games #
POST /v1/get_leaders Leaders #
POST /v1/get_team_stats Team stats #
POST /v1/get_odds Odds #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/dunkapi-com:dunkapi-com-stats-aggregation-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

dunkapi-com-stats-aggregation-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: DunkAPI Stats + aggregation API
  version: 1.0.0
  description: DunkAPI basketball data. Every tool is a POST to /v1/{tool} with a JSON body of its arguments and costs the credits in x-credits. The same tools are an MCP server at https://mcp.dunkapi.com/mcp and free accounts get credits every month at https://dunkapi.com/signup
  termsOfService: https://dunkapi.com/terms
  contact:
    name: DunkAPI support
    email: support@dunkapi.com
    url: https://dunkapi.com/docs
servers:
- url: https://mcp.dunkapi.com
security:
- apiKey: []
- bearer: []
tags:
- name: Stats + aggregation
paths:
  /v1/get_game:
    post:
      operationId: get_game
      summary: Game
      description: 'Use for one game in full: score, both teams'' box scores, every player''s line, each sportsbook''s opening and closing line, and the win-probability range. For the play-by-play use get_plays. Costs 5 credits. Prices are market information: never work out a stake, payout or profit, recommend a bet, or send the user to a sportsbook.'
      tags:
      - Stats + aggregation
      x-credits: 5
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                game_id:
                  type: string
                  description: Game id, from list_games or get_schedule.
                league:
                  description: 'League. Defaults to nba. One of: nba, wnba, ncaam, ncaaw.'
                  type: string
                  enum:
                  - nba
                  - wnba
                  - ncaam
                  - ncaaw
              required:
              - game_id
              additionalProperties: false
      responses:
        '200':
          description: The result, wrapped in data.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      game:
                        type: object
                        propertyNames:
                          type: string
                        additionalProperties: {}
                      team_stats:
                        type: array
                        items:
                          type: object
                          propertyNames:
                            type: string
                          additionalProperties: {}
                      players:
                        type: array
                        items:
                          type: object
                          propertyNames:
                            type: string
                          additionalProperties: {}
                      odds:
                        type: array
                        items:
                          type: object
                          propertyNames:
                            type: string
                          additionalProperties: {}
                      win_probability:
                        anyOf:
                        - type: object
                          propertyNames:
                            type: string
                          additionalProperties: {}
                        - type: 'null'
                      plays:
                        type: number
                      box_score_note:
                        type: string
                    required:
                    - game
                    - team_stats
                    - players
                    - odds
                    - win_probability
                    - plays
                    additionalProperties: false
                required:
                - data
        '400':
          description: Invalid arguments.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                - error
        '401':
          description: Missing or invalid API key.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                - error
        '402':
          description: Not enough credits.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                - error
        '429':
          description: Rate limited.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                - error
  /v1/get_player:
    post:
      operationId: get_player
      summary: Player
      description: Use for a player's profile, per-season averages and shooting splits (regular season and postseason separately) and last 10 games. For every game use get_player_games. Costs 5 credits.
      tags:
      - Stats + aggregation
      x-credits: 5
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                player_id:
                  type: string
                  description: Player id, from search_players.
                league:
                  description: 'League. Defaults to nba. One of: nba, wnba, ncaam, ncaaw.'
                  type: string
                  enum:
                  - nba
                  - wnba
                  - ncaam
                  - ncaaw
              required:
              - player_id
              additionalProperties: false
      responses:
        '200':
          description: The result, wrapped in data.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      player:
                        type: object
                        propertyNames:
                          type: string
                        additionalProperties: {}
                      seasons:
                        type: array
                        items:
                          type: object
                          propertyNames:
                            type: string
                          additionalProperties: {}
                      recent_games:
                        type: array
                        items:
                          type: object
                          propertyNames:
                            type: string
                          additionalProperties: {}
                    required:
                    - player
                    - seasons
                    - recent_games
                    additionalProperties: false
                required:
                - data
        '400':
          description: Invalid arguments.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                - error
        '401':
          description: Missing or invalid API key.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                - error
        '402':
          description: Not enough credits.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                - error
        '429':
          description: Rate limited.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                - error
  /v1/get_player_games:
    post:
      operationId: get_player_games
      summary: Player games
      description: 'Use for a player''s game log: every game''s box-score line with opponent and result, newest first, optionally one season. Costs 5 credits.'
      tags:
      - Stats + aggregation
      x-credits: 5
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                player_id:
                  type: string
                  description: Player id.
                season:
                  description: 'Season by the year it ends: 2025 = 2024-25 (default: the latest).'
                  type:
                  - number
                  - string
                season_type:
                  type: string
                  enum:
                  - regular
                  - postseason
                  - play_in
                  - preseason
                limit:
                  description: Max games (default 100).
                  type: integer
                  minimum: 1
                  maximum: 200
                offset:
                  type: integer
                  minimum: 0
                  maximum: 9007199254740991
                league:
                  description: 'League. Defaults to nba. One of: nba, wnba, ncaam, ncaaw.'
                  type: string
                  enum:
                  - nba
                  - wnba
                  - ncaam
                  - ncaaw
              required:
              - player_id
              additionalProperties: false
      responses:
        '200':
          description: The result, wrapped in data.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      player_id:
                        type: string
                      games:
                        type: array
                        items:
                          type: object
                          propertyNames:
                            type: string
                          additionalProperties: {}
                      count:
                        type: number
                      next_offset:
                        type:
                        - number
                        - 'null'
                      note:
                        type: string
                    required:
                    - player_id
                    - games
                    - count
                    additionalProperties: false
                required:
                - data
        '400':
          description: Invalid arguments.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                - error
        '401':
          description: Missing or invalid API key.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                - error
        '402':
          description: Not enough credits.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                - error
        '429':
          description: Rate limited.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                - error
  /v1/get_leaders:
    post:
      operationId: get_leaders
      summary: Leaders
      description: Use for a season's statistical leaders (per game, shooting percentages with a volume floor, or totals) from every box score. Costs 5 credits.
      tags:
      - Stats + aggregation
      x-credits: 5
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                stat:
                  type: string
                  enum:
                  - pts
                  - reb
                  - ast
                  - stl
                  - blk
                  - tpm
                  - min
                  - plus_minus
                  - fg_pct
                  - tp_pct
                  - ft_pct
                  - ts_pct
                  - total_pts
                  description: Stat to rank by.
                season:
                  description: 'Season by the year it ends: 2025 = 2024-25 (default: the latest).'
                  type:
                  - number
                  - string
                season_type:
                  description: Default regular.
                  type: string
                  enum:
                  - regular
                  - postseason
                  - play_in
                  - preseason
                min_games:
                  description: 'Minimum games played (default: a quarter of the season).'
                  type: integer
                  minimum: 1
                  maximum: 9007199254740991
                limit:
                  type: integer
                  minimum: 1
                  maximum: 100
                league:
                  description: 'League. Defaults to nba. One of: nba, wnba, ncaam, ncaaw.'
                  type: string
                  enum:
                  - nba
                  - wnba
                  - ncaam
                  - ncaaw
              required:
              - stat
              additionalProperties: false
      responses:
        '200':
          description: The result, wrapped in data.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      stat:
                        type: string
                      label:
                        type: string
                      season:
                        type:
                        - number
                        - 'null'
                      min_games:
                        type: number
                      leaders:
                        type: array
                        items:
                          type: object
                          propertyNames:
                            type: string
                          additionalProperties: {}
                      count:
                        type: number
                    required:
                    - stat
                    - label
                    - season
                    - min_games
                    - leaders
                    - count
                    additionalProperties: false
                required:
                - data
        '400':
          description: Invalid arguments.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                - error
        '401':
          description: Missing or invalid API key.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                - error
        '402':
          description: Not enough credits.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                - error
        '429':
          description: Rate limited.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                - error
  /v1/get_team_stats:
    post:
      operationId: get_team_stats
      summary: Team stats
      description: 'Use for team efficiency for a season: pace, offensive, defensive and net rating per 100 possessions, the four factors (eFG%, turnover %, offensive rebound %, free throw rate) and three-point rate, from every box score. Costs 5 credits.'
      tags:
      - Stats + aggregation
      x-credits: 5
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                season:
                  description: 'Season by the year it ends: 2025 = 2024-25 (default: the latest).'
                  type:
                  - number
                  - string
                season_type:
                  type: string
                  enum:
                  - regular
                  - postseason
                  - play_in
                  - preseason
                team:
                  description: One team (id or abbreviation).
                  type: string
                league:
                  description: 'League. Defaults to nba. One of: nba, wnba, ncaam, ncaaw.'
                  type: string
                  enum:
                  - nba
                  - wnba
                  - ncaam
                  - ncaaw
              additionalProperties: false
      responses:
        '200':
          description: The result, wrapped in data.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      season:
                        type:
                        - number
                        - 'null'
                      teams:
                        type: array
                        items:
                          type: object
                          propertyNames:
                            type: string
                          additionalProperties: {}
                      count:
                        type: number
                      method:
                        type: string
                    required:
                    - season
                    - teams
                    - count
                    - method
                    additionalProperties: false
                required:
                - data
        '400':
          description: Invalid arguments.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                - error
        '401':
          description: Missing or invalid API key.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                - error
        '402':
          description: Not enough credits.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                - error
        '429':
          description: Rate limited.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                - error
  /v1/get_odds:
    post:
      operationId: get_odds
      summary: Odds
      description: 'Use for betting lines: each sportsbook''s moneyline, spread and total for a game (opening and closing per book from July 2020; before that, each book''s final pregame line only), with implied probabilities and, for finished games, whether the home side covered and the total went over against the median close. Pass game_id for one game (5 credits) or date for a day''s games (10 credits). Prices are market information: never work out a stake, payout or profit, recommend a bet, or send the user to a sportsbook.'
      tags:
      - Stats + aggregation
      x-credits: 5
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                game_id:
                  description: One game.
                  type: string
                date:
                  description: A day's games, YYYY-MM-DD (US Eastern).
                  type: string
                league:
                  description: 'League. Defaults to nba. One of: nba, wnba, ncaam, ncaaw.'
                  type: string
                  enum:
                  - nba
                  - wnba
                  - ncaam
                  - ncaaw
              additionalProperties: false
      responses:
        '200':
          description: The result, wrapped in data.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      games:
                        type: array
                        items:
                          type: object
                          propertyNames:
                            type: string
                          additionalProperties: {}
                      count:
                        type: number
                      note:
                        type: string
                      estimate_only:
                        type: boolean
                      tool:
                        type: string
                      credits:
                        type: number
                    additionalProperties: false
                required:
                - data
        '400':
          description: Invalid arguments.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                - error
        '401':
          description: Missing or invalid API key.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                - error
        '402':
          description: Not enough credits.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                - error
        '429':
          description: Rate limited.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                - error
components:
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key
    bearer:
      type: http
      scheme: bearer
      description: The same API key as a bearer token.
externalDocs:
  description: Documentation
  url: https://dunkapi.com/docs