godfist v0.5.0 Godfist

Godfist is a wrapper for the League of Legends ReST API written in Elixir.

There are some endpoints that I’ll be adding later which will be the static data from Data Dragon and Tournament support.

Every function requires that you pass the region to execute the request to since Riot uses that to Rate limit the usage of the api. Every region should be passed as an Atom, remember that :P

Set your api key in your config.exs file with the given params.

config :godfist,
  token: "YOUR API KEY"

Link to this section Summary

Functions

Get active game of a given player by region and name

Get a specific champion by id

Get a specific champion it’s name. This is useful to work with the Godfist.DataDragon endpoints

Find similar champs to the query

Get the account id of a player by it’s region and name

Get the summoner id of a player by it’s name and region

Get matchlist of a player by it’s region and name

Link to this section Functions

Link to this function active_game(region, name)
active_game(atom, String.t) :: {:ok, map} | {:error, String.t}

Get active game of a given player by region and name.

Example

iex> Godfist.active_game(:na, "Summoner name")
Link to this function all_champs(region, opts \\ [])
all_champs(atom, Keyword.t) :: {:ok, map} | {:error, String.t}

Get all champs.

Refer to Godfist.Champion.all/2 for option.

Link to this function champion(region, id)
champion(atom, integer) :: {:ok, map} | {:error, String.t}

Get a specific champion by id.

Refer to Godfist.Champion.by_id/2

Link to this function champion_by_name(champions, locale \\ :us)
champion_by_name(String.t, atom) ::
  {String.t, map} |
  MatchError
champion_by_name(list, atom) :: list | MatchError

Get a specific champion it’s name. This is useful to work with the Godfist.DataDragon endpoints.

Example

iex> Godfist.champion_by_name("リー・シン", :japanese)
iex> Godfist.champion_by_name(["Lee Sin", "Rek'Sai", "Nocturne"])
Link to this function find_similar(name, locale \\ :us)
find_similar(String.t, atom) :: list | {:error, String.t}

Find similar champs to the query.

Example

iex> Godfist.find_similar("Noc", :us)
iex> Godfist.find_similar("L")
Link to this function get_account_id(region, name)
get_account_id(atom, String.t) ::
  {:ok, integer} |
  {:error, String.t}

Get the account id of a player by it’s region and name.

Refer to Godfist.Summoner.get_id/2

Link to this function get_summid(region, name)
get_summid(atom, String.t) ::
  {:ok, integer} |
  {:error, String.t}

Get the summoner id of a player by it’s name and region:

Example

iex> Godfist.get_summid(:lan, "SummonerName")
Link to this function matchlist(region, name, opts \\ [])
matchlist(atom, String.t, Keyword.t) ::
  {:ok, map} |
  {:error, String.t}

Get matchlist of a player by it’s region and name.

Same as Godfist.Match.matchlist/3 (Check for a list of options) but you don’t have to provide the summoner id directly.

Example

iex> Godfist.matchlist(:lan, "SummonerName")