Crate valorant_api

source ·
Expand description

§Valorant API

This crate is a wrapper for the In-Game Valorant API.


§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;

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")
    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);


§Competitive Updates V1

Function: get_competitive_updates_v1

Result Type: CompetitveUpdatesV1

§Match Details V1

Function: get_match_details_v1

Result Type: MatchDetailsV1

§Match History V1

Function: get_match_history_v1

Result Type: MatchHistoryV1


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