OsuAPI

Build StatusHex.pm

A wrapper around the osu! API.

Installation

In your mix.exs:

defp deps do
  [{:osu_api, "~> 0.1"}]
end

Usage

iex> OsuAPI.get_user("cookiezi", event_days: 5)
{:ok, %{user_id: 124493, username: "Cookiezi", ...}}

The get_* function names mirror the API itself as do the parameter names, which can be passed as a trailing keyword list.

The returned data is mostly identical to the osu! API documentation, except for the following:

Configuration

To access the osu! API, you need to provide an API key. You can pass the k parameter around if you want, but otherwise you can configure its value in config.exs:

config :osu_api, api_key: "<your key here>"

You can also set the OSU_API_KEY environment variable.