searxng
Use when the user wants privacy-respecting web, image, news, or video search through a configured local SearXNG instance instead of external search APIs. Calls the bundled script against SEARXNG_URL, supports result limits/categories/language/time range, and can return human-read
Install
npx skills add https://github.com/KerberosClaw/kc_ai_skills/tree/main/searxng
claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install kerberosclaw-kc-ai-skills@llmmart
git clone https://github.com/KerberosClaw/kc_ai_skills.git
The skills CLI installs just this skill, for any of its supported agents. Claude Code installs the whole kerberosclaw/kc_ai_skills collection as a plugin from our marketplace. Git is the plain clone.
Skill manifest
SearXNG Search
You are a privacy-preserving search operator. You route search requests through the user's configured SearXNG instance and report results without introducing third-party API dependencies.
Search the web using your local SearXNG instance - a privacy-respecting metasearch engine.
Not For
- Do not use if
SEARXNG_URLis missing and no local/default instance is reachable. - Do not scrape authenticated pages or private user accounts.
- Do not treat search snippets as verified facts; cite uncertainty and follow sources when needed.
Commands
Web Search
uv run {baseDir}/scripts/searxng.py search "query" # Top 10 results
uv run {baseDir}/scripts/searxng.py search "query" -n 20 # Top 20 results
uv run {baseDir}/scripts/searxng.py search "query" --format json # JSON output
Category Search
uv run {baseDir}/scripts/searxng.py search "query" --category images
uv run {baseDir}/scripts/searxng.py search "query" --category news
uv run {baseDir}/scripts/searxng.py search "query" --category videos
Advanced Options
uv run {baseDir}/scripts/searxng.py search "query" --language en
uv run {baseDir}/scripts/searxng.py search "query" --time-range day
Configuration
Required: Set the SEARXNG_URL environment variable to your SearXNG instance:
export SEARXNG_URL=https://your-searxng-instance.com
Or configure in your Clawdbot config:
{
"env": {
"SEARXNG_URL": "https://your-searxng-instance.com"
}
}
Default (if not set): http://localhost:8080
Features
- Privacy-focused (uses your local instance)
- Multi-engine aggregation
- Multiple search categories
- Rich formatted output
- Fast JSON mode for programmatic use
API
Uses your local SearXNG JSON API endpoint (no authentication required by default).
Files (kc_ai_skills)
-
scripts
-
searxng-search 121 B · in bundle
-
searxng.py 6.1 KB
#!/usr/bin/env python3 # /// script # requires-python = ">=3.11" # dependencies = ["httpx", "rich"] # /// """SearXNG CLI - Privacy-respecting metasearch via your local instance.""" import argparse import os import sys import json import warnings import httpx from rich.console import Console from rich.table import Table from rich import print as rprint from urllib.parse import urlencode console = Console() SEARXNG_URL = os.getenv("SEARXNG_URL", "http://localhost:8080") VERIFY_SSL = os.getenv("VERIFY_SSL", "true").lower() not in ("false", "0", "no") if not VERIFY_SSL: warnings.filterwarnings('ignore', message='Unverified HTTPS request') def search_searxng( query: str, limit: int = 10, category: str = "general", language: str = "auto", time_range: str = None, output_format: str = "table" ) -> dict: """ Search using SearXNG instance. Args: query: Search query string limit: Number of results to return category: Search category (general, images, news, videos, etc.) language: Language code (auto, en, de, fr, etc.) time_range: Time range filter (day, week, month, year) output_format: Output format (table, json) Returns: Dict with search results """ params = { "q": query, "format": "json", "categories": category, } if language != "auto": params["language"] = language if time_range: params["time_range"] = time_range try: response = httpx.get( f"{SEARXNG_URL}/search", params=params, timeout=30, verify=VERIFY_SSL, ) response.raise_for_status() data = response.json() # Limit results if "results" in data: data["results"] = data["results"][:limit] return data except httpx.HTTPError as e: console.print(f"[red]Error connecting to SearXNG:[/red] {e}", file=sys.stderr) return {"error": str(e), "results": []} except Exception as e: console.print(f"[red]Unexpected error:[/red] {e}", file=sys.stderr) return {"error": str(e), "results": []} def display_results_table(data: dict, query: str): """Display search results in a rich table.""" results = data.get("results", []) if not results: rprint(f"[yellow]No results found for:[/yellow] {query}") return table = Table(title=f"SearXNG Search: {query}", show_lines=False) table.add_column("#", style="dim", width=3) table.add_column("Title", style="bold") table.add_column("URL", style="blue", width=50) table.add_column("Engines", style="green", width=20) for i, result in enumerate(results, 1): title = result.get("title", "No title")[:70] url = result.get("url", "")[:45] + "..." engines = ", ".join(result.get("engines", []))[:18] table.add_row( str(i), title, url, engines ) console.print(table) # Show additional info if data.get("number_of_results"): rprint(f"\n[dim]Total results available: {data['number_of_results']}[/dim]") # Show content snippets for top 3 rprint("\n[bold]Top results:[/bold]") for i, result in enumerate(results[:3], 1): title = result.get("title", "No title") url = result.get("url", "") content = result.get("content", "")[:200] rprint(f"\n[bold cyan]{i}. {title}[/bold cyan]") rprint(f" [blue]{url}[/blue]") if content: rprint(f" [dim]{content}...[/dim]") def display_results_json(data: dict): """Display results in JSON format for programmatic use.""" print(json.dumps(data, indent=2)) def main(): parser = argparse.ArgumentParser( description="SearXNG CLI - Search the web via your local SearXNG instance", formatter_class=argparse.RawDescriptionHelpFormatter, epilog=f""" Examples: %(prog)s search "python asyncio" %(prog)s search "climate change" -n 20 %(prog)s search "cute cats" --category images %(prog)s search "breaking news" --category news --time-range day %(prog)s search "rust tutorial" --format json Environment: SEARXNG_URL: SearXNG instance URL (default: {SEARXNG_URL}) VERIFY_SSL: Enable TLS certificate verification (default: true, set to false for self-signed certs) """ ) subparsers = parser.add_subparsers(dest="command", help="Commands") # Search command search_parser = subparsers.add_parser("search", help="Search the web") search_parser.add_argument("query", nargs="+", help="Search query") search_parser.add_argument( "-n", "--limit", type=int, default=10, help="Number of results (default: 10)" ) search_parser.add_argument( "-c", "--category", default="general", choices=["general", "images", "videos", "news", "map", "music", "files", "it", "science"], help="Search category (default: general)" ) search_parser.add_argument( "-l", "--language", default="auto", help="Language code (auto, en, de, fr, etc.)" ) search_parser.add_argument( "-t", "--time-range", choices=["day", "week", "month", "year"], help="Time range filter" ) search_parser.add_argument( "-f", "--format", choices=["table", "json"], default="table", help="Output format (default: table)" ) args = parser.parse_args() if not args.command: parser.print_help() return if args.command == "search": query = " ".join(args.query) data = search_searxng( query=query, limit=args.limit, category=args.category, language=args.language, time_range=args.time_range, output_format=args.format ) if args.format == "json": display_results_json(data) else: display_results_table(data, query) if __name__ == "__main__": main()
-
-
SKILL.md 2.6 KB
--- name: searxng description: "Use when the user wants privacy-respecting web, image, news, or video search through a configured local SearXNG instance instead of external search APIs. Calls the bundled script against SEARXNG_URL, supports result limits/categories/language/time range, and can return human-readable or JSON output. NOT for searches when no SearXNG instance is configured or when authenticated/private data retrieval is required." author: Avinash Venkatswamy version: 1.0.2 status: stable homepage: https://searxng.org triggers: - "search for" - "search web" - "find information" - "look up" metadata: {"clawdbot":{"emoji":"🔍","requires":{"bins":["python3"]},"config":{"env":{"SEARXNG_URL":{"description":"SearXNG instance URL","default":"http://localhost:8080","required":true}}}}} --- # SearXNG Search You are a privacy-preserving search operator. You route search requests through the user's configured SearXNG instance and report results without introducing third-party API dependencies. Search the web using your local SearXNG instance - a privacy-respecting metasearch engine. ## Not For - Do not use if `SEARXNG_URL` is missing and no local/default instance is reachable. - Do not scrape authenticated pages or private user accounts. - Do not treat search snippets as verified facts; cite uncertainty and follow sources when needed. ## Commands ### Web Search ```bash uv run {baseDir}/scripts/searxng.py search "query" # Top 10 results uv run {baseDir}/scripts/searxng.py search "query" -n 20 # Top 20 results uv run {baseDir}/scripts/searxng.py search "query" --format json # JSON output ``` ### Category Search ```bash uv run {baseDir}/scripts/searxng.py search "query" --category images uv run {baseDir}/scripts/searxng.py search "query" --category news uv run {baseDir}/scripts/searxng.py search "query" --category videos ``` ### Advanced Options ```bash uv run {baseDir}/scripts/searxng.py search "query" --language en uv run {baseDir}/scripts/searxng.py search "query" --time-range day ``` ## Configuration **Required:** Set the `SEARXNG_URL` environment variable to your SearXNG instance: ```bash export SEARXNG_URL=https://your-searxng-instance.com ``` Or configure in your Clawdbot config: ```json { "env": { "SEARXNG_URL": "https://your-searxng-instance.com" } } ``` Default (if not set): `http://localhost:8080` ## Features - Privacy-focused (uses your local instance) - Multi-engine aggregation - Multiple search categories - Rich formatted output - Fast JSON mode for programmatic use ## API Uses your local SearXNG JSON API endpoint (no authentication required by default).
Comments (0)
Sign in to join the conversation.
Reviews (0)
No reviews yet.
No comments yet.