#valorant #region #history #credentials #manager #api #enums

valorant_api_official

A library for interacting with the Official Valorant API

20 releases

0.1.8 Sep 15, 2024
0.1.7 Jul 23, 2024
0.1.6 Jun 23, 2024
0.0.10 Mar 28, 2024
0.0.0 Jul 31, 2023

#195 in Authentication

Download history 8/week @ 2024-08-10 17/week @ 2024-08-17 8/week @ 2024-08-24 4/week @ 2024-08-31 198/week @ 2024-09-14 60/week @ 2024-09-21 51/week @ 2024-09-28 10/week @ 2024-10-05 1/week @ 2024-10-12

1,302 downloads per month

MIT license

50KB
1K SLoC

Valorant API

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

Usage

use valorant_api_official::utils::credentials_manager::CredentialsManager;
use valorant_api_official::enums::region::Region;

let http_client = reqwest::Client::new();
let credentials_manager = valorant_api_official::utils::credentials_manager::CredentialsManager::new();

let puuid = "";
let region = Region::EU;
let result = valorant_api_official::get_accounts_by_puuid_v1(credentials_manager, &http_client, region, &puuid).await;
println!("Result: {:#?}", result);

Endpoints

Account V1

Function: get_accounts_by_name_v1 or get_accounts_by_puuid_v1

Result Type: AccountV1

Active Shards V1

Function: get_active_shards_v1

Result Type: ActiveShardsV1

Match Details V1

Function: get_match_details_v1

Result Type: MatchDetailsV1

Match History V1

Function: get_match_lists_v1

Result Type: MatchListsV1

Recent Matches V1

Function: get_recent_matches_v1

Result Type: RecentMatchesV1

Leaderboard V1

Function: get_leaderboard_v1

Result Type: LeaderboardV1

Content V1

Function: get_content_v1

Result Type: ContentV1

Get Platform Data V1

Arguments

  • credentials_manager - The credentials manager
  • region - The region of the match

Example

let region = Region::EU;
let result = valorant_api_official::get_platform_data_v1(credentials_manager, &http_client, region).await;
println!("Result: {:#?}", result);

Get the match details of a match

Arguments

  • credentials_manager - The credentials manager
  • region - The region of the match
  • match_id - The match id of the match

Example

let match_id = Uuid::parse_str("3100c02b-17d2-4adb-97b5-e45dee67d292").expect("Invalid UUID");
let region = Region::EU;
let result = valorant_api_official::get_match_details_v1(credentials_manager, &http_client, region, &match_id).await;
println!("Result: {:#?}", result);

Get the match details of a match for console

Arguments

  • credentials_manager - The credentials manager
  • region - The region of the match
  • match_id - The match id of the match

Example

let match_id = Uuid::parse_str("3100c02b-17d2-4adb-97b5-e45dee67d292").expect("Invalid UUID");
let region = Region::EU;
let result = valorant_api_official::get_match_details_console_v1(credentials_manager, &http_client, region, &match_id).await;
println!("Result: {:#?}", result);

Get the match lists of a player

Arguments

  • credentials_manager - The credentials manager
  • region - The region of the player
  • puuid - The puuid of the player

Example

let puuid = "";
let region = Region::EU;
let result = valorant_api_official::get_match_lists_v1(credentials_manager, &http_client, region, &puuid).await;
println!("Result: {:#?}", result);

Get the match lists of a player for console

Arguments

  • credentials_manager - The credentials manager
  • region - The region of the player
  • platform_type - The platform of the player
  • puuid - The puuid of the player

Example

let puuid = "";
let region = Region::EU;
let result = valorant_api_official::get_match_lists_console_v1(credentials_manager, &http_client, region, &puuid).await;
println!("Result: {:#?}", result);

Get the account of a player

Arguments

  • credentials_manager - The credentials manager
  • region - The region of the player
  • puuid - The puuid of the player

Example

let puuid = "";
let result = valorant_api_official::get_accounts_v1(credentials_manager, &http_client, &puuid).await;
println!("Result: {:#?}", result);

Get the account of a player

Arguments

  • credentials_manager - The credentials manager
  • region - The region of the player
  • name - The name of the player
  • tag - The tag of the player

Example

let name = "";
let tag = "";
let result = valorant_api_official::get_accounts_v1(credentials_manager, &http_client, &name, &tag).await;
println!("Result: {:#?}", result);

Get the shards of a player

Arguments

  • credentials_manager - The credentials manager
  • puuid - The puuid of the player

Example

let puuid = "";
let result = valorant_api_official::get_active_shards_v1(credentials_manager, &http_client, &puuid).await;
println!("Result: {:#?}", result);

Get the recent matches of a queue

Arguments

  • credentials_manager - The credentials manager
  • region - The region of the queue
  • queue - The queue of the matches

Example

let queue = Queue::Competitive;
let region = Region::EU;
let result = valorant_api_official::get_recent_matches_v1(credentials_manager, &http_client, region, queue).await;
println!("Result: {:#?}", result);

Get the recent matches of a queue for console

Arguments

  • credentials_manager - The credentials manager
  • region - The region of the queue
  • queue - The queue of the matches

Example

let queue = Queue::Competitive;
let region = Region::EU;
let result = valorant_api_official::get_recent_matches_console_v1(credentials_manager, &http_client, region, queue).await;
println!("Result: {:#?}", result);

Get the content of the game

Arguments

  • credentials_manager - The credentials manager
  • region - The region of the player
  • query_args - The query arguments

Example

let region = Region::EU;
let query_args = HashMap::new();
let result = valorant_api_official::get_content_v1(credentials_manager, &http_client, region, query_args).await;
println!("Result: {:#?}", result);

Get the leaderboard of a region

Arguments

  • credentials_manager - The credentials manager
  • region - The region of the leaderboard
  • act - The season of the leaderboard
  • query_args - The query arguments

Errors

RequestError - If the request failed

Example

let act = Uuid::parse_str("34093c29-4306-43de-452f-3f944bde22be").expect("Invalid UUID");
let region = Region::EU;
let queries = HashMap::new();
let result = valorant_api_official::get_leaderboard_v1(credentials_manager, &http_client, region, &act, queries).await;
println!("Result: {:#?}", result);

Get the leaderboard of a region for console

Arguments

  • credentials_manager - The credentials manager
  • region - The region of the leaderboard
  • act - The season of the leaderboard
  • query_args - The query arguments

Errors

RequestError - If the request failed

Example

let act = Uuid::parse_str("34093c29-4306-43de-452f-3f944bde22be").expect("Invalid UUID");
let region = Region::EU;
let queries = HashMap::new();
let result = valorant_api_official::get_leaderboard_console_v1(credentials_manager, &http_client, region, &act, queries).await;
println!("Result: {:#?}", result);

Dependencies

~7–19MB
~248K SLoC