repobenchmarks // search privacy
AI TOOLS
$ curl 'http://localhost:8080/search?q=open-source&format=json'

SearXNG Metasearch Engine

Private metasearch engine aggregating 70+ search engines with zero logging, tracking, or profiling. Includes native JSON API for AI agents.

Engines: Google, Bing, DDG, Brave API: JSON Endpoints Tracking: Zero Profiling
AI Agent LangChain JSON Query SearXNG Anonymizer Metasearch Web Google Brave

Autonomous AI agents and local LLM workflows often need up-to-date web information to answer current questions. However, subscribing to proprietary commercial search APIs like Google Custom Search or Bing Web Search quickly racks up expensive per-query API bills. SearXNG is a free, privacy-respecting metasearch engine that aggregates queries across over 70 search engines, strips tracking identifiers, and exposes a clean, unthrottled JSON API for your applications.

SearXNG Metasearch Aggregation Architecture Diagram showing anonymous query fan-out across multiple search providers and aggregated JSON response generation. Client / AI Agent GET /search?format=json Zero User Cookies SearXNG Engine IP & Header Stripping Proxy Parallel Asynchronous Query Dispatch Deduplication & Score Merging Google Search API Brave Search API DuckDuckGo / Bing
Figure 1: Parallel metasearch fan-out architecture isolating client identities from public search engines.

Enabling JSON API for Local AI Tools

By default, public SearXNG instances disable JSON output to prevent scraping abuse. In your private self-hosted deployment, you can enable JSON responses in settings.yml:

search:
  formats:
    - html
    - json

SearXNG vs Commercial Search APIs

Feature SearXNG (Self-Hosted) Google Custom Search API Tavily AI Search
Cost Profile 100% Free (VPS compute only) $5 per 1,000 queries $0.005 per query after free tier
Privacy / Tracking Zero logs, headers anonymized Tracked and monetized Hosted commercial API
Multi-Engine Blend 70+ engines aggregated Google index only Aggregated & LLM optimized

Docker Compose Deployment

docker-compose.yml
services:
  searxng:
    image: searxng/searxng:latest
    container_name: searxng
    restart: unless-stopped
    ports:
      - "8080:8080"
    volumes:
      - ./searxng:/etc/searxng:rw
    environment:
      - SEARXNG_BASE_URL=https://search.yourdomain.com/
    cap_drop:
      - ALL
    cap_add:
      - CHOWN
      - SETGID
      - SETUID
⚠ Avoiding Search Engine Rate Limits and Captchas
  • VPS IP Reputation: Upstream engines like Google frequently block datacenter IP ranges (AWS, DigitalOcean, Hetzner). Configure SearXNG to prioritize engines that do not aggressively block VPS addresses, such as DuckDuckGo, Brave, and Wikipedia.
  • Enable Redis Cache: Deploy Redis alongside SearXNG to cache popular query results, drastically reducing outgoing upstream HTTP requests.

Conclusion

SearXNG gives developers a completely independent, private search infrastructure. Whether serving as your daily browser search or powering local AI agent RAG retrieval, it delivers unmatched autonomy.

// Primary Sources & Documentation
Editorial Note: Configuration parameters reflect verified official SearXNG specifications.