ExAthena.Search.Http (ExAthena v0.17.0)

Copy Markdown View Source

HTTP-backed ExAthena.Search implementation. Backend-agnostic: the actual provider is chosen by config and is the only provider-specific code here.

config :ex_athena, :search,
  adapter: ExAthena.Search.Http,
  backend: :duckduckgo,           # :duckduckgo | :tavily | :brave | :searxng
  api_key: System.get_env("EX_ATHENA_SEARCH_API_KEY"),
  endpoint: System.get_env("EX_ATHENA_SEARCH_ENDPOINT")
backendauthextra confignotes
:duckduckgononedefault; parses the HTML SERP — best-effort, rate-limited, no official API
:tavilyapi_key (paid)clean LLM-oriented snippets
:braveapi_key (free tier)privacy-focused
:searxngnoneendpoint requiredself-hosted; queries the JSON API

The :searxng backend maps the tool's topic/recency onto SearXNG's categories/time_range, returns score and published when present, and takes optional instance tuning under a nested :searxng key:

config :ex_athena, :search,
  backend: :searxng,
  endpoint: "http://localhost:8888",
  searxng: [language: "en", safesearch: 1, engines: "google,duckduckgo"]

Tests inject a plug (or any Req option) via config :ex_athena, :search, req_options: [...] so no network is hit.