Socket
Book a DemoInstallSign in
Socket

mrivals

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mrivals

Wrapper/Scrapper for Marvel Rival stats.

3.1.0
latest
Source
npmnpm
Version published
Weekly downloads
65
132.14%
Maintainers
1
Weekly downloads
 
Created
Source

mrivals

CodeFactor NPM-Version NPM-Downloads Github Stars Issues

This a wrapper/scrapper of the TRNetwork site with Marvel Rivals stats.

There are no API keys required.

Instalation

npm i mrivals

Usage:

Note: This module can use many strategies to fetch data: fetch, curl and flaresolverr

  • For browser envoriments:
    • Default fetch should be ok, can use a flaresolverr if available
  • For server enviroments:
    • You can try your luck with fetch (node v16+), switch to curl if it fails
    • flaresolverr is recommended (the default docker image is ok)

You can pass additional options:

OptionTypeDescriptionDefault
useCurlbooleanWhether to use curl instead of fetchfalse
flaresolverrUrlstringThe url of the flaresolverr instanceundefined
await API.fetchUser(username, { 
  flaresolverrUrl: 'https://some.flaresolverr.domain:8191', // will use flaresolverr instance 
  useCurl: true, // will use curl instead of fetch (ommited when flaresolverrUrl is provided)
});

Example

There is only one static function that takes an username.

// this returns an API instance with the data already fetched
await API.fetchUser(username); // user#tag

You must call API.fetchUser before using any other method.

MethodsDescription
infouser and mmr info
overviewoverview stats
heroesheroes stats
rolesroles stats
peakRankpeak rank
rawreturn raw response

Example code

Feel free to use my riot username for testing

const { API } = require('mrivals');

try {
  const user = await API.fetchUser('ifraan');

  console.log('User:', user.info());
  console.log('Overview:', user.overview());
  console.log('Heroes:', user.heroes());
  console.log('Roles:', user.roles());
  console.log('Peak MMR:', user.peakRank());
  console.log('Raw:', user.raw());
} catch (e) {
  console.log(e);
  /* Error: We could not find the player [player]. */
}

Disclaimer

This project is fully for educational purposes and if you want to use the marvel rivals api in a production/commertial enviroment you should ask or email the guys at TRNetwork.

Keywords

marvel-rivals-api

FAQs

Package last updated on 28 Mar 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.