import "github.com/kinorai/omnifeed/internal/transport/searchapi"
Package searchapi exposes the web-search use case over plain HTTP/JSON, so non-MCP clients (scripts, RAG pipelines, n8n, …) can run the same query → result-URLs search the `web_search` MCP tool provides — no MCP client required. It is mounted only when a Searcher is configured.
POST /search
Headers: Authorization: Bearer <api_key>
Body: {"query": "...", "limit": 10, "time_range": "week", "language": "en", "site": "reddit.com"}
Resp: [{"title","url","snippet","engine","published_date"}, ...]
Config configures the Server.
type Config struct {
Searcher domain.Searcher
Authenticator auth.Authenticator
Logger *slog.Logger
Metrics *observability.Metrics
MaxResults int
}
Server is the REST search endpoint.
type Server struct {
// contains filtered or unexported fields
}
func New(cfg Config) *Server
New constructs the server.
func (s *Server) Register(mux *http.ServeMux)
Register attaches /search to mux.
Generated by gomarkdoc