nba_api


Namenba_api JSON
Version 1.6.1 PyPI version JSON
download
home_pagehttps://github.com/swar/nba_api
SummaryAn API Client package to access the APIs for NBA.com
upload_time2024-10-29 20:29:18
maintainerSwar Patel
docs_urlNone
authorSwar Patel
requires_python<4.0,>=3.9
licenseMIT
keywords api basketball data nba sports stats
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![Version: PyPI](https://img.shields.io/pypi/v/nba_api.svg?longCache=true&style=for-the-badge&logo=pypi)](https://pypi.python.org/pypi/nba_api)
[![Downloads per Month: PyPY](https://img.shields.io/pypi/dm/nba_api.svg?style=for-the-badge)](https://pepy.tech/project/nba-api)
[![Build: CircleCI](https://img.shields.io/circleci/project/github/swar/nba_api.svg?style=for-the-badge&logo=circleci)](https://circleci.com/gh/swar/nba_api)
[![License: MIT](https://img.shields.io/github/license/swar/nba_api.svg?style=for-the-badge)](https://github.com/swar/nba_api/blob/master/LICENSE)
[![Slack](https://img.shields.io/badge/Slack-NBA_API-4A154B?style=for-the-badge&logo=slack)](https://join.slack.com/t/nbaapi/shared_invite/zt-2c18itntt-ObWh0ovNQmnwLGFagmCbpg)

# nba_api

## An API Client Package to Access the APIs of NBA.com

`nba_api` is an API Client for `www.nba.com`. This package intends to make the APIs of [NBA.com](https://www.nba.com/) easily accessible and provide extensive documentation about them.

# Getting Started

`nba_api` requires Python 3.7+ along with the `requests` and `numpy` packages. While `pandas` is not required, it is required to work with Pandas DataFrames.

```bash
pip install nba_api
```

## NBA Official Stats

```python
from nba_api.stats.endpoints import playercareerstats

# Nikola Jokić
career = playercareerstats.PlayerCareerStats(player_id='203999') 

# pandas data frames (optional: pip install pandas)
career.get_data_frames()[0]

# json
career.get_json()

# dictionary
career.get_dict()
```

## NBA Live Data

```python
from nba_api.live.nba.endpoints import scoreboard

# Today's Score Board
games = scoreboard.ScoreBoard()

# json
games.get_json()

# dictionary
games.get_dict()
```

## Additional Examples

- [Requests/Response Options](https://github.com/swar/nba_api/blob/master/docs/nba_api/stats/examples.md#endpoint-usage-example)
  - Proxy Support, Custom Headers, and Timeout Settings
  - Return Types and Raw Responses
- [Static Data Sets](https://github.com/swar/nba_api/blob/master/docs/nba_api/stats/examples.md#static-usage-examples)
  - Reduce HTTP requests for common and frequently accessed player and team data.
- [Jupyter Notebooks](https://github.com/swar/nba_api/tree/master/docs/examples)
  - Practical examples in Jupyter Notebook format, including making basic calls, finding games, working with play-by-play data, and interacting with live game data.

# Documentation

- [Table of Contents](https://github.com/swar/nba_api/tree/master/docs/table_of_contents.md)
- [Package Structure](https://github.com/swar/nba_api/tree/master/docs/package_structure.md)
- [Endpoints](/docs/nba_api/stats/endpoints)
- Static Data Sets
  - [players.py](https://github.com/swar/nba_api/tree/master/docs/nba_api/stats/static/players.md)
  - [teams.py](https://github.com/swar/nba_api/tree/master/docs/nba_api/stats/static/teams.md)

# Join the Community
## Slack

Join [Slack](https://join.slack.com/t/nbaapi/shared_invite/zt-2c18itntt-ObWh0ovNQmnwLGFagmCbpg) to get help, help others, provide feedback, see amazing projects, participates in discussions, and collaborate with others from around the world.

## Stack Overflow

Not a Slack fan? No problem. Head over to [StackOverflow](https://stackoverflow.com/questions/tagged/nba-api). Be sure to tag your post with `nba-api`.

# Contributing

*See [Contributing to the NBA_API](https://github.com/swar/nba_api/blob/master/CONTRIBUTING.md) for complete details.*

## Endpoints

A significant purpose of this package is to continuously map and analyze as many endpoints on NBA.com as possible. The documentation and analysis of the endpoints and parameters in this package are some of the most extensive information available. At the same time, NBA.com does not provide information regarding new, changed, or removed endpoints.

If you find a new, changed, or deprecated endpoint, open a [GitHub Issue](https://github.com/swar/nba_api/issues)

## Bugs

Encounter a bug, [report a bug](https://github.com/swar/nba_api/issues).

# License & Terms of Use

## API Client Package

The `nba_api` package is Open Source with an [MIT License](https://github.com/swar/nba_api/blob/master/LICENSE).

## NBA.com

NBA.com has a [Terms of Use](https://www.nba.com/termsofuse) regarding the use of the NBA’s digital platforms.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/swar/nba_api",
    "name": "nba_api",
    "maintainer": "Swar Patel",
    "docs_url": null,
    "requires_python": "<4.0,>=3.9",
    "maintainer_email": "swar.m.patel@gmail.com",
    "keywords": "api, basketball, data, nba, sports, stats",
    "author": "Swar Patel",
    "author_email": "swar.m.patel@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/89/1a/877190ca2a22dc3c08f5b750aab808fdd089a60d6b24018d12a03afb5949/nba_api-1.6.1.tar.gz",
    "platform": null,
    "description": "[![Version: PyPI](https://img.shields.io/pypi/v/nba_api.svg?longCache=true&style=for-the-badge&logo=pypi)](https://pypi.python.org/pypi/nba_api)\n[![Downloads per Month: PyPY](https://img.shields.io/pypi/dm/nba_api.svg?style=for-the-badge)](https://pepy.tech/project/nba-api)\n[![Build: CircleCI](https://img.shields.io/circleci/project/github/swar/nba_api.svg?style=for-the-badge&logo=circleci)](https://circleci.com/gh/swar/nba_api)\n[![License: MIT](https://img.shields.io/github/license/swar/nba_api.svg?style=for-the-badge)](https://github.com/swar/nba_api/blob/master/LICENSE)\n[![Slack](https://img.shields.io/badge/Slack-NBA_API-4A154B?style=for-the-badge&logo=slack)](https://join.slack.com/t/nbaapi/shared_invite/zt-2c18itntt-ObWh0ovNQmnwLGFagmCbpg)\n\n# nba_api\n\n## An API Client Package to Access the APIs of NBA.com\n\n`nba_api` is an API Client for `www.nba.com`. This package intends to make the APIs of [NBA.com](https://www.nba.com/) easily accessible and provide extensive documentation about them.\n\n# Getting Started\n\n`nba_api` requires Python 3.7+ along with the `requests` and `numpy` packages. While `pandas` is not required, it is required to work with Pandas DataFrames.\n\n```bash\npip install nba_api\n```\n\n## NBA Official Stats\n\n```python\nfrom nba_api.stats.endpoints import playercareerstats\n\n# Nikola Joki\u0107\ncareer = playercareerstats.PlayerCareerStats(player_id='203999') \n\n# pandas data frames (optional: pip install pandas)\ncareer.get_data_frames()[0]\n\n# json\ncareer.get_json()\n\n# dictionary\ncareer.get_dict()\n```\n\n## NBA Live Data\n\n```python\nfrom nba_api.live.nba.endpoints import scoreboard\n\n# Today's Score Board\ngames = scoreboard.ScoreBoard()\n\n# json\ngames.get_json()\n\n# dictionary\ngames.get_dict()\n```\n\n## Additional Examples\n\n- [Requests/Response Options](https://github.com/swar/nba_api/blob/master/docs/nba_api/stats/examples.md#endpoint-usage-example)\n  - Proxy Support, Custom Headers, and Timeout Settings\n  - Return Types and Raw Responses\n- [Static Data Sets](https://github.com/swar/nba_api/blob/master/docs/nba_api/stats/examples.md#static-usage-examples)\n  - Reduce HTTP requests for common and frequently accessed player and team data.\n- [Jupyter Notebooks](https://github.com/swar/nba_api/tree/master/docs/examples)\n  - Practical examples in Jupyter Notebook format, including making basic calls, finding games, working with play-by-play data, and interacting with live game data.\n\n# Documentation\n\n- [Table of Contents](https://github.com/swar/nba_api/tree/master/docs/table_of_contents.md)\n- [Package Structure](https://github.com/swar/nba_api/tree/master/docs/package_structure.md)\n- [Endpoints](/docs/nba_api/stats/endpoints)\n- Static Data Sets\n  - [players.py](https://github.com/swar/nba_api/tree/master/docs/nba_api/stats/static/players.md)\n  - [teams.py](https://github.com/swar/nba_api/tree/master/docs/nba_api/stats/static/teams.md)\n\n# Join the Community\n## Slack\n\nJoin [Slack](https://join.slack.com/t/nbaapi/shared_invite/zt-2c18itntt-ObWh0ovNQmnwLGFagmCbpg) to get help, help others, provide feedback, see amazing projects, participates in discussions, and collaborate with others from around the world.\n\n## Stack Overflow\n\nNot a Slack fan? No problem. Head over to [StackOverflow](https://stackoverflow.com/questions/tagged/nba-api). Be sure to tag your post with `nba-api`.\n\n# Contributing\n\n*See [Contributing to the NBA_API](https://github.com/swar/nba_api/blob/master/CONTRIBUTING.md) for complete details.*\n\n## Endpoints\n\nA significant purpose of this package is to continuously map and analyze as many endpoints on NBA.com as possible. The documentation and analysis of the endpoints and parameters in this package are some of the most extensive information available. At the same time, NBA.com does not provide information regarding new, changed, or removed endpoints.\n\nIf you find a new, changed, or deprecated endpoint, open a [GitHub Issue](https://github.com/swar/nba_api/issues)\n\n## Bugs\n\nEncounter a bug, [report a bug](https://github.com/swar/nba_api/issues).\n\n# License & Terms of Use\n\n## API Client Package\n\nThe `nba_api` package is Open Source with an [MIT License](https://github.com/swar/nba_api/blob/master/LICENSE).\n\n## NBA.com\n\nNBA.com has a [Terms of Use](https://www.nba.com/termsofuse) regarding the use of the NBA\u2019s digital platforms.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "An API Client package to access the APIs for NBA.com",
    "version": "1.6.1",
    "project_urls": {
        "Bug Tracker": "https://github.com/swar/nba_api/issues",
        "Documentation": "https://github.com/swar/nba_api/blob/master/README.md",
        "Homepage": "https://github.com/swar/nba_api",
        "Repository": "https://github.com/swar/nba_api"
    },
    "split_keywords": [
        "api",
        " basketball",
        " data",
        " nba",
        " sports",
        " stats"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3b2ca58ac53ef96be6a611f5ccf849638d6d06f5fa572c0754ef1d176a039e74",
                "md5": "d54d3ec9a36affa84fbeeb87dfa358b2",
                "sha256": "c972c57283ed026e4d75ab11aedb0e7df45dc9eaa7b2d3ec48e53d6029e87f49"
            },
            "downloads": -1,
            "filename": "nba_api-1.6.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "d54d3ec9a36affa84fbeeb87dfa358b2",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.9",
            "size": 279357,
            "upload_time": "2024-10-29T20:29:17",
            "upload_time_iso_8601": "2024-10-29T20:29:17.270322Z",
            "url": "https://files.pythonhosted.org/packages/3b/2c/a58ac53ef96be6a611f5ccf849638d6d06f5fa572c0754ef1d176a039e74/nba_api-1.6.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "891a877190ca2a22dc3c08f5b750aab808fdd089a60d6b24018d12a03afb5949",
                "md5": "70bfe9a7069aa6555658dac8527a3f0d",
                "sha256": "44c6aa1ccc354a6b307e4e1012788752e6da436c1e6f87035f978f2bf7e95a08"
            },
            "downloads": -1,
            "filename": "nba_api-1.6.1.tar.gz",
            "has_sig": false,
            "md5_digest": "70bfe9a7069aa6555658dac8527a3f0d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.9",
            "size": 151830,
            "upload_time": "2024-10-29T20:29:18",
            "upload_time_iso_8601": "2024-10-29T20:29:18.631235Z",
            "url": "https://files.pythonhosted.org/packages/89/1a/877190ca2a22dc3c08f5b750aab808fdd089a60d6b24018d12a03afb5949/nba_api-1.6.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-29 20:29:18",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "swar",
    "github_project": "nba_api",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "circle": true,
    "lcname": "nba_api"
}
        
Elapsed time: 0.39297s