nba-api


Namenba-api JSON
Version 1.2.1 PyPI version JSON
download
home_pagehttps://github.com/swar/nba_api
SummaryAn API Client package to access the APIs for NBA.com
upload_time2023-06-13 13:58:21
maintainerSwar Patel
docs_urlNone
authorSwar Patel
requires_python>=3.8,<4.0
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-1ipsuai9j-GjZjuP9S2~Uczuny1t74zA)

# 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 `panadas` 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-cayfrnfo-s9rySAmBXxBloL09S6N0KA) 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": ">=3.8,<4.0",
    "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/93/ed/c9cf72f4f38b45647c23a2de83cda00912248306c90baf3642b7d51b2e9c/nba_api-1.2.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-1ipsuai9j-GjZjuP9S2~Uczuny1t74zA)\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 `panadas` 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-cayfrnfo-s9rySAmBXxBloL09S6N0KA) 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.2.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": "c5c975c4aa0ec973b42df364547e5c3eba40a2ae523c479ac4e0548803f9bd9d",
                "md5": "d9e7d9a5808936ce4e547624832ffa36",
                "sha256": "3c03c0a2a69247b96237111d6204f65ebc566dadf055a3a26e6ed2e7453814c3"
            },
            "downloads": -1,
            "filename": "nba_api-1.2.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "d9e7d9a5808936ce4e547624832ffa36",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8,<4.0",
            "size": 257266,
            "upload_time": "2023-06-13T13:58:19",
            "upload_time_iso_8601": "2023-06-13T13:58:19.433414Z",
            "url": "https://files.pythonhosted.org/packages/c5/c9/75c4aa0ec973b42df364547e5c3eba40a2ae523c479ac4e0548803f9bd9d/nba_api-1.2.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "93edc9cf72f4f38b45647c23a2de83cda00912248306c90baf3642b7d51b2e9c",
                "md5": "df0e1701199f27a33ee06a2fdea06dc8",
                "sha256": "51e3b552c9fa9f8eb1e4c734474eb00a904b6286b033d70463267d653825ebd8"
            },
            "downloads": -1,
            "filename": "nba_api-1.2.1.tar.gz",
            "has_sig": false,
            "md5_digest": "df0e1701199f27a33ee06a2fdea06dc8",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8,<4.0",
            "size": 126334,
            "upload_time": "2023-06-13T13:58:21",
            "upload_time_iso_8601": "2023-06-13T13:58:21.464569Z",
            "url": "https://files.pythonhosted.org/packages/93/ed/c9cf72f4f38b45647c23a2de83cda00912248306c90baf3642b7d51b2e9c/nba_api-1.2.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-06-13 13:58:21",
    "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.12696s