Powered by TRNetwork - No API keys required!
Note: This module supports multiple fetching strategies for maximum compatibility across different environments.
npm install mrivals
Important: You must call
API.fetchUser
before using any other method.
This module can use multiple strategies to fetch data: fetch, curl, and flaresolverr
- Default fetch should work fine
- Can use flaresolverr if available for enhanced reliability
- Try fetch first (Node.js v16+)
- Switch to curl if fetch fails
- flaresolverr is recommended (default Docker image works great)
Option | Type | Description | Default |
---|---|---|---|
useCurl |
boolean | Whether to use curl instead of fetch | false |
flaresolverrUrl |
string | The URL of the flaresolverr instance | undefined |
await API.fetchUser(username, {
flaresolverrUrl: 'https://some.flaresolverr.domain:8191', // Use flaresolverr instance
useCurl: true, // Use curl instead of fetch (omitted when flaresolverrUrl is provided)
});
Simply use your username: username
(no need for #tag format)
Method | Description |
---|---|
info() |
Returns user and MMR information |
overview() |
Returns overview stats |
heroes() |
Returns hero-specific stats |
roles() |
Returns role-specific stats |
peakRank() |
Returns peak rank information |
raw() |
Returns raw response data |
Feel free to use my username for testing:
ifraan
const { API } = require('mrivals');
async function getPlayerStats() {
try {
// Fetch user data
const user = await API.fetchUser('ifraan');
// Get basic user info
console.log('👤 User Info:', user.info());
/*
Output: User and MMR information
*/
// Get overview stats
console.log('📊 Overview:', user.overview());
/*
Output: General gameplay statistics
*/
// Get hero stats
console.log('🦸♂️ Heroes:', user.heroes());
/*
Output: Hero-specific performance data
*/
// Get role stats
console.log('🎭 Roles:', user.roles());
/*
Output: Role-based statistics
*/
// Get peak rank
console.log('🏆 Peak Rank:', user.peakRank());
/*
Output: Highest achieved rank
*/
// Get raw data
console.log('📋 Raw Data:', user.raw());
/*
Output: Complete unprocessed response
*/
} catch (error) {
console.error('❌ Error:', error.message);
// Example: "We could not find the player [player]."
}
}
// Run the example
getPlayerStats();
This project is created for educational purposes only and is not affiliated with NetEase Games or Marvel Rivals.
If you want to use Marvel Rivals data in a production/commercial environment, please contact the team at TRNetwork.
Made with ❤️ by iFraan
Assemble your stats! 🚀