nba_api

An API Client package to access the APIs for NBA.com

Github星跟蹤圖

PyPI
CircleCI (all branches)
GitHub
GitHub

nba_api

An API Client package to access the APIs for NBA.com

Development Version: v1.1.8

nba_api is an API Client for www.nba.com. This package is meant to make the API Endpoints more accessible and to provide extensive documentation.

The APIs on www.nba.com are largely undocumented and change frequently.

Please feel free to contribute and have an open discussion regarding improvements and additional APIs to be mapped.

Recent Changes

  • Adding individual proxy, headers, and timeout support for requests. Usage

Mapped API Clients

  1. stats.nba.com - stats

Use

Installation

pip install nba_api

Required and Optional Packages:

Usage Examples

  • Basic Usage -- The basics of calling an API endpoint.
  • Jupyter Notebooks -- Larger practical examples in Jupyter Notebook format, including looking for play-by-play data for a particular game.

Documentation

Contributing and Development

Development

To get started developing, clone the repo and cd into it.
Then, in an environment (conda or virtualenv) where you have not yet installed nba_api, run

python -m pip install -e .

This command will install the package for development, such that any changes you make in the repo will be reflected the next time you import the package in Python.

Testing

If you make a change to the package, it's important to verify everything still works.
Do so by first installing the package for development, with the -e flag (see Development above), and then running

pytest

on the command line from the base directory of the repo.
The pytest utility will run through all the package tests and print output throughout, informing you of any failures.

Contributing

We're always looking for people to help!
Some examples of ways to get involved are:

  • fix a bug
  • add a feature
  • create or improve documentation and examples

Just fork this repo, make your changes (see Development above), and issue a pull request.

Other

Endpoint Analysis

A major purpose of this package is to map and analyze as many endpoints on NBA.com as possible. The documentation and analysis on the Endpoints and Parameters found in this package is some of the most extensive information available on these largely undocumented Endpoints. Please open an issue with any additional Endpoints/APIs.

Examples for Other Clients

Endpoint Analysis JSON for use with other clients

主要指標

概覽
名稱與所有者swar/nba_api
主編程語言Python
編程語言Python (語言數: 2)
平台
許可證MIT License
所有者活动
創建於2018-09-17 03:13:07
推送於2025-04-09 12:50:39
最后一次提交2025-04-09 08:50:39
發布數30
最新版本名稱v1.9.0 (發布於 )
第一版名稱v1.0.3 (發布於 )
用户参与
星數2.9k
關注者數95
派生數605
提交數394
已啟用問題?
問題數350
打開的問題數78
拉請求數154
打開的拉請求數1
關閉的拉請求數28
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?