npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

riot-valorant-api

v0.2.4

Published

A NodeJS module that wraps the Valorant Api in a user friendly interface

Downloads

7

Readme

npm GitHub repo size GitHub

A NodeJS module that wraps the Valorant Api in a user friendly interface, available on NPM.

Disclaimer

This is an unofficial package so it's not developed or maintained by Riot Games. Use it carefully and follow the ToS.

Documentation

All methods available from Valorant API are supported, for more information regarding them, please visit documentation.

For Typescript users, all the request and response api interfaces are created and exported to be used.

Installation

The package is available through NPM, which means you can choose to install it using either npm or yarn

NPM:

npm install riot-valorant-api

Yarn:

yarn add riot-valorant-api

Authentication

In order to use the API, Riot has some rules and requires the users to register their product. It can be for personal or professional use, choose according to your needs. For more information regarding the registration, check Riot Portal.

Usage

To start using the package, you need to import and initialize the API class. You need to create it with your API_TOKEN which you get from creating an application on the Riot Portal and the your region.

Using Typescript or bundler:

import { RiotValorantApi, Regions.EUROPE } from "riot-valorant-api";

const valorantApi = new RiotValorantApi("YOUR_TOKEN_API", Regions.EUROPE);

Using native NodeJS:

const { RiotValorantApi, Regions.EUROPE } = require("node-twitch");

const valorantApi = new RiotValorantApi("YOUR_TOKEN_API", Regions.EUROPE);

Methods

Here are a few examples of the methods supported by the module.

Content V1

GetAllContent

Get all content from Valorant. You can pass a locale or fetch the data with all the available locales

const content: Content = await valorantApi.ContentV1.getAllContent(Locales.EN_GB)

Match V1

GetMatchById

Get match by id

const match: Match = await valorantApi.MatchV1.getMatchById("MATCH_ID")

GetMatchListsByPuuid

Get matchlist for games played by puuid

const matchlist : MatchList = await valorantApi.MatchV1.getMatchListsByPuuid("PUUID")

GetRecentMatches

Get recent matches

const recentMatches: RecentMatches = await valorantApi.MatchV1.getRecentMatches(Queue.COMPETITIVE)

Ranked V1

GetLeaderboardByAct

Get leaderboard for the competitive queue

const leaderboard: Leaderboard = await valorantApi.RankedV1.getLeaderboardByAct("ACT_ID", size = 20, startIndex = 0)

Status V1

GetPlatformData

Get Valorant status for the given platform

const status: PlatformData = await valorantApi.StatusV1.getPlatformData()

Errors

All errors threw by the package will have the structure represented in ApiError.

export interface ApiError {
  request: {
    method: string; // Method
    path: string; // Path
    baseUrl: string; // Base Url
    headers: { [header: string]: string }; // Headers
  };
  status: number; // Status code
  error: string; // Error message
}

Tests

To run the tests for this project:

NPM:

npm run test

Yarn:

yarn test

Problems or issues?

If you encounter any problems, bugs or other issues with the package, please create an issue in the GitHub repo.

License

MIT