Deepl (deepl v0.3.0)
View SourceProvide base functions for the DeepL API.
Summary
Functions
Get base URL based on API key input.
Get the currently active API key.
Get current plan based on the API key.
Set the API key in the application environment.
Functions
@spec base_url!() :: String.t()
Get base URL based on API key input.
Returns base URL for pro or free accounts, determined by the API key, free account keys end
with :fx.
Examples
iex> Deepl.base_url!()
"https://api-free.deepl.com"
@spec get_api_key() :: String.t() | nil
Get the currently active API key.
Examples
iex> Deepl.get_api_key()
"wwwwwwww-xxxx-yyyy-zzzz-123456789012:fx"
@spec plan!() :: :free | :pro | Exception.t()
Get current plan based on the API key.
Returns atom :free for free accounts and :pro for pro accounts.
Examples
iex> Deepl.plan!()
:free
@spec set_api_key(String.t()) :: :ok
Set the API key in the application environment.
Examples
iex> Deepl.set_api_key("wwwwwwww-xxxx-yyyy-zzzz-123456789012:fx")
:ok