Marvel Rivals Data API
A Node.js data layer for your Discord bot. It covers account overview, ranks, hero stats, match scoreboards with final hits, played-with, the Top 500, global hero win rates, cosmetics and punishments. Use it as a library inside your bot or run it as a REST API.
Features
| Feature | Status | Notes |
|---|---|---|
| Account overview: level, current, season-peak and all-time peak rank, rank score, win rate, hours, region | Ready | Account XP is not published by any data source |
| Hero stats per player: matches, win rate, KDA, hours, MVP/SVP | Ready | Season or all-time; ranked, unranked or all |
| Hero proficiency tier (e.g. "Champion 50") | Not available | Not published by any data source |
| Match history and full match scoreboard: K/D/A, final hits, damage, healing, accuracy, bans | Ready | All 12 players |
| Played with: top teammates and opponents | Ready | Games together and win rate |
| Top 500 leaderboard: PC, PlayStation, Xbox, any season, per hero | Ready | |
| Hero win, pick and ban rates | Ready | All ranks or high elo only |
| Punishments: type, reason, issued, duration, active/expired | Ready | Works even for private profiles |
| Cosmetics: skins, rarity, estimated Lattice value, name history | Partial | Lists skins the player has used in matches. The full owned inventory is only visible in-game |
| Live game | Latest match | Shows the most recent finished match. See About live game |
Setup
Requirements: Node.js 18 or newer, plus a Discord bot token and application ID from the Developer Portal.
npm install
npm test # expect: pass 6, fail 0
Option A: run the included bot
DISCORD_TOKEN=xxx DISCORD_CLIENT_ID=yyy node examples/discord-bot.js
Option B: add it to your existing bot
Copy the src/ and data/ folders into your bot, and examples/lookup-views.js as well if you want the ready-made menus.
import { RivalsService } from './src/index.js';
const rivals = new RivalsService();
const o = await rivals.overview('Arc_Raz'); // o.rank.name → "Platinum 2"
const g = await rivals.latestGame('Arc_Raz'); // g.team1[0].final_hits
const p = await rivals.punishments('Arc_Raz');
If your bot uses CommonJS, load it with const { RivalsService } = await import('./src/index.js').
Option C: run it as a REST API
PORT=3000 API_KEY=choose-a-secret npm start
curl "http://localhost:3000/v1/player/Arc_Raz?key=choose-a-secret"
Discord commands
| Command | What it does |
|---|---|
/register username | Links your Discord account to your Marvel Rivals account |
/lookup [username] [section] | Opens a player card with a section menu: Overview, Competitive, Heroes, Played With, Cosmetics, Punishments, Latest Game, Top 500, Hero Win Rates. Previous, Next and Refresh buttons are included. |
REST endpoints
Wherever :q appears you can pass a username or a UID. Common parameters: season = 22, S11, S10.5 or current; platform = pc, ps or xbox. Example responses for each endpoint are in docs/API.md inside the package.
/v1/search/:nameFind players by name, with UIDs/v1/player/:qAccount overview and ranks/v1/player/:q/refreshPull fresh data for a player/v1/player/:q/heroes?scope=season|all-time&mode=ranked|unranked|allPer-hero stats/v1/player/:q/matches?page=1&mode=0|1|2|4Match history, 20 per page/v1/player/:q/played-with?scope=all-time|seasonTop teammates and opponents/v1/player/:q/cosmeticsSkins used, rarity, estimated value, name history/v1/player/:q/punishmentsBan and restriction history/v1/player/:q/latest-gameMost recent match: both teams, KDA, final hits/v1/match/:match_uidFull scoreboard for any match/v1/leaderboard?platform=pc&season=current&page=1&hero=Top 500, overall or per hero/v1/heroes/win-rates?rankBuckets=all&sort=win_rateGlobal hero win, pick and ban rates/v1/heroes/:hero/trend?platform=pc|console&days=30Daily trend for one hero (Celestial and above)Errors
| HTTP | Meaning |
|---|---|
| 400 | Invalid parameter, for example an unknown platform |
| 401 | Missing or wrong API key |
| 403 | That part of the player's profile is set to private in-game |
| 404 | Player or match not found |
| 502 | Data source temporarily unavailable; try again shortly |
About live game
No public or third-party server exposes matches while they are being played. That data exists only inside the running game client. The Latest Game view refreshes the player and shows their most recent finished match, with accurate KDA and final hits for all 12 players and how many minutes ago it ended.
True in-progress data would need a separate Windows companion app built on Overwolf. Each player installs it on their own PC and it sends their current match to the bot. It covers PC only and only matches that the app's user is playing in. Overwolf's feed also has no final-hits value. This can be quoted as a separate project.
Maintenance
- New season: set
MR_CURRENT_SEASON. Season ids go up by one every half-season: S11.0 = 22, S11.5 = 23. - New heroes or skins: until the name catalog in
data/is refreshed, unknown ids show asHero 1234. See the README for the update steps. - Cosmetic value: Lattice prices per rarity can be changed with
MR_SKIN_PRICES.