diff --git a/README.md b/README.md index c0a588d..4f9bdf0 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ [![Docker Pulls](https://img.shields.io/docker/v/karust/openserp)](https://hub.docker.com/repository/docker/karust/openserp) [![CI](https://github.com/karust/openserp/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/karust/openserp/actions/workflows/ci.yml) -**OpenSERP** is an API and CLI for accessing search engine results from **Google, Yandex, Baidu, Bing, and DuckDuckGo**. +**OpenSERP** is an API and CLI for accessing search engine results from **Google, Yandex, Baidu, Bing, DuckDuckGo, and Ecosia**. A developer-friendly alternative to paid SERP API services! **Official website:** [openserp.org](https://openserp.org) @@ -53,7 +53,7 @@ go build -o openserp . ## Search Endpoints -Available engine names: `google`, `yandex`, `baidu`, `bing`, `duckduckgo`. +Available engine names: `google`, `yandex`, `baidu`, `bing`, `duckduckgo`, `ecosia`. Dedicated engine endpoints: diff --git a/cmd/proxy_policy.go b/cmd/proxy_policy.go index 42aa88b..babdcda 100644 --- a/cmd/proxy_policy.go +++ b/cmd/proxy_policy.go @@ -13,6 +13,7 @@ func buildEngineProxyPolicyMap() map[string]string { "baidu": config.BaiduConfig.Proxy, "bing": config.BingConfig.Proxy, "duckduckgo": config.DuckDuckGoConfig.Proxy, + "ecosia": config.EcosiaConfig.Proxy, } } diff --git a/cmd/root.go b/cmd/root.go index 403097d..05674f3 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -16,7 +16,7 @@ import ( ) const ( - version = "0.7.7" + version = "0.7.8" defaultConfigFilename = "config" envPrefix = "OPENSERP" ) @@ -317,7 +317,7 @@ func initializeConfig(cmd *cobra.Command) error { } func validateEngineProxyTags(v *viper.Viper) error { - for _, engineName := range []string{"google", "yandex", "baidu", "bing", "duckduckgo"} { + for _, engineName := range []string{"google", "yandex", "baidu", "bing", "duckduckgo", "ecosia"} { key := engineName + ".proxy" if !v.IsSet(key) { continue diff --git a/cmd/serve.go b/cmd/serve.go index 8453c39..7162abc 100644 --- a/cmd/serve.go +++ b/cmd/serve.go @@ -39,6 +39,8 @@ func (r *rawEngine) Search(ctx context.Context, q core.Query) ([]core.SearchResu return yandex.Search(ctx, q) case "baidu": return baidu.Search(ctx, q) + case "ecosia": + return ecosia.Search(ctx, q) default: return nil, fmt.Errorf("unsupported engine: %s", r.name) } @@ -102,6 +104,7 @@ func serve(cmd *cobra.Command, args []string) { &rawEngine{name: "google"}, &rawEngine{name: "yandex"}, &rawEngine{name: "baidu"}, + &rawEngine{name: "ecosia"}, ) if err := listenWithGracefulShutdown(serv, nil); err != nil { logrus.Error(err) diff --git a/docs/openapi.yaml b/docs/openapi.yaml index cb6b1c9..696372f 100644 --- a/docs/openapi.yaml +++ b/docs/openapi.yaml @@ -32,7 +32,7 @@ paths: operationId: searchWeb summary: Search web results from a specific engine description: > - Engine path values are `google`, `yandex`, `baidu`, `bing`, and `duck` + Engine path values are `google`, `yandex`, `baidu`, `bing`, `duck`, and `ecosia` (`duck` maps to DuckDuckGo internally). Use `?format=markdown|text|ndjson` for alternative output formats. parameters: @@ -487,7 +487,7 @@ components: description: Search engine endpoint alias (`duck` is DuckDuckGo). schema: type: string - enum: [google, yandex, baidu, bing, duck] + enum: [google, yandex, baidu, bing, duck, ecosia] TextQuery: name: text in: query