ExValorantAPIClient v0.2.0 ExValorantAPIClient View Source
This module is Valorant API wrapper public interface.
Since some APIs is not yet available to the public, I have not confirmed that this module works properly.
Link to this section Summary
Functions
Get Account data by puuid.
Get Account data by game_name and tag_line.
Get active shard for a player.
Get content optionally filtered by locale.
Get match by id .
Get metchlist for games played by puuid .
Create api client.
Link to this section Functions
get_account_by_puuid(client, region, puuid, opts \\ [])
View Source (since 0.1.0)Specs
get_account_by_puuid(Tesla.Client.t(), String.t(), String.t(), keyword()) :: Tesla.Env.result()
Get Account data by puuid.
Example
iex> ExValorantAPIClient.Account.get_account_by_puuid(client, "asia", "Yy5i4LmA9J1dkiCgUycHB8Ec_XYLOsouuef7arkDY2q2_i-9YoCTf2KHwY25ckrOFVEyks6I4D8K4A")
{:ok,
...
body: %{
"gameName" => "G kenkun",
"puuid" => "Yy5i4LmA9J1dkiCgUycHB8Ec_XYLOsouuef7arkDY2q2_i-9YoCTf2KHwY25ckrOFVEyks6I4D8K4A",
"tagLine" => "JP1"
},
...
status: 200,
url: "https://asia.api.riotgames.com/riot/account/v1/accounts/by-puuid/Yy5i4LmA9J1dkiCgUycHB8Ec_XYLOsouuef7arkDY2q2_i-9YoCTf2KHwY25ckrOFVEyks6I4D8K4A"
}} get_account_by_riot_id(client, region, game_name, tag_line, opts \\ [])
View Source (since 0.1.0)Get Account data by game_name and tag_line.
Example
iex> ExValorantAPIClient.Account.get_account_by_riot_id(client, "asia", "g_kenkun", "JP1")
{:ok,
...
body: %{
"gameName" => "G kenkun",
"puuid" => "Yy5i4LmA9J1dkiCgUycHB8Ec_XYLOsouuef7arkDY2q2_i-9YoCTf2KHwY25ckrOFVEyks6I4D8K4A",
"tagLine" => "JP1"
},
...
status: 200,
url: "https://asia.api.riotgames.com/riot/account/v1/accounts/by-riot-id/g_kenkun/JP1"
}} get_active_shards_for_a_player(client, region, game, puuid, opts \\ [])
View Source (since 0.1.0)Get active shard for a player.
Example
iex> ExValorantAPIClient.Account.get_active_shards_for_a_player(client, "asia", "val", "Yy5i4LmA9J1dkiCgUycHB8Ec_XYLOsouuef7arkDY2q2_i-9YoCTf2KHwY25ckrOFVEyks6I4D8K4A")
{:ok,
...
body: %{
"activeShard" => "ap",
"game" => "val",
"puuid" => "Yy5i4LmA9J1dkiCgUycHB8Ec_XYLOsouuef7arkDY2q2_i-9YoCTf2KHwY25ckrOFVEyks6I4D8K4A"
},
...
status: 200,
url: "https://asia.api.riotgames.com/riot/account/v1/active-shards/by-game/val/by-puuid/Yy5i4LmA9J1dkiCgUycHB8Ec_XYLOsouuef7arkDY2q2_i-9YoCTf2KHwY25ckrOFVEyks6I4D8K4A"
}} get_content_optionally_filtered_by_locale(client, region, opts \\ [])
View Source (since 0.1.0)Specs
get_content_optionally_filtered_by_locale( Tesla.Client.t(), String.t(), keyword() ) :: Tesla.Env.result()
Get content optionally filtered by locale.
Option
locale
- ar-AE
- de-DE
- en-GB
- en-US
- es-ES
- es-MX
- fr-FR
- id-ID
- it-IT
- ja-JP
- ko-KR
- pl-PL
- pt-BR
- ru-RU
- th-TH
- tr-TR
- vi-VN
- zh-CN
- zh-TW
Example
iex> ExValorantAPIClient.get_content_optionally_filtered_by_locale(client, "AP")
{:ok,
...
body: %{
...
],
"version" => "release-01.03"
},
status: 200,
url: "https://AP.api.riotgames.com/val/content/v1/contents"
}}
# use locale option...
iex> ExValorantAPIClient.get_content_optionally_filtered_by_locale(client, "AP", locale: "ja-JP")
{:ok,
...
body: %{
...
],
"version" => "release-01.03"
},
status: 200,
url: "https://AP.api.riotgames.com/val/content/v1/contents"
}} get_match_by_id(client, region, match_id, opts \\ [])
View Source (since 0.1.0)Specs
get_match_by_id(Tesla.Client.t(), String.t(), String.t(), keyword()) :: Tesla.Env.result()
Get match by id .
Since the API is not yet available to the public, I have not confirmed that this module works properly.
Example
# ExValorantAPIClient.get_match_by_id(client, "AP", "match_id") get_matchlist_for_games_played_by_puuid(client, region, puuid, opts \\ [])
View Source (since 0.1.0)Specs
get_matchlist_for_games_played_by_puuid( Tesla.Client.t(), String.t(), String.t(), keyword() ) :: Tesla.Env.result()
Get metchlist for games played by puuid .
Since the API is not yet available to the public, I have not confirmed that this module works properly.
Example
# ExValorantAPIClient.get_matchlist_for_games_played_by_puuid(client, "AP", "your_puuid") Create api client.
Examples
iex> ExValorantAPIClient.new("your_api_key")
%Tesla.Client{
adapter: nil,
fun: nil,
post: [],
pre: [
{Tesla.Middleware.DecompressResponse, :call, [[]]},
{Tesla.Middleware.JSON, :call, [[engine: Jason]]},
{Tesla.Middleware.Headers, :call, [[{"X-Riot-Token", "your_api_key"}]]}
]
}