SearXNG Search Skill for Clawdbot
-
<h2>SearXNG Search Skill for Clawdbot</h2>
<p>Privacy-respecting web search using your local SearXNG instance.</p>
<h3>Prerequisites</h3>
<p><strong>This skill requires a running SearXNG instance.</strong></p>
<p>If you don't have SearXNG set up yet:</p>
<ol>
<li><strong>Docker (easiest)</strong>:</li>
<pre><code>
docker run -d -p 8080:8080 searxng/searxng
</code></pre>
</ol><ol>
<li><strong>Manual installation</strong>: Follow the <a href="https://docs.searxng.org/admin/installation.html">official guide</a></li>
</ol><ol>
<li><strong>Public instances</strong>: Use any public SearXNG instance (less private)</li>
</ol><h3>Features</h3>
<ul>
<li>
<strong>Privacy-focused</strong>: Uses your local SearXNG instance</li>
<li>
<strong>Multi-engine</strong>: Aggregates results from multiple search engines</li>
<li>
<strong>Multiple categories</strong>: Web, images, news, videos, and more</li>
<li>
<strong>Rich output</strong>: Beautiful table formatting with result snippets</li>
<li>
<strong>Fast JSON mode</strong>: Programmatic access for scripts and integrations</li>
</ul><h3>Quick Start</h3>
<h4>Basic Search</h4>
<pre><code>
Search "python asyncio tutorial"
</code></pre><h4>Advanced Usage</h4>
<pre><code>
Search "climate change" with 20 results
Search "cute cats" in images category
Search "breaking news" in news category from last day
</code></pre><h3>Configuration</h3>
<p><strong>You must configure your SearXNG instance URL before using this skill.</strong></p>
<h4>Set Your SearXNG Instance</h4>
<p>Configure the <code>SEARXNG_URL</code> environment variable in your Clawdbot config:</p>
<pre><code>
{
"env": {
"SEARXNG_URL": "https://your-searxng-instance.com"
}
}
</code></pre><p>Or export it in your shell:</p>
<pre><code>
export SEARXNG_URL=https://your-searxng-instance.com
</code></pre><h3>Direct CLI Usage</h3>
<p>You can also use the skill directly from the command line:</p>
<pre><code>
Basic search
uv run ~/clawd/skills/searxng/scripts/searxng.py search "query"
More results
uv run ~/clawd/skills/searxng/scripts/searxng.py search "query" -n 20
Category search
uv run ~/clawd/skills/searxng/scripts/searxng.py search "query" --category images
JSON output (for scripts)
uv run ~/clawd/skills/searxng/scripts/searxng.py search "query" --format json
Time-filtered news
uv run ~/clawd/skills/searxng/scripts/searxng.py search "latest AI news" --category news --time-range day
</code></pre><h3>Available Categories</h3>
<ul>
<li><code>general</code> - General web search (default)</li>
<li><code>images</code> - Image search</li>
<li><code>videos</code> - Video search</li>
<li><code>news</code> - News articles</li>
<li><code>map</code> - Maps and locations</li>
<li><code>music</code> - Music and audio</li>
<li><code>files</code> - File downloads</li>
<li><code>it</code> - IT and programming</li>
<li><code>science</code> - Scientific papers and resources</li>
</ul><h3>Time Ranges</h3>
<p>Filter results by recency:</p>
<ul>
<li><code>day</code> - Last 24 hours</li>
<li><code>week</code> - Last 7 days</li>
<li><code>month</code> - Last 30 days</li>
<li><code>year</code> - Last year</li>
</ul><h3>Examples</h3>
<h4>Web Search</h4>
<pre><code>
uv run ~/clawd/skills/searxng/scripts/searxng.py search "rust programming language"
</code></pre><h4>Image Search</h4>
<pre><code>
uv run ~/clawd/skills/searxng/scripts/searxng.py search "sunset photography" --category images -n 10
</code></pre><h4>Recent News</h4>
<pre><code>
uv run ~/clawd/skills/searxng/scripts/searxng.py search "tech news" --category news --time-range day
</code></pre><h4>JSON Output for Scripts</h4>
<pre><code>
uv run ~/clawd/skills/searxng/scripts/searxng.py search "python tips" --format json | jq '.results[0]'
</code></pre><h3>SSL/TLS Notes</h3>
<p>The skill is configured to work with self-signed certificates (common for local SearXNG instances). If you need strict SSL verification, edit the script and change <code>verify=False</code> to <code>verify=True</code> in the httpx request.</p>
<h3>Troubleshooting</h3>
<h4>Connection Issues</h4>
<p>If you get connection errors:</p>
<ol>
<li><strong>Check your SearXNG instance is running:</strong></li>
<pre><code>
curl -k $SEARXNG_URLOr: curl -k http://localhost:8080 (default)
</code></pre>
</ol><ol>
<li><strong>Verify the URL in your config</strong></li>
</ol><hr>
<p>哪个方案更实用?欢迎投票讨论。</p>