An open API service indexing awesome lists of open source software.

https://github.com/kaikymoura/backcourt-api

Repository for the Basketball Advanced Stats API
https://github.com/kaikymoura/backcourt-api

fastapi nba-api nba-stats numpy pandas python swagger uvicorn

Last synced: 5 months ago
JSON representation

Repository for the Basketball Advanced Stats API

Awesome Lists containing this project

README

          

BackCourt Api


Repository for the BackCourt | NBA Stats & News Api

![GitHub top language](https://img.shields.io/github/languages/top/kaikyMoura/BackCourt-api)
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/ce1f958181d743b98107dbc70dfac5ed)](https://app.codacy.com/gh/kaikyMoura/BackCourt-api/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)
![Repository size](https://img.shields.io/github/repo-size/kaikyMoura/BackCourt-api)
![Github last commit](https://img.shields.io/github/last-commit/kaikyMoura/BackCourt-api)
![License](https://img.shields.io/aur/license/LICENSE)
![Languages count](https://img.shields.io/github/languages/count/kaikyMoura/BackCourt-api)

### 1. About the Project

This project is a FastAPI-based web scraping API designed to collect and provide advanced basketball statistics from various online sources. The API fetches articles and data related to basketball using web scraping techniques, processes the extracted information, and serves it through RESTful endpoints. Also, it uses the [nba_api](https://github.com/swar/nba_api) retrieve official NBA statistics.

### 2. Key Features

- Fetches basketball-related articles from multiple websites
- Extracts relevant data using BeautifulSoup
- Provides endpoints to access filtered and categorized statistics
- Optimized for performance with FastAPI and asynchronous requests
- Supports query parameters to filter data by team, player, source, etc.

### 3. Technologies


python-logo
fastapi-logo
swagger-logo
pandas-logo

### 4. Installation and Virtual Environment Activation
First, you need to create a virtual environment:
```console
python -m venv venv
or
python3 -m venv venv
```

Then, active it:
```console
# Windows (cmd)
venv\Scripts\activate

# Linux/macOS (bash)
source venv/bin/activate
````

After setting up the environment, install the dependencies:

You can install the dependencies using the requerements.txt file:

```console
pip install -r requirements.txt
```

```console
pip install fastapi uvicorn requests beautifulsoup4 numpy pandas nba_api
```

### 5. Running
``` console
uvicorn app.main:app --reload
```

### 6. OpenApi Documentation
- Every new endpoint is automatically added to the documentation.
- You can access the documentation to learn how to use it:

```bash
http://localhost:8000/docs
```

### 7. Deployment
The deployment is done using Google Cloud Run and Cloud Build, which allows you to easily deploy your application to Google Cloud Platform.

- [Google Cloud Platform](https://cloud.google.com/)
- [Google Cloud Run](https://cloud.google.com/run)
- [Google Cloud Build](https://cloud.google.com/build)

### 8. Terms of Use
- This repository has no commercial or business intentions
- All rights are reserved to the [NBA](https://www.nba.com).
- Check the [Terms of Use](https://www.nba.com/termsofuse#ownership-and-use-restrictions) to learn about the usage of the data.