Brawlex (brawlex v0.2.0)

Documentation for Brawlex.

Link to this section Summary

Types

Two letter country code, or 'global' for global rankings.

Game's internal ID for players and clubs. It always start with '#'

The Brawl Stars api token for authentication. You can get it from https://developer.brawlstars.com

Functions

Shutdown the token_process.

Get information about a brawler.

Get list of available brawlers.

Get information about a single clan by club tag.

Get information about a single player by player tag.

Get list of recent battle results for a player. NOTE: It may take up to 30 minutes for a new battle to appear in the battlelog.

Get brawler rankings for a country or global rankings. Brawler identifiers can be found by using get_brawlers function.

Get club rankings for a country or global rankings.

Get player rankings for a country or global rankings.

Get power play rankings for a country or global rankings. 'latest' can be used as seasonId to get rankings for the latest season.

Get list of power play seasons for a country or global rankings.

Call the BrawlBrain to set up a new token_process for requests. If the token is alredy in use and allow_duplicates is false, just reference to it. Return {:ok, pid} in case of success or {:error, reason} in fail case.

Link to this section Types

Link to this type

country_code()

Specs

country_code() :: String.t()

Two letter country code, or 'global' for global rankings.

Specs

tag() :: String.t()

Game's internal ID for players and clubs. It always start with '#'

Specs

token() :: String.t()

The Brawl Stars api token for authentication. You can get it from https://developer.brawlstars.com

Link to this section Functions

Link to this function

close_connection(tpid)

Specs

close_connection(pid()) :: :ok

Shutdown the token_process.

Link to this function

get_brawler(tpid, brawler_id, timeout \\ 5000)

Specs

get_brawler(pid(), String.t(), timeout()) :: {:ok, map()} | {:error, any()}

Get information about a brawler.

Link to this function

get_brawlers(tpid, timeout \\ 5000)

Specs

get_brawlers(pid(), timeout()) :: {:ok, [map()]} | {:error, any()}

Get list of available brawlers.

Link to this function

get_club(tpid, club_tag, timeout \\ 5000)

Specs

get_club(pid(), tag(), timeout()) :: {:ok, [map()]} | {:error, any()}

Get information about a single clan by club tag.

Link to this function

get_club_members(tpid, club_tag, timeout \\ 5000)

Specs

get_club_members(pid(), tag(), timeout()) :: {:ok, [map()]} | {:error, any()}

List club members.

Link to this function

get_player(tpid, player_tag, timeout \\ 5000)

Specs

get_player(pid(), tag(), timeout()) :: {:ok, [map()]} | {:error, any()}

Get information about a single player by player tag.

Link to this function

get_player_battlelog(tpid, player_tag, timeout \\ 5000)

Specs

get_player_battlelog(pid(), tag(), timeout()) ::
  {:ok, [map()]} | {:error, any()}

Get list of recent battle results for a player. NOTE: It may take up to 30 minutes for a new battle to appear in the battlelog.

Link to this function

get_ranking_brawlers(tpid, country_c, brawler_id, timeout \\ 5000)

Specs

get_ranking_brawlers(pid(), country_code(), String.t(), timeout()) ::
  {:ok, [map()]} | {:error, any()}

Get brawler rankings for a country or global rankings. Brawler identifiers can be found by using get_brawlers function.

Link to this function

get_ranking_clubs(tpid, country_c, timeout \\ 5000)

Specs

get_ranking_clubs(pid(), country_code(), timeout()) ::
  {:ok, [map()]} | {:error, any()}

Get club rankings for a country or global rankings.

Link to this function

get_ranking_players(tpid, country_c, timeout \\ 5000)

Specs

get_ranking_players(pid(), country_code(), timeout()) ::
  {:ok, [map()]} | {:error, any()}

Get player rankings for a country or global rankings.

Link to this function

get_ranking_season(tpid, country_c, season_id, timeout \\ 5000)

Specs

get_ranking_season(pid(), country_code(), String.t(), timeout()) ::
  {:ok, [map()]} | {:error, any()}

Get power play rankings for a country or global rankings. 'latest' can be used as seasonId to get rankings for the latest season.

Link to this function

get_ranking_seasons(tpid, country_c, timeout \\ 5000)

Specs

get_ranking_seasons(pid(), country_code(), timeout()) ::
  {:ok, [map()]} | {:error, any()}

Get list of power play seasons for a country or global rankings.

Link to this function

open_connection(token_id, allow_duplicates, timeout \\ 5000)

Specs

open_connection(token(), boolean(), timeout()) :: {:ok, pid()} | {:error, any()}

Call the BrawlBrain to set up a new token_process for requests. If the token is alredy in use and allow_duplicates is false, just reference to it. Return {:ok, pid} in case of success or {:error, reason} in fail case.