Skip to content

kaikyMoura/BackCourt-api

Repository files navigation

BackCourt Api

Repository for the BackCourt | NBA Stats & News Api

GitHub top language Codacy Badge Repository size Github last commit License Languages count


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 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:

python -m venv venv
or
python3 -m venv venv

Then, active it:

# 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:

pip install -r requirements.txt

or install directly using:

pip install fastapi uvicorn requests beautifulsoup4 numpy pandas nba_api

5. Running

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:
http://localhost:8000/docs

7. Deployment

The application is deployed on Railway, a cloud platform that simplifies backend and API hosting.

You can access the live API at:

https://backcourt-api-production.up.railway.app

⚠️ Please use responsibly to avoid exceeding the free-tier usage limits.


8. Terms of Use

  • This repository has no commercial or business intentions
  • All rights are reserved to the NBA.
  • Check the Terms of Use to learn about the usage of the data.

About

Repository for the Basketball Advanced Stats API

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published