๐ Here you can compare and analyze data from NBA players and teams.
Welcome to the NBA-StatisticAPI API documentation! This API is designed to provide quick and easy access to various NBA-related statistics and information. The NBA-StatisticAPI consumes data from the public API available at https://github.com/swar/nba_api, which offers a wide range of up-to-date resources on players, teams, career statistics, draft history and more.
To install and run the API, follow the steps below:
- Clone the repository:
git clone https://github.com/rychardbarros/NBA-StatisticAPI.git
cd NBA-StatisticAPI
- Create and activate a virtual environment (optional but recommended):
pip install virtualenv
python -m venv venv
# On Windows
venv\Scripts\activate
# On Linux/Mac
source venv/bin/activate
- Install the dependencies:
install -r requirements.txt
How to Use
Open a terminal or command prompt. Navigate to the directory where the API is located:
cd path/to/the/NBA-StatisticAPI/src/api
Start the API server by running the routes.py file:
python routes.py
In another terminal or command prompt window, navigate to the root directory of the API:
cd path/to/the/NBA-StatisticAPI
Run the Streamlit app with the following command:
streamlit run main.py
Now, you can explore and interact with the NBA-StatisticAPI to get detailed information about players, teams, career statistics, and more related to the NBA. Have fun exploring the data and creating exciting applications for basketball fans! Endpoints
The API provides the following endpoints for accessing NBA data:
/player/{id} (GET Method): Returns the career statistics of a specific player based on the provided player ID.
/player/name/{id} (GET Method): Returns information about a specific player based on their full name.
/player/{id}/vs/{vs_id} (GET Method): Compares the statistics of two players based on their IDs.
/team/all (GET Method): Returns a list of all NBA teams.
/team/details/{id} (GET Method): Returns details about a specific team based on its ID.
/draft/all (GET Method): Returns information about all NBA drafts.
/franchise/all (GET Method): Returns information about all NBA franchises.
/team/stats/{id} (GET Method): Returns the statistics of a specific team based on its ID.
Made by Rychard Barros