Skip to content

Latest commit

 

History

History
109 lines (75 loc) · 3.38 KB

README.md

File metadata and controls

109 lines (75 loc) · 3.38 KB

LessAPI-DuckDuckGo

GitHub Docker

English | 简体中文 | 繁體中文 | 日本語 | 한국어 | Русский | Deutsch | Français | Español | Italiano | Português


简介

LessAPI-DuckDuckGo 是一个搜索引擎API服务。

基于 playwright 和 DuckDuckGo 搜索引擎,封装后实现简单的API接口。

简单、轻量、可靠、Docker部署、易于维护。

大型语言模型(LLM)友好。支持纯文本响应。

状态

实验性地开发中,不建议在生产环境中使用。

部署

使用Docker只需要一个命令即可将服务部署到8080端口。

docker run -d -p 8080:8080 --restart=unless-stopped --name lessapi-duckduckgo lessapi/lessapi-duckduckgo:v0.0.3

使用

OpenAPI标准文档 (Swagger 3.0)

OpenAPI标准文档 (Swagger 3.0)

文本搜索 GET /search/text

请求参数:

  • keyword: 搜索关键字(必填)
  • region: 地区(选填) en-US, fr-FR, zh-CN, ru-RU, 等 默认值 en-US
  • maxCount: 最大返回数量(选填) 默认值 20
  • viaProxyUrl: 浏览器使用代理的地址(选填) 如 http://proxy.server:3000 默认值 空
  • llmStyle: 是否使用大型语言模型(LLM)友好风格响应(选填) 1, 0 默认值 0

Tips:位于中国大陆的用户直接访问DuckDuckGo可能遇到网络不稳定的问题,建议使用 viaProxyUrl 参数指定代理地址。

请求示例:

curl 'http://127.0.0.1:8080/search/text?keyword=lessapi&maxCount=10'
curl 'http://127.0.0.1:8080/search/text?keyword=lessapi&maxCount=99&viaProxyUrl=http://proxy.server:3000'

响应示例:

{
  "code": "success",
  "data": {
    "results": [
      {
        "order": 1,
        "title": "Adele - Hello (Official Music Video) - YouTube",
        "url": "https://www.youtube.com/watch?v=YQHsXMglC9A",
        "description": "Listen to \"Easy On Me\" here: http://Adele.lnk.to/EOMPre-order Adele's new album \"30\" before its release on November 19: https://www.adele.comShop the \"Adele..."
      },
      {
        "order": 2,
        "title": "Hello Definition & Meaning - Merriam-Webster",
        "url": "https://www.merriam-webster.com/dictionary/hello",
        "description": "Learn the origin, usage, and synonyms of the word hello, an expression or gesture of greeting. See examples of hello in sentences and related words from the dictionary."
      }
    ]
  }
}

高级

使用环境变量

  • LESSAPI_DEFAULT_LANGUAGE: (选填) 默认语言, 如 en-US, fr-FR, zh-CN, ru-RU, 等 默认值 en-US
  • LESSAPI_DEFAULT_VIA_PROXY_URL: (选填) 浏览器默认使用代理的地址, 如 http://proxy.server:3000 默认值 空

安全

Security Status

许可

MIT