@valapi Documentation


Generate by mdBook

LICENSE Github Discord

  • node-valapi isn't endorsed by Riot Games and doesn't reflect the views or opinions of Riot Games or anyone officially involved in producing or managing Riot Games properties. Riot Games, and all associated properties are trademarks or registered trademarks of Riot Games, Inc.
  • node-valapi was created under Riot Games' "Legal Jibber Jabber" policy using assets owned by Riot Games. Riot Games does not endorse or sponsor this project.
  • MIT License

About


valorant.ts is a NodeJS package that make more easier to use Valorant API

  • All-in-one:
    • Authentication
      • Two-Factor Authentication
      • Riot Identity
      • CAPTCHAs
    • Crosshair Serializer
    • Official API
      • Leaderboard
    • valorant-api.com
      • ID
      • Information
    • Web Client
      • Daily Store
      • Personal Data
  • Open-source
  • Typescript Support
  • Built-In API Endpoints

Explanation


[NAME]

you need to replace something with it (in this case ex. John, Alex)

Contributors


list of the contributors who helped me improve this module

Developers

Report Bugs

Special Thanks

Valorant API

Rules and Regulations


node-valapi


Data Source

GitHub

Third-Party

Dependency

Package (NPM)

Mentioned

Introduced

Riot Authentication

Install

npm install @valapi/auth

Peer Dependencies

  • @valapi/lib

Client


import { Auth } from "@valapi/auth";

Config

interface Config {
    /**
     * Authenticated User
     */
    user?: AuthUserInfo;

    /**
     * Riot Client SDK Version
     * 
     * ValorantApiCom.Internal.riotClientVersion() [riotGamesApiInfo.VS_FIXEDFILEINFO.FileVersion]
     */
    sdk?: 

    /**
     * Riot Client Build
     * 
     * ValorantApiCom.Version.get() [riotClientBuild]
     */
    build?: string;

    /**
     * Riot Client Version
     * 
     * ValorantApiCom.Version.get() [riotClientVersion]
     */
    version?: string;

    /**
     * Riot Client Platform
     * 
     * Where is Riot Client run on?
     */
    platform?: ClientPlatfrom;

    /**
     * Request Config
     */
    axiosConfig?: AxiosRequestConfig;

    /**
     * HTTPS Agent Config
     */
    agentConfig?: AgentOptions & CookieAgentOptions;
}

Constructor

const auth = new Auth( config? );

Serialize


JSON

const serializeJson = auth.toJSON();

Cookie

const serializeCookie = auth.cookie.serializeSync();

CAPTCHAs


This is an example of many ways to get a captcha response

const hCaptcha = await auth.captcha();
interface hCaptcha {
    sitekey: string;
    rqdata: string;
}

Express

Setup an express server

npm install express
import * as express from "express";

const port = 8880;
const app = express();

app.get("/", (req, res) => {
    res.sendFile("index.html");
});

app.get("/captcha", (req, res) => {
    res.send(hCaptcha);
});

app.get("/verify/:token", async (req, res) => {
    res.sendStatus(200);

    app.set("captchaResponse", req.params.token);
});

app.listen(port);
<html>

<head>
  <script src="https://cdn.jsdelivr.net/npm/@hcaptcha/vanilla-hcaptcha" async defer></script>
</head>

<body>
  <h-captcha id="signupCaptcha" auto-render="false"></h-captcha>
</body>

<script>
  window.onload = async () => {
    const captcha = document.getElementById('signupCaptcha');

    const response = await fetch("/captcha");
    const data = await response.json();

    captcha.render({ "sitekey": data.sitekey });
    captcha.setData(data.rqdata);

    captcha.addEventListener('verified', async event => {
      await fetch(`/verify/${event.token}`);
    });
  };
</script>

</html>

get a captcha response

const captchaResponse = app.set("captchaResponse");

CAPTCHA Solver

npmjs/valapi will not assist and be relevant in any legal actions that happen when using Captcha Solver, so use it at your own risk

const captchaResponse = await CaptchaSolver({
    type: "HCaptchaTaskProxyLess",
    url: "https://auth.riotgames.com",
    sitekey: hCaptcha.sitekey,
    rqdata: hCaptcha.rqdata,
});

ref.

Identity Authorization


Once these steps are finished, the authorization should be finished as well

Login credentials

await auth.login({
    username: "BestUsername",
    password: "SuperSecretPassword",
    captcha: captchaResponse
});

Multi-factor authentication

if (auth.isMultifactor) {
    const loginCode = 428793;

    await auth.multifactor(loginCode);
}

ref.

Cookie Authorization


You can save only cookies for ~30 days

import { AuthInstance } from "@valapi/auth";
const instance = new AuthInstance({ cookie: serializeCookie });

const auth = new Auth({ user: instance.toJSON() });

I recommend running this every time you deserialize

// new Date() >= auth.expirationDate

if (!auth.isAuthenticated) {
    await auth.reauthorize();
}

ref.

Introduced

Crosshair Compiler

Install

npm install @valapi/crosshair

Peer Dependencies

  • @valapi/lib

Crosshair Compiler

This feature is in Pre-alpha


Client

import { ValCrosshair } from "@valapi/crosshair";
const crosshair = new ValCrosshair();

Usage

Import

crosshair.import(profileCode);

Export

crosshair.export(); // => Profile Code

Introduced

Built-In feature.

Install

npm install @valapi/lib

Peer Dependencies

  • @valapi/lib

Resources


ResourceMethod
CrosshairColorfromName
fromID
CrosshairHexColorfromName
fromHex
ItemTypeIdfromName
fromID
LocalefromName
fromID
QueueIdfromName
fromID
RegionfromName
fromID

Usage


import { [Resource] } from "@valapi/lib";
[Resource].fromName("Name"); // change name to identify
[Resource].fromID("1id3"); // change identify to name

Region


Usage

import { Region } from "@valapi/lib";

Usage

RegionFull Name
naNorth_America
latamLatin_America
brBrazil
pbePublic_Beta_Environment
euEurope
krKorea
apAsia_Pacific
Region.Default.North_America; // => "na"
Region.Default.Latin_America; // => "latam"
Region.Default.Brazil; // => "br"
Region.Default.Public_Beta_Environment; // => "pbe"
Region.Default.Europe; // => "eu"
Region.Default.Korea; // => "kr"
Region.Default.Asia_Pacific; // => "ap"

Example

new Client({
    region: Region.Default.Asia_Pacific
});

Introduced

Official Api From Riot Games

Install

npm install @valapi/riot-api

Peer Dependencies

  • @valapi/lib

Introduced


import { RiotApi } from "@valapi/riot-api";

Config

You Can Get Api Key From developer.riotgames.com

interface Config {
    /**
     * API Key
     */
    apiKey: string;

    /**
     * Region
     */
    region: Region.Identify;

    /**
     * Request Config
     */
    axiosConfig?: CreateAxiosDefaults;
}

Client

const client = new RiotApi([config]);

API


ServiceFunctionArguments
AccountV1byPuuidpuuid
byRiotIdgameName, tagLine
activeShardsByGameAndPuuidpuuid, game?
byAccessTokenauthorization
ContentV1contentslocale?
MatchV1byMatchIdmatchId
listByPuuidpuuid
recentByQueuequeueId
RankedV1leaderboardsByActactId, size?, startIndex?
StatusV1platformData

Usage

const data = await riotApi.[Service].[Function]([Arguments]);

Introduced

Third-Party API by Officer

Install

npm install @valapi/valorant-api.com

Peer Dependencies

  • @valapi/lib

Introduced


import { ValorantApiCom } from "@valapi/valorant-api.com";

Config

interface Config {
    /**
     * Language
     */
    language?: ValorantApiCom.Language;

    /**
     * Request Config
     */
    axiosConfig?: CreateAxiosDefaults;

    /**
     * Response Option
     */
    responseOptions?: {
        /**
         * Delete properties that have a `null` value
         */
        ignore_null?: boolean;
    };
}

Client

const client = new ValorantApiCom([config?]);

API

Some of API are base on dash.valorant-api.com


ServiceFunctionArguments
AgentgetisPlayableCharacter?
getByUuiduuid
Buddiesget
getLevels
getByUuiduuid
getLevelByUuiduuid
Bundlesget
getByUuiduuid
Bundlesget
getByUuiduuid
Ceremoniesget
getByUuiduuid
CompetitiveTiersget
getByUuiduuid
ContentTiersget
getByUuiduuid
Contractsget
getByUuiduuid
Currenciesget
getByUuiduuid
Eventsget
getByUuiduuid
Gamemodesget
getEquippables
getByUuiduuid
getEquippableByUuiduuid
Gearget
getByUuiduuid
Internaluuid
riotClientVersion
LevelBordersget
getByUuiduuid
Mapsget
getByUuiduuid
Missionsget
getByUuiduuid
Objectivesget
getByUuiduuid
PlayerCardsget
getByUuiduuid
PlayerTitlesget
getByUuiduuid
Seasonsget
getCompetitiveSeasons
getByUuiduuid
getCompetitiveSeasonByUuiduuid
Spraysget
getLevels
getByUuiduuid
getLevelByUuiduuid
Themesget
getByUuiduuid
Versionsget
Weaponsget
getSkins
getSkinChromas
getSkinLevels
getByUuiduuid
getSkinByUuiduuid
getSkinChromaByUuiduuid
getSkinLevelByUuiduuid

Usage

const data = await valorantApiCom.[Service].[Function]([Arguments]);

Language


valorant-api.com has a specific language called all, that will return all languages.

Example:

{
  'ar-AE': 'فايد',
  'en-US': 'Fade',
  'ja-JP': 'フェイド',
  'ko-KR': '페이드',
  'zh-TW': '菲德'
}

but if you aren't using all language, you can use en-US, th-TH, and more, but it will return only one language you choose.

Example:

"フェイド"; // ja-JP (japanese)

Introduced

API from Web Client

Install

npm install @valapi/web-client

Peer Dependencies

  • @valapi/lib
  • @valapi/auth

Introduced


import { WebClient } from "@valapi/web-client";

Config

interface Config {
    /**
     * Authenticated User
     */
    user: AuthUserInfo;

    /**
     * Account Region
     */
    region?: Region.ID;
}

Client

const client = new WebClient([config]);

API


ServiceFunctionArguments
AccountXPgetPlayersubject
Configget
Contentget
ContractDefinitionsgetActiveStory
get
getItemProgression
Contractsgetsubject
activatesubject, contractId
unlockItemProgressionsubject, definitionId
unlockContractProgressionsubject, contractId
unlockItemSidegradesubject, definitionId, sidegradeId, optionId
upgradesubject, contractId
CoreGamefetchPlayersubject
fetchMatchmatchId
fetchMatchLoadoutsmatchId
disassociatePlayersubject, matchId
fetchAllChatMUCTokenmatchId
fetchTeamChatMUCTokenmatchId
fetchVoiceTokenmatchId
DailyTicketgetsubject
renewsubject
DisplayNameServicefetchPlayerssubject
Favoritesgetsubject
addsubject, itemId
removesubject, itemId
LatencyfetchStats
fetchStat
MassRewardsreconcilePlayersubject
MatchfetchMatchDetailsmatchId
fetchMatchHistorysubject, queueId?, startIndex?, endIndex?
fetchQueueData
MMRgetPlayersubject
hideActRankBadgesubject
getLeaderboardseasonId, startIndex?, size?, serachUsername?
getCompetitiveUpdatessubject, queueId?, startIndex?, endIndex?
PartyrefreshCompetitiveTiersubject, partyId
refreshPlayerIdentitysubject, partyId
refreshPingssubject, partyId
getpartyId
getMUCTokenpartyId
getVoiceTokenpartyId
setAccessibilitypartyId, accessibility
inviteByDisplayNamepartyId, gameName, tagLine
declineJoinRequestpartyId, requestId
Party.MatchMakingchangeQueuepartyId, queueId
makeDefaultQueuepartyId, queueId
startSoloExperiencesubject
startpartyId
leavepartyId
Party.Playergetsubject
removesubject
joinPartysubject, partyId
leavePartysubject, partyId
setReadysubject, partyId, isReady
leaveFromPartysubject, partyId
transferOwnersubject, partyId
Party.CustomGamemakeIntopartyId
startpartyId
changeSettingspartyId, settings
changeTeampartyId, team, subject
setBalancepartyId
getConfig
Party.PartyCodecreatepartyId
deletepartyId
joinpartyCode
PersonalizationgetPlayerLoadoutsubject
changePlayerLoadoutsubject, loadout
PreGamegetPlayersubject
getMatchmatchId
getMatchLoadoutsmatchId
selectCharactermatchId, agentId
lockCharactermatchId, agentId
fetchVoiceTokenmatchId
fetchChatTokenmatchId
quitMatchmatchId
RestrictionsfetchPlayerReportTokenmatchId, offenderSubject
fetchPlayerRestrictions
Sessionconnectsubject
heartbeatsubject
disconnectsubject
getsubject
reconnectsubject
StoregetWalletsubject
getOffers
getEntitlementssubject, itemTypeId
Store.StoreFrontgetsubject
revealNightMarketOfferssubject
getAgent

Usage

const data = await webClient.[Service].[Function]([Arguments]);