All Projects → SoLoHK525 → valorant-api

SoLoHK525 / valorant-api

Licence: other
A NodeJs wrapper for the Riot VALORANT API

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to valorant-api

valorant.js
This is an unofficial NodeJS library for interacting with the VALORANT API used in game.
Stars: ✭ 48 (-5.88%)
Mutual labels:  riot, valorant
Valorant-Zone-Stats
View your VALORANT performance in different areas of every map in the game!
Stars: ✭ 72 (+41.18%)
Mutual labels:  valorant
Kayn
superagent-inspired Node.js lib (w/ **some** TypeScript support) for accessing Riot's League of Legend's API (discord: cnguy#3614)
Stars: ✭ 122 (+139.22%)
Mutual labels:  riot
WAIUA
"Who Am I Up Against?" (WAIUA) is a Valorant app that lets you see ranks, recent games, skins of players and more, all in and before a live match.
Stars: ✭ 155 (+203.92%)
Mutual labels:  valorant
Riot Api Java
Riot Games API Java Library
Stars: ✭ 184 (+260.78%)
Mutual labels:  riot
KannaKamuiBot
A multipurpose bot for fun, emotes, anime, utility, music, nsfw, valorant, moderation, and welcome/leave messages.
Stars: ✭ 64 (+25.49%)
Mutual labels:  valorant
Pinetime Apps
Firmware for the PineTime based on RIOT, NimBLE and LittleVGL
Stars: ✭ 68 (+33.33%)
Mutual labels:  riot
Monotone-HWID-Spoofer
Custom Created Hardware ID Spoofer to Bypass Hardware or IP Bans
Stars: ✭ 145 (+184.31%)
Mutual labels:  valorant
ValorantRichPresence
VALORANT Discord Rich Presence written in Python.
Stars: ✭ 16 (-68.63%)
Mutual labels:  valorant
riot
Riot API and analytics goodies
Stars: ✭ 30 (-41.18%)
Mutual labels:  riot
valorant-stats
Valorant statistics bot built with Discord.js using MongoDB
Stars: ✭ 29 (-43.14%)
Mutual labels:  valorant
chrome-extension-boilerplate-riot
A boilerplate chrome extension (Single Page Application) using RIOT.js
Stars: ✭ 20 (-60.78%)
Mutual labels:  riot
radical
Element (Riot Web) unofficially bundled as Firefox Add-on
Stars: ✭ 33 (-35.29%)
Mutual labels:  riot
Riot Cheatsheet
🚩 Riot at a glance
Stars: ✭ 159 (+211.76%)
Mutual labels:  riot
VALORANT-rank-yoinker
A Python app which retrieves the VALORANT rank and players' equipped skins during a match
Stars: ✭ 258 (+405.88%)
Mutual labels:  valorant
Element Rpm
Providing the Element messaging desktop client packaged for the Fedora, Red Hat(IBM), and OpenSUSE families of linux desktop operating systems.
Stars: ✭ 73 (+43.14%)
Mutual labels:  riot
systemjs-riot
jspm/systemjs plugin to load RiotJS tags and inline them in the bundle
Stars: ✭ 18 (-64.71%)
Mutual labels:  riot
valorant.py
Complete Python interface for the Valorant API. Works right out of the box!
Stars: ✭ 84 (+64.71%)
Mutual labels:  valorant
Tutorials
No description or website provided.
Stars: ✭ 82 (+60.78%)
Mutual labels:  riot
game apis
This repository is for integrating with different apis to allow you to pull player or game data
Stars: ✭ 24 (-52.94%)
Mutual labels:  riot

node-valorant-api

A NodeJs wrapper for the Riot VALORANT API [Active Development]

NPM Version

Disclaimer:

As of 2020/08/13, the VAL-MATCH-V1 API is not yet released to the public. Since I don't have the key to test the API, the functionality of this API wrapper is not yet confirmed. You are welcome to open issues regarding problems/bugs/improvements of this wrapper.

However, I have tested the VAL-CONTENT-V1 API which works fine :D

Installation

npm:

npm i node-valorant-api

yarn:

yarn add node-valorant-api

Supported APIs:

All API methods will return a promise containing the return data. For detailed information about the Promise API, please refer to https://developer.mozilla.org/zh-TW/docs/Web/JavaScript/Reference/Global_Objects/Promise

ACCOUNT-V1

Method Description
getAccountByPuuid(puuid) Get account by puuid
getAccountByRiotID(gameName, tagLine) Get account by riot id
getActiveShardByPuuid(puuid) Get active shard for a player

VAL-CONTENT-V1

Method Description
getContent(locale?) Get content optionally filtered by locale

VAL-MATCH-V1

Method Description
getMatchById(matchid) Get match by id
getMatchesByPuuid(puuid) Get matchlist for games played by puuid
getRecentMatches(queue) Get recent matches

VAL-RANKED-V1

Method Description
getLeaderboardsByAct(actId, size?, startIndex?) Get leaderboard for the competitive queue

Supported regions:

Valorant API:

Region Endpoint
APAC ap.api.riotgames.com
BR br.api.riotgames.com
EU eu.api.riotgames.com
KR kr.api.riotgames.com
LATAM latam.api.riotgames.com
NA na.api.riotgames.com
PBE1 pbe1.api.riotgames.com

Account API:

Region Endpoint
ASIA asia.api.riotgames.com
AMERICAS americas.api.riotgames.com
EUROPE europe.api.riotgames.com

Usage

CommonJs:
const { API, Regions, Locales, Queue } = require("node-valorant-api");

const APIKey = "RGAPI-5aca53b4-d92b-11ea-87d0-0242ac130003"; // Your API Key

// The third parameter is the Region for the Account API
// choose the one that is the closest to you
const valorant = new API(Regions.NA, APIKey, Regions.AMERICAS); // An API instance for Valorant query

// Example usage of the VAL-CONTENT-V1 API
valorant.ContentV1.getContent(Locales["en-US"]).then(content => {
    console.log(content.characters.map(char => { return char.name }));
});

// Example usage of the ACCOUNT-V1 and VAL-MATCH-V1 API !!! The MatchV1 API requires a Production API Key
valorant.AccountV1.getAccountByRiotID("SoLo", "HK1").then(account => {
    valorant.MatchV1.getMatchesByPuuid(account.puuid).then(matches => {
        console.log(matches);
    })
});

/**
 * Example usage of the VAL-STATUS-V1 API
 * https://developer.riotgames.com/apis#val-status-v1/GET_getPlatformData
 */
valorant.StatusV1.getPlatformData().then(data => {
    console.log(data);
});

/**
 * Example usage of the VAL-MATCH-V1 API
 * Queue: "competitive", "unranked", "spikerush"
 * https://developer.riotgames.com/apis#val-status-v1/GET_getPlatformData
 */
valorant.MatchV1.getRecentMatches(Queue.Competitive).then(data => {
    console.log(data);
})
Typescript:
import { API, Regions, Locales, Queue, RiotAPIError } from "node-valorant-api";

const APIKey = "RGAPI-5aca53b4-d92b-11ea-87d0-0242ac130003"; // Your API Key

// The third parameter is the Region for the Account API
// choose the one that is the closest to you
const valorant = new API(Regions.NA, APIKey, Regions.AMERICAS); // An API instance for Valorant query

// Example usage of the VAL-CONTENT-V1 API
valorant.ContentV1.getContent(Locales["en-US"]).then(content => {
    console.log(content.characters.map(char => { return char.name }));
}).catch((error: RiotAPIError) => {
    // Error handling
    console.log(error.status_code);
})

// Example usage of the ACCOUNT-V1 and VAL-MATCH-V1 API !!! The MatchV1 API requires a Production API Key
valorant.AccountV1.getAccountByRiotID("SoLo", "HK1").then(account => {
    valorant.MatchV1.getMatchesByPuuid(account.puuid).then(matches => {
        console.log(matches);
    })
});

/**
 * Example usage of the VAL-STATUS-V1 API
 * https://developer.riotgames.com/apis#val-status-v1/GET_getPlatformData
 */
valorant.StatusV1.getPlatformData().then(data => {
    console.log(data);
});

/**
 * Example usage of the VAL-MATCH-V1 API
 * Queue: "competitive", "unranked", "spikerush"
 * https://developer.riotgames.com/apis#val-status-v1/GET_getPlatformData
 */
valorant.MatchV1.getRecentMatches(Queue.Competitive).then(data => {
    console.log(data);
})

Error Handling

The wrapper will return a Promise rejection with RiotAPIError which can be used to handle Rate Limiting (HTTP Status 429),etc. Every request should include a catch block for handling error.

RiotAPIError has following properties:

interface RiotAPIError {
    request: {
        method: string; // Request Method
        path: string; // Request path
        header: string; // Request headers
        url: string; // Full Request URL
    },
    status_code: number; // Status Code, see https://developer.riotgames.com/docs/portal#web-apis_response-codes
    message: string; // Error message from Riot API
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].