Ollama Web Search

v1.0.2

使用 Ollama Web Search API 进行网络搜索和网页抓取

0· 171·0 current·0 all-time
bySunnyDoy@sunnydou

Install

OpenClaw Prompt Flow

Install with OpenClaw

Best for remote or guided setup. Copy the exact prompt, then paste it into OpenClaw for sunnydou/ollama-web-search-tool.

Previewing Install & Setup.
Prompt PreviewInstall & Setup
Install the skill "Ollama Web Search" (sunnydou/ollama-web-search-tool) from ClawHub.
Skill page: https://clawhub.ai/sunnydou/ollama-web-search-tool
Keep the work scoped to this skill only.
After install, inspect the skill metadata and help me finish setup.
Required env vars: OLLAMA_API_KEY
Required binaries: curl, python3
Use only the metadata you can verify from ClawHub; do not invent missing requirements.
Ask before making any broader environment changes.

Command Line

CLI Commands

Use the direct CLI path if you want to install manually and keep every step visible.

OpenClaw CLI

Bare skill slug

openclaw skills install ollama-web-search-tool

ClawHub CLI

Package manager switcher

npx clawhub@latest install ollama-web-search-tool
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
high confidence
Purpose & Capability
Name/description, declared requirements (curl, python3, OLLAMA_API_KEY), SKILL.md, README, and the shell script all align: they call https://ollama.com/api/web_search and /api/web_fetch to perform searches and fetch pages.
Instruction Scope
Runtime instructions and the script only build JSON from the provided query/URL, POST it to Ollama endpoints, parse responses, and print results. The instructions do not request unrelated files, other environment variables, or external endpoints beyond ollama.com.
Install Mechanism
No install spec — instruction-only with a shipped bash script. No downloads from untrusted URLs and no archive extraction; risk from install-time behavior is minimal.
Credentials
Only OLLAMA_API_KEY is required and declared as primaryEnv. The script uses that key only to authenticate requests to Ollama and attempts to redact it from error output; no additional secrets or unrelated credentials are requested.
Persistence & Privilege
The skill is not always-enabled and does not modify system-wide agent config. It creates a temporary directory for request handling and cleans it up; no persistent storage or elevated privileges are requested.
Assessment
This skill is internally consistent and calls Ollama's official web_search/web_fetch APIs using the OLLAMA_API_KEY you provide. Before installing: 1) ensure you trust the Ollama service and understand that any query text or fetched URLs will be sent to ollama.com; avoid sending sensitive internal URLs or secrets. 2) Store the OLLAMA_API_KEY securely (environment variable) and use a key with limited scope/rotation if possible. 3) Review the included shell script yourself if you want extra assurance (it performs input validation, masks the API key in errors, and removes temporary files). 4) Be aware the skill can be invoked by agents (default behavior) — if you run autonomous agents, limit what queries they can send through third-party APIs.

Like a lobster shell, security has layers — review code before you run it.

Runtime requirements

🔍 Clawdis
Binscurl, python3
EnvOLLAMA_API_KEY
Primary envOLLAMA_API_KEY
latestvk972rhx4wzw6qvat9ds8yr9eqd83nc5v
171downloads
0stars
4versions
Updated 1mo ago
v1.0.2
MIT-0

ollama-web-search Skill

使用 Ollama Web Search API 进行网络搜索和网页抓取。

🔧 前置要求

1. Ollama API Key

2. 依赖工具

  • curl: HTTP 请求工具 (macOS/Linux 自带)
  • python3: JSON 解析和转义 (macOS/Linux 自带)

3. 依赖检查

python3 --version  # 检查 Python3
curl --version     # 检查 curl

📋 功能

功能命令说明
Web Searchsearch执行网络搜索,返回相关结果
Web Fetchfetch获取单个网页内容

🛠️ 使用方法

方法一:直接执行脚本

搜索:

./ollama-web-search.sh search "AI 最新进展" 5

抓取网页:

./ollama-web-search.sh fetch "https://ollama.com"

方法二:使用 Slash 命令 (推荐)

搜索:

/ollama-search "AI 最新进展" 5

抓取网页:

/ollama-fetch "https://ollama.com"

方法三:在对话中使用

用 ollama-web-search-cli 搜索 "Ollama 新功能"
抓取 https://docs.ollama.com 页面内容

📊 参数

Web Search

参数类型必需默认值说明
querystring-搜索查询字符串
max_resultsnumber5最大结果数 (1-10)

Web Fetch

参数类型必需说明
urlstring要抓取的网页 URL

📤 响应格式

Web Search

{
  "results": [
    {
      "title": "页面标题",
      "url": "https://example.com",
      "content": "相关内容摘要"
    }
  ]
}

Web Fetch

{
  "title": "页面标题",
  "content": "页面主要内容",
  "links": ["链接 1", "链接 2", ...]
}

🔍 示例

搜索示例

# 基本搜索
./ollama-web-search.sh search "什么是 Ollama" 5

# 技术搜索
./ollama-web-search.sh search "LLM model scheduling" 10

# 新闻搜索
./ollama-web-search.sh search "AI news 2026" 5

# Slash 命令
/ollama-search "Ollama Web Search API" 5

抓取示例

# 抓取 Ollama 首页
./ollama-web-search.sh fetch "https://ollama.com"

# 抓取文档
./ollama-web-search.sh fetch "https://docs.ollama.com"

# Slash 命令
/ollama-fetch "https://docs.openclaw.ai"

🔧 API 端点

API端点方法
Web Searchhttps://ollama.com/api/web_searchPOST
Web Fetchhttps://ollama.com/api/web_fetchPOST

cURL 示例

# Web Search
curl -X POST "https://ollama.com/api/web_search" \
  -H "Authorization: Bearer $OLLAMA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query":"what is ollama","max_results":5}'

# Web Fetch
curl -X POST "https://ollama.com/api/web_fetch" \
  -H "Authorization: Bearer $OLLAMA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://ollama.com"}'

⚠️ 注意事项

  • API Key: 必须设置 OLLAMA_API_KEY
  • 账户: 需要免费 Ollama 账户
  • 速率限制: 参考 Ollama API 文档
  • 缓存: 结果缓存 15 分钟
  • SSRF 保护: 私有/内部 IP 地址会被阻止
  • 错误处理: 脚本会检查 API Key 和响应状态

📁 文件结构

ollama-search-tool/
├── SKILL.md              # 技能文档(含 metadata)
├── README.md             # 快速入门
└── ollama-web-search.sh  # 主脚本

🔗 相关文档

Comments

Loading comments...