Back to Home

SearXNG Wrapper

Active

Async/Sync Python Client for SearXNG

searxng-wrapper is a lightweight Python library that provides both async and sync interfaces for querying SearXNG instances. It supports configurable search parameters including language, categories, safe search, time range, and engine selection. Perfect for building privacy-respecting search features into your applications.

PythonhttpxSearXNGasyncio

Features

Async & Sync

Both asynchronous (asearch) and synchronous (search) methods for flexible integration.

Privacy-Respecting

Built on SearXNG, a metasearch engine that aggregates results without tracking users.

Configurable Engines

Enable or disable specific search engines and filter by categories, language, and time range.

Lightweight

Minimal dependencies with a clean, simple API that gets out of your way.

Documentation

Getting Started

Installation

pip install searxng-wrapper

Async Usage (Recommended)

from searxng_wrapper import SearxngWrapper

import asyncio

async def main():

client = SearxngWrapper(

base_url="https://your-searxng-instance.com",

)

result = await client.asearch(q="SearXNG")

print(result)

asyncio.run(main())

Sync Usage

from searxng_wrapper import SearxngWrapper

client = SearxngWrapper(

base_url="https://your-searxng-instance.com",

)

result = client.search(q="SearXNG")

print(result)