#api #valorant #region #history #manager #credentials #credentials-manager

valorant_api_official

A library for interacting with the Official Valorant API

11 releases

0.0.10 Mar 28, 2024
0.0.9 Mar 28, 2024
0.0.8 Feb 20, 2024
0.0.7 Jan 24, 2024
0.0.0 Jul 31, 2023

#245 in Authentication

Download history 35/week @ 2023-12-30 37/week @ 2024-01-06 4/week @ 2024-01-13 17/week @ 2024-01-20 3/week @ 2024-02-10 140/week @ 2024-02-17 32/week @ 2024-02-24 6/week @ 2024-03-02 18/week @ 2024-03-09 14/week @ 2024-03-16 160/week @ 2024-03-23 54/week @ 2024-03-30 2/week @ 2024-04-06 319/week @ 2024-04-13

535 downloads per month

MIT license

42KB
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 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 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 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);

Dependencies

~7–21MB
~283K SLoC