用途:AnySearch 为 AI 智能体提供实时信息检索能力,适用于事实查询、新闻与文档查找、事实核查、网页正文提取、垂直领域结构化查询以及多意图并行搜索。
主要能力:提供 search(通用搜索,可用 --max_results 限制 1-10 条)、batch_search(并行批量搜索)、extract(提取整页内容,输出为 Markdown)、get_sub_domains(发现垂直子领域及所需参数)等命令。垂直领域覆盖 finance、academic、travel、health、code、legal、gaming、film、business、security、ip、energy、environment、agriculture、resource、social_media 等。
使用方式:优先直接调用 CLI,命令形如 <cmd> search "query" --max_results 5;垂直搜索前须先运行 get_sub_domains 获取子领域与必填参数,再以 --sub_domain_params 传入。运行时按 Python > Node.js > Shell 优先级选择,若存在 runtime.conf 则直接读取其中的 Runtime 与 Command。仅在接口未知或需恢复信息时运行 doc 命令。
API Key:优先级为 --api_key 参数 > .env 文件(ANYSEARCH_API_KEY)> 系统环境变量 > 匿名访问。匿名访问可用但速率限制较低。密钥耗尽且响应返回新密钥时,须先征得用户确认再写入 .env。
限制:查询、提取的 URL 与 API Key 会发送至 https://api.anysearch.com,敏感信息(密码、个人数据、商业机密)不建议使用。extract 命令不支持 --format 等格式选项。若服务不可用(无密钥、配额耗尽、服务或网络错误),应告知用户并可在用户同意后回退其他搜索方式。最低运行环境为 Python 3.6+(含 requests)、Node.js 12+、PowerShell 5.1+ 或 bash 4+。