BraveEx

BraveEx is an Elixir client library for interacting with the Brave Search API. It provides a simple and consistent interface to perform web, image, video, news searches, fetch query suggestions, and perform spellchecks—all using a unified API.

Features

Installation

Add brave_ex to your list of dependencies in mix.exs:

def deps do
  [
    {:brave_ex, "~> 0.1.0"}
  ]
end

Then, fetch the dependencies by running:

mix deps.get

Configuration

BraveEx requires an API key for authenticating with the Brave Search API. The API key is determined via the following priority:

  1. Passed in explicitly as an option (:api_key).
  2. Pulled from the environment variable BRAVE_API_KEY.
  3. Retrieved from your application configuration (default app key is :brave_ex).

Make sure your API key is set in one of these ways before using the library.

Usage

All search functions accept a query string and an optional keyword list of parameters to customize the search request.

Web Search Example

iex> BraveEx.web_search("Elixir programming")

Other Search Functions

Options

Each search function accepts an optional keyword list that lets you override default values and customize your request. Some of the common options include:

For full details, please refer to the function documentation inside the module.

Contributing

Contributions are welcome! If you’d like to help improve BraveEx, feel free to fork the repository and submit pull requests. For any major changes, please open an issue first to discuss what you would like to change.

License

BraveEx is released under the BSD-3-Clause License.