# `Ollixir.Web`
[🔗](https://github.com/nshkrdotcom/ollixir/blob/main/lib/ollixir/web.ex#L1)

Web search and fetch functionality for Ollama cloud API.

These functions require an Ollama API key when calling the hosted API.
Set the `OLLAMA_API_KEY` environment variable or pass authorization headers
when initializing the client.

# `fetch_opts`
[🔗](https://github.com/nshkrdotcom/ollixir/blob/main/lib/ollixir/web.ex#L21)

```elixir
@type fetch_opts() :: [url: String.t(), base_url: String.t()]
```

# `search_opts`
[🔗](https://github.com/nshkrdotcom/ollixir/blob/main/lib/ollixir/web.ex#L15)

```elixir
@type search_opts() :: [
  query: String.t(),
  max_results: pos_integer(),
  base_url: String.t()
]
```

# `fetch`
[🔗](https://github.com/nshkrdotcom/ollixir/blob/main/lib/ollixir/web.ex#L55)

```elixir
@spec fetch(Ollixir.client(), fetch_opts()) ::
  {:ok, Ollixir.Web.FetchResponse.t()} | {:error, term()}
```

Fetch and extract content from a URL.

# `fetch!`
[🔗](https://github.com/nshkrdotcom/ollixir/blob/main/lib/ollixir/web.ex#L69)

```elixir
@spec fetch!(Ollixir.client(), fetch_opts()) :: Ollixir.Web.FetchResponse.t()
```

Fetch content, raising on error.

# `search`
[🔗](https://github.com/nshkrdotcom/ollixir/blob/main/lib/ollixir/web.ex#L30)

```elixir
@spec search(Ollixir.client(), search_opts()) ::
  {:ok, Ollixir.Web.SearchResponse.t()} | {:error, term()}
```

Search the web using Ollama's cloud search API.

# `search!`
[🔗](https://github.com/nshkrdotcom/ollixir/blob/main/lib/ollixir/web.ex#L44)

```elixir
@spec search!(Ollixir.client(), search_opts()) :: Ollixir.Web.SearchResponse.t()
```

Search the web, raising on error.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
