← 返回
未分类 中文

Web Search via SearXNG

Search the web using SearXNG meta-search engine. Use when the user wants to search the web, find current information, look up facts, news, or any query that...
Search the web using SearXNG meta-search engine. Use when the user wants to search the web, find current information, look up facts, news, or any query that...
simoncatbot
未分类 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 381
下载
💾 0
安装
1
版本
#latest

概述

SearXNG Search

Web search integration using SearXNG meta-search engine. SearXNG aggregates results from multiple search engines (Google, Bing, DuckDuckGo, etc.) without tracking or ads.

Quick Start

# Search
python scripts/search.py "quantum computing latest research"

# With specific engine
python scripts/search.py "weather in Tokyo" --engines duckduckgo

# News search
python scripts/search.py "AI breakthroughs 2024" --category news

How It Works

User Query
    ↓
Format Search Parameters
    ↓
Call SearXNG API
    ↓
Aggregate Results
    ↓
Return Formatted Results

Configuration

Edit config/searxng.yaml:

# SearXNG instance URL
# Use public instance or your own
base_url: "https://searx.be"  # or your local instance

# Default search settings
defaults:
  language: "en-US"
  safesearch: 0  # 0 = off, 1 = moderate, 2 = strict
  time_range: ""  # day, week, month, year
  results_per_page: 10

# Preferred engines (optional)
engines:
  - google
  - duckduckgo
  - bing
  - brave
  - wikipedia

# Categories
categories:
  general: "general"
  news: "news"
  images: "images"
  videos: "videos"
  files: "files"

File Structure

searxng/
├── SKILL.md                          # This file
├── requirements.txt                    # Dependencies
│
├── config/
│   └── searxng.yaml                  # Configuration
│
└── scripts/
    └── search.py                     # Search functionality

Usage

CLI

# Basic search
python scripts/search.py "python async tutorial"

# Limit results
python scripts/search.py "machine learning" --limit 5

# Specific category
python scripts/search.py "breaking news" --category news

# Time range
python scripts/search.py "tech announcements" --time week

# Specific engines
python scripts/search.py "wikipedia python" --engines wikipedia

# JSON output
python scripts/search.py "docker tutorial" --json

Python API

from searxng import SearXNGClient

# Initialize
client = SearXNGClient()

# Search
results = client.search("quantum computing")

# Access results
for result in results["results"]:
    print(f"{result['title']}: {result['url']}")

# Search with options
results = client.search(
    query="AI safety",
    category="news",
    time_range="month",
    limit=5
)

Search Categories

CategoryUse For
-------------------
generalStandard web search
newsNews articles
imagesImage search
videosVideo search
filesFile search (PDFs, etc.)
scienceScientific papers
social mediaSocial platforms

Features

Multiple Engine Aggregation

Results from 70+ search engines including:

  • Google, Bing, DuckDuckGo
  • Wikipedia, Wikidata
  • GitHub, Stack Overflow
  • News sources (BBC, Reuters, etc.)
  • Academic (arXiv, PubMed)

Privacy

  • No tracking
  • No ads
  • Self-hostable
  • Open source

Rate Limiting

Built-in rate limiting to respect SearXNG instances:

# Automatic delay between requests
client = SearXNGClient(rate_limit=1.0)  # 1 second between calls

Response Format

{
  "query": "quantum computing",
  "number_of_results": 10,
  "results": [
    {
      "title": "Quantum Computing - Wikipedia",
      "url": "https://en.wikipedia.org/wiki/Quantum_computing",
      "content": "Quantum computing is a type of computation...",
      "engine": "wikipedia",
      "score": 1.0
    }
  ],
  "suggestions": ["quantum computing explained", "quantum computing applications"],
  "infobox": {}  // Knowledge panel if available
}

Testing

# Run search tests
python tests/test_search.py

Troubleshooting

"Connection refused"

# Check if SearXNG instance is reachable
curl https://your-searx-instance/healthz

"No results"

  • Try different engines: --engines google,duckduckgo
  • Check category: --category general
  • Verify instance isn't rate-limiting you

"Rate limited"

  • Add delay between requests
  • Use different SearXNG instance
  • Self-host your own instance

Self-Hosting

Deploy your own SearXNG:

# Docker
docker run -d --name searxng -p 8080:8080 \
  -v searxng-config:/etc/searxng \
  searxng/searxng:latest

# Then update config/searxng.yaml
base_url: "http://localhost:8080"

Public Instances

Popular public SearXNG instances:

  • https://searx.be
  • https://search.sapti.me
  • https://searx.tiekoetter.com
  • https://search.bus-hit.me

> Note: Public instances may have rate limits. For heavy use, self-host.

Requirements

  • Python 3.8+
  • requests library
  • SearXNG instance (public or self-hosted)

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-05-07 10:57 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

Caid Multi Agent

simoncatbot
协调多个子代理协同完成长期软件工程任务,采用CAID(集中式异步隔离委托)...
★ 0 📥 380

Smart Router for Ollama

simoncatbot
Intelligent task routing between local and cloud Ollama LLM instances. Use when the user wants cost-efficient AI respons
★ 0 📥 364

Multi-Agent Debate

simoncatbot
通过结构化的多智能体辩论验证事实、降低幻觉并探索多种观点。多个智能体独立回答相同的查询。
★ 0 📥 380