Expand description
§Valorant API
This crate is a wrapper for the In-Game Valorant API.
§Usage
§1. Authenticate
To use this crate, you need to authenticate with your Riot Games account. Currently, the only way to do this is by using a username and password (no 2FA).
use valorant_api::utils::credentials_manager::CredentialsManager;
use valorant_api::utils::network::http_client::SimpleHttpClient;
#[tokio::main]
async fn main() {
let http_client = SimpleHttpClient::new();
let mut credentials_manager = valorant_api::utils::credentials_manager::CredentialsManager::new();
let result = credentials_manager
.authenticate(&http_client, "username", "password")
.await;
match result {
Ok(_) => println!("Authenticated"),
Err(_) => println!("Error while authenticating"),
}
}
§2. Use the API
use valorant_api::enums::region::Region;
use uuid::Uuid;
use std::collections::HashMap;
let puuid = Uuid::parse_str("ee89b4d9-13d0-5832-8dd7-eb5d8806d918").expect("Invalid UUID");
let region = Region::EU;
let queries = HashMap::new();
let result = valorant_api::get_competitve_updates_v1(credentials_manager, &http_client, region, &puuid, queries).await;
println!("Result: {:#?}", result);
§Endpoints
§Competitive Updates V1
Function: get_competitive_updates_v1
Result Type: CompetitiveUpdatesV1
§Match Details V1
Function: get_match_details_v1
Result Type: MatchDetailsV1
§Match History V1
Function: get_match_history_v1
Result Type: MatchHistoryV1
§MMRV1
Function: get_mmr_details_v1
Result Type: MMRDetailsV1
§Leaderboard V1
Function: get_leaderboard_v1
Result Type: LeaderboardV1
§Content V3
Function: get_content_v3
Result Type: ContentV3
§Store Offers V1
Function: get_store_offers_v1
Result Type: StoreOffersV1
§Store Front V2
Function: get_store_front_v2
Result Type: StoreFrontV2
Modules§
Functions§
- get_
account_ aliases - Get the account aliases of a player. This can be used to search for an account by game name and/or tag_line and get their puuid.
- get_
competitive_ updates_ v1 - Get the competitve updates of a player
- get_
content_ v3 - Get the content of the game
- get_
esports_ leagues - Get all active valorant esports leagues.
- get_
esports_ schedule - Get the schedule for all professional valorant games.
- get_
esports_ vods - Get the vod data for each game.
- get_
leaderboard_ v1 - Get the leaderboard of a region
- get_
match_ details_ v1 - Get the match details of a match
- get_
match_ history_ v1 - Get the match history of a player
- get_
mmr_ details_ v1 - Get the mmr of a player
- get_
store_ front_ v2 - Get the store front of a player
- get_
store_ offers_ v1 - Get the store offers of a region