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

FeatureStatusNotes
Account overview: level, current, season-peak and all-time peak rank, rank score, win rate, hours, regionReadyAccount XP is not published by any data source
Hero stats per player: matches, win rate, KDA, hours, MVP/SVPReadySeason or all-time; ranked, unranked or all
Hero proficiency tier (e.g. "Champion 50")Not availableNot published by any data source
Match history and full match scoreboard: K/D/A, final hits, damage, healing, accuracy, bansReadyAll 12 players
Played with: top teammates and opponentsReadyGames together and win rate
Top 500 leaderboard: PC, PlayStation, Xbox, any season, per heroReady
Hero win, pick and ban ratesReadyAll ranks or high elo only
Punishments: type, reason, issued, duration, active/expiredReadyWorks even for private profiles
Cosmetics: skins, rarity, estimated Lattice value, name historyPartialLists skins the player has used in matches. The full owned inventory is only visible in-game
Live gameLatest matchShows 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

CommandWhat it does
/register usernameLinks 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.

GET/v1/search/:nameFind players by name, with UIDs
GET/v1/player/:qAccount overview and ranks
POST/v1/player/:q/refreshPull fresh data for a player
GET/v1/player/:q/heroes?scope=season|all-time&mode=ranked|unranked|allPer-hero stats
GET/v1/player/:q/matches?page=1&mode=0|1|2|4Match history, 20 per page
GET/v1/player/:q/played-with?scope=all-time|seasonTop teammates and opponents
GET/v1/player/:q/cosmeticsSkins used, rarity, estimated value, name history
GET/v1/player/:q/punishmentsBan and restriction history
GET/v1/player/:q/latest-gameMost recent match: both teams, KDA, final hits
GET/v1/match/:match_uidFull scoreboard for any match
GET/v1/leaderboard?platform=pc&season=current&page=1&hero=Top 500, overall or per hero
GET/v1/heroes/win-rates?rankBuckets=all&sort=win_rateGlobal hero win, pick and ban rates
GET/v1/heroes/:hero/trend?platform=pc|console&days=30Daily trend for one hero (Celestial and above)

Errors

HTTPMeaning
400Invalid parameter, for example an unknown platform
401Missing or wrong API key
403That part of the player's profile is set to private in-game
404Player or match not found
502Data 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 as Hero 1234. See the README for the update steps.
  • Cosmetic value: Lattice prices per rarity can be changed with MR_SKIN_PRICES.