A clean, fast, and feature-rich Discord bot that pulls live Valorant stats, match history, and ranked leaderboards — all directly inside your server.
Built with love by gl1tch Master
Overview
Valorant Tracker is a Discord bot powered by the HenrikDev Unofficial Valorant API. It lets you look up any player by their Riot ID — no region guessing needed, the bot figures it out automatically. You get their current rank, peak rank, recent match results, combat stats, win rate, and more — all formatted cleanly using Discord's Components V2 system.
It was built to be straightforward, reliable, and easy to self-host. No database, no dashboard, no overcomplicated setup. Clone it, fill in your .env, run it.
Features
/track— Full player profile: rank, RR, peak rank, win/loss, K/D, headshot %, top agent, top map, and last 5 matches/matches— Detailed breakdown of the last 10 games with per-match KDA, ACS, and HS%/leaderboard— Top 10 Radiant players for any supported region- Region is auto-detected — you never have to specify it manually
- Beautiful Components V2 Discord UI with containers, sections, and separators
- Refresh button on every profile card to re-pull live data on demand
- Direct links to Tracker.gg and VStats.gg for each player
- Graceful error handling — bad inputs, API timeouts, and missing data all return helpful messages
Prerequisites
Before you do anything, make sure you have these ready:
Node.js v18 or higher — Download here
A Discord Bot with slash command permissions
A HenrikDev API key (free tier works fine for personal use)
Getting Your API Keys
- Go to https://discord.com/developers/applications
- Click New Application, give it a name, and hit Create
- Head to the Bot tab on the left sidebar
- Click Reset Token, copy it — this goes into
TOKENin your.env - While you are there, scroll down and enable Applications Commands under Privileged Gateway Intents if it is not already on
- Go to OAuth2 > URL Generator, check
botandapplications.commands, copy the generated URL and use it to invite the bot to your server - Under General Information, copy your Application ID — this goes into
CLIENT_IDin your.env
Important: Never share your bot token with anyone. If it leaks, reset it immediately from the developer portal.
- Join the HenrikDev Discord server
- Follow the instructions in the
#get-api-keychannel to request your key - Copy the key — it goes into
HENRIK_API_KEYin your.env
The free tier is enough for personal or small-server use. If you run a larger community, check their rate limit tiers.
Installation
# Clone the repository
git clone https://github.com/gl1tch496/valorant-tracker.git
# Move into the project folder
cd valorant-tracker
# Install dependencies
npm installConfiguration
Create a file called .env in the root of the project:
TOKEN=your_discord_bot_token_here
CLIENT_ID=your_discord_application_id_here
HENRIK_API_KEY=your_henrikdev_api_key_hereMake sure this file is never committed to Git. The .gitignore should already cover it, but double-check.
Running the Bot
node index.jsOn first run, it will register all slash commands globally with Discord and then log in. You should see something like:
Registering slash commands...
Slash commands registered.
Logged in as YourBot#1234
Slash commands can take up to an hour to propagate globally on Discord's end, but usually show up within a few minutes.
Commands
| Command | Description | Example |
|---|---|---|
/track |
Full stats profile for a player | /track player:TenZ#NA1 |
/matches |
Last 10 matches with full details | /matches player:TenZ#NA1 |
/leaderboard |
Top 10 Radiant in a region | /leaderboard region:na |
Supported regions for /leaderboard: eu na ap kr
Supported regions for /track and /matches: All regions are auto-detected from the player's account — you just paste the Riot ID.
How the Code Works
The bot is a single-file Node.js application (index.js) built on top of discord.js v14 and axios.
Structure overview:
- API layer — All requests go through a single
fetchAPI()function that wraps axios and handles both HTTP errors and HenrikDev's in-body error format cleanly - Player resolution —
resolvePlayer()uses the HenrikDev v2 account endpoint to validate the Riot ID and auto-detect the player's region, so you never need to pass a region manually - Components V2 — Instead of embeds, the bot uses Discord's newer Components V2 system (message flag
1 << 15). This means containers, sections, separators, thumbnails, and buttons are all raw JSON — Discord renders them as a structured card-style layout /track— Fires two parallel API calls (MMR v3 + matches v3), then calculates aggregate stats across the last 5 games before building the full card/matches— Pulls the last 10 matches and renders each one as its own section with KDA, ACS, headshot %, and round count/leaderboard— Hits the v1 leaderboard endpoint and formats the top 10 players including anonymized accounts- Refresh button — The button stores the player's Riot ID in its custom ID and re-runs
/trackwhen pressed, pulling fresh data without any database
Dependencies:
{
"discord.js": "^14.x",
"axios": "^1.x",
"dotenv": "^16.x"
}Support the Project
If this bot saved you time or you just think it is cool, drop a star on the repo — it genuinely helps and takes two seconds.
Troubleshooting
Commands not showing up in Discord?
Wait a few minutes after first run. If they still don't appear, check that your CLIENT_ID is correct and the bot has applications.commands scope in its invite URL.
Getting API errors?
Make sure your HENRIK_API_KEY is valid and not expired. Also confirm the player exists by searching them on tracker.gg first.
Bot not responding?
Check that TOKEN in .env is correct and that the bot is online in your server with the right permissions.
Region not detected? This should not happen often, but if it does, it means the HenrikDev account endpoint returned a null region for that account. The player may have never played on their region before.

