searxng-wrapper is a simple Python wrapper for interacting with SearXNG , a privacy-focused meta search engine. This library allows you to perform searches and retrieve structured results easily, without manually handling HTTP requests.
Project description
🕵️♂️ searxng-wrapper Documentation
searxng-wrapper is a simple async/sync Python library for interacting with SearXNG, a privacy-respecting metasearch engine that supports JSON-based APIs.
📦 Installation
Install via pip:
pip install searxng-wrapper
To self-host your own SearXNG instance, you can use Docker. Alternatively, use a public instance listed at:
🚀 Usage
✅ Async (Recommended)
from searxng_wrapper import SearxngWrapper
import asyncio
async def main():
client = SearxngWrapper(
base_url="https://gatotkaca.arosyihuddin.site",
)
result = await client.asearch(
q="SearXNG"
)
print(result)
if __name__ == "__main__":
asyncio.run(main())
✅ Sync
from searxng_wrapper import SearxngWrapper
if __name__ == "__main__":
client = SearxngWrapper(
base_url="https://gatotkaca.arosyihuddin.site",
)
result = client.search(
q="SearXNG"
)
print(result)
📌 Important Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
q |
str |
- | The search query |
language |
str |
"auto" |
Result language ("auto", "en", "id", etc.) |
categories |
str |
"general" |
Search category ("general", "science", "it", etc.) |
page |
int |
1 |
Search result page |
safesearch |
str |
"off" |
Adult content filter ("off", "moderate", "strict") |
time_range |
str |
"all" |
Time range ("day", "week", "month", "year", "all") |
max_results |
int |
None |
Return only the top N results from the selected page |
enabled_engines |
List[str] |
None |
Force-enable specific search engines |
disabled_engines |
List[str] |
None |
Force-disable specific search engines |
🛑 Got a 403 Error? Here's the Fix
If you receive a 403 Forbidden error, your SearXNG instance likely does not support JSON requests by default.
✅ How to Enable JSON Support
- Open the
settings.ymlfile on your SearXNG server. The file is typically located at:
/etc/searxng/settings.yml
- Enable the JSON output format by updating the
search:section:
search:
format:
- html # default
- json # add this line to enable JSON responses
- Save the file and restart your SearXNG instance:
docker restart container_name
📌 Or simply use a public instance that already supports JSON. You can find one at: https://searx.space
🤝 Contributing
Contributions are very welcome! Feel free to fork the repository, submit pull requests for new features, bug fixes, or improvements to this documentation.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file searxng_wrapper-0.1.1.tar.gz.
File metadata
- Download URL: searxng_wrapper-0.1.1.tar.gz
- Upload date:
- Size: 7.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
67ee333cf801a36a7ff75f9415aed47043b21e27eda07c05e00914ffafd86dad
|
|
| MD5 |
e61fd3faa1a8a2eff1bb9fa3cf34f499
|
|
| BLAKE2b-256 |
d8f2d51a956db3d591b53ba7acb68d715863dfc55e8e4c4cb5af75a1a2acaccb
|
Provenance
The following attestation bundles were made for searxng_wrapper-0.1.1.tar.gz:
Publisher:
python-publish.yml on arosyihuddin/searxng-wrapper
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
searxng_wrapper-0.1.1.tar.gz -
Subject digest:
67ee333cf801a36a7ff75f9415aed47043b21e27eda07c05e00914ffafd86dad - Sigstore transparency entry: 207747849
- Sigstore integration time:
-
Permalink:
arosyihuddin/searxng-wrapper@483134cfd61cdc581b5b04a9f61036ea0ba59f13 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/arosyihuddin
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@483134cfd61cdc581b5b04a9f61036ea0ba59f13 -
Trigger Event:
release
-
Statement type:
File details
Details for the file searxng_wrapper-0.1.1-py3-none-any.whl.
File metadata
- Download URL: searxng_wrapper-0.1.1-py3-none-any.whl
- Upload date:
- Size: 8.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
edcc168a14e22e5ffbb179875904fba1f007780590fb472c831667e99fd48a1d
|
|
| MD5 |
df3bbdfc5a0e4b6bfdc75fa1166c49e8
|
|
| BLAKE2b-256 |
c5ab60e13d8d89b8f249d2c4dd2072f90642654238f5ac9e0838f16b89582be0
|
Provenance
The following attestation bundles were made for searxng_wrapper-0.1.1-py3-none-any.whl:
Publisher:
python-publish.yml on arosyihuddin/searxng-wrapper
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
searxng_wrapper-0.1.1-py3-none-any.whl -
Subject digest:
edcc168a14e22e5ffbb179875904fba1f007780590fb472c831667e99fd48a1d - Sigstore transparency entry: 207747851
- Sigstore integration time:
-
Permalink:
arosyihuddin/searxng-wrapper@483134cfd61cdc581b5b04a9f61036ea0ba59f13 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/arosyihuddin
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@483134cfd61cdc581b5b04a9f61036ea0ba59f13 -
Trigger Event:
release
-
Statement type: