SearXNG Search
Open Source: https://github.com/searxng/searxng
Public Instances: https://searx.space/
Overview
SearXNG is a free, open-source metasearch engine that aggregates results from multiple search engines while protecting user privacy. It can be self-hosted or used via public instances.
Note: SearXNG returns a fixed number of results per page (~20 by default) and does not support limiting results via the API. The max_results parameter is not directly supported by SearXNG.
LiteLLM Python SDK
import os
from litellm import search
# Set your SearXNG instance URL (REQUIRED)
os.environ["SEARXNG_API_BASE"] = "https://serxng-deployment-production.up.railway.app"
response = search(
query="latest AI developments",
search_provider="searxng",
max_results=10
)
LiteLLM AI Gateway
1. Setup config.yaml
model_list:
- model_name: gpt-6.1-sol
litellm_params:
model: gpt-6.1-sol
api_key: os.environ/OPENAI_API_KEY
search_tools:
- search_tool_name: searxng-search
litellm_params:
search_provider: searxng
api_base: https://serxng-deployment-production.up.railway.app
2. Start the proxy
litellm --config /path/to/config.yaml
# RUNNING on http://0.0.0.0:4000
3. Test the search endpoint
curl http://0.0.0.0:4000/v1/search/searxng-search \
-H "Authorization: Bearer $LITELLM_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"query": "latest AI developments",
"max_results": 10
}'
Provider-specific Parameters
import os
from litellm import search
# REQUIRED: Set your SearXNG instance URL
os.environ["SEARXNG_API_BASE"] = "https://serxng-deployment-production.up.railway.app"
response = search(
query="machine learning research",
search_provider="searxng",
max_results=10,
# SearXNG-specific parameters
categories="general,science", # Comma-separated categories
engines="google,duckduckgo,bing", # Comma-separated engines
language="en", # Language code
pageno=1, # Page number
time_range="month" # Time filter: day, month, year
)
Features
SearXNG provides powerful metasearch capabilities:
Multiple Search Engines
Aggregate results from multiple search engines simultaneously:
- Google, DuckDuckGo, Bing, Brave
- Wikipedia, Startpage
- And many more
Categories
Search within specific categories:
general- General web searchscience- Scientific articles and papersimages- Image searchnews- News articlesvideos- Video contentmusic- Music and audiofiles- File searchit- IT and technologymap- Maps and location
Time-Based Filtering
Filter results by time range:
day- Past daymonth- Past monthyear- Past year
Privacy-Focused
- No user tracking
- No cookies required
- No profiling
- No ads
Language Support
Support for 60+ languages with the language parameter.
Self-Hosting
SearXNG can be self-hosted for complete control.
Quick Deploy
Use our pre-configured deployment repository for easy setup:
Fork and Deploy: github.com/BerriAI/serxng-deployment
This repository includes:
- Docker and Docker Compose setup
- JSON API format pre-configured
- Ready to deploy