JValorant is an easy to use library to interact with the Riot-Valorant API
- Note: The library is not fully complete but you can find most of the stuff you are looking for
- You can use gradle or maven
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
- Add the dependency
dependencies {
implementation 'com.github.fero1xd:JValorant:0.1'
}
- Add the repository in pom.xml file
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
- Add the dependency
<dependency>
<groupId>com.github.fero1xd</groupId>
<artifactId>JValorant</artifactId>
<version>0.1</version>
</dependency>
Use the Releases Section
- Get Account data
JValorant api = new JValorant();
try {
AccountDataResult response = api.getAccountData("Fero", "STUCK");
AccountData accountData = response.getAccountData();
System.out.println(accountData.toString());
} catch (ApiError error) {
System.out.println(error.getResponse().getCode());
System.out.println(error.getResponse().getHttpError());
System.out.println(error.getResponse().getRawResponse());
} catch (IOException e) {
e.printStackTrace();
}
- Get match history of a player
try {
MatchHandler matchHandler = api.getMatchHandler();
GetMatchHistoryResult matchHistory = matchHandler.getMatchHistory("Fero", "STUCK", Region.AP, MatchFilter.ESCALATION);
Match[] matches = matchHistory.getMatches();
for(Match m : matches) {
System.out.println(m.metadata().mode());
}
} catch (ApiError error) {
System.out.println(error.getResponse().getCode());
System.out.println(error.getResponse().getHttpError());
System.out.println(error.getResponse().getRawResponse());
} catch (IOException e) {
e.printStackTrace();
}
- Get Leaderboard of specific region
try {
LeaderboardHandler leaderboardHandler = api.getLeaderboardHandler();
GetLeaderboardResult leaderboard = leaderboardHandler.getLeaderboard(Region.AP);
LeaderboardUser[] leaderboardUsers = leaderboard.getLeaderboardUsers();
for(LeaderboardUser u : leaderboardUsers) {
System.out.println(u.leaderboardRank());
}
} catch (ApiError error) {
System.out.println(error.getResponse().getCode());
System.out.println(error.getResponse().getHttpError());
System.out.println(error.getResponse().getRawResponse());
} catch (IOException e) {
e.printStackTrace();
}
Handler | Description |
---|---|
Leaderboard Handler | Use this to interact with the in game leaderboard |
Match Handler | Use this when you want to do anything regarding matches |
MMR Handler | Use this to get mmr info of players |
Enums | Values |
---|---|
Region | ap, na, eu, kr, latam, br |
Match Filter | none, escalation, spikerush, deathmatch, competitive, unrated, replication |
Error | bad_request, rate_limited, server_error, not_found |