Skip to content

This API allows you to fetch statistics for Valorant, CS2 and TFT players, including current and all-time statistics. The API is built using FastAPI and utilizes web scraping to gather player data from Tracker.gg

License

Notifications You must be signed in to change notification settings

aydenjahola/tracker-gg-api

Repository files navigation

Tracker.gg Stats API

This API allows you to fetch statistics for Valorant, CS2 and TFT players, including current and all-time statistics. The API is built using FastAPI and utilizes web scraping to gather player data from Tracker.gg.

Table of Contents

Features

  • Fetch current act statistics for a given Valorant player.
  • Fetch all-time statistics across seasons for a given Valorant player.
  • Fetch all player's statistics for CS2
  • API key authentication for secure access.

Getting Started

Prerequisites

  • Python 3.7 or higher

Installation

  1. Clone the repository:
[email protected]:aydenjahola/tracker-gg-api.git
cd tracker-gg-api.git
  1. Create virtual environment
python3 -m venv vevn
  1. Actiave the virtual environemnt
source venv/bin/activate # For Linux
source venv/Scripts/Actiave # For Windows
  1. Install the required packages:
pip install -r requirements.txt

Environment Variables

Create a .env file in the root of the project directory and add your API keys:

API_KEYS=your_api_key,your_api_key2 # Create a new key using the openssl command
STEAM_API_KEY=your_steam_api_key
FLARESOLVERR_URL=your_flare_solver_url

Make sure to replace your_api_key1,your_api_key2 with your actual API keys.

API Endpoints

Valorant

Get Current Act Stats

Endpoint: GET /valorant/player/{username}/current

Description: Fetch the current act statistics for a given Valorant player.

Parameters:

  • username: The Riot username of the player (eg. Shitter#1234).
  • X-API-Key: Your API key (header).

Get All Seasons Stats

Endpoint: GET /valorant/player/{username}/all

Description: Fetch all seasons' statistics for a given Valorant player.

Parameters:

  • username: The Riot username of the player (eg. Shitter#1234).
  • X-API-Key: Your API key (header).

CS2

Get All Time Player Stats

Endpoint: GET /cs2/player/{steam_id}

Description: Fetch all player's stats for CS2.

Parameters:

  • steamid: The steam id of the player.
  • X-API-Key: Your API key (header).

Error Handling

  • 403 Forbidden: If the API key is invalid.
  • 404 Not Found: If the player's stats cannot be found.

License

This project is licensed under the GPL-3.0 license . See the LICENSE file for details.


Feel free to reach out for any questions or contributions to the project!

About

This API allows you to fetch statistics for Valorant, CS2 and TFT players, including current and all-time statistics. The API is built using FastAPI and utilizes web scraping to gather player data from Tracker.gg

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published