This repository contains a Docker setup for deploying SearxNG with JSON API support enabled.
- SearxNG metasearch engine
- JSON API format enabled (in addition to HTML)
- Docker and Docker Compose setup
- Easy to deploy and customize
The settings.yml file includes the necessary configuration to enable JSON API responses:
search:
formats:
- html
- json-
Update the secret key in
settings.yml:server: secret_key: "your_random_secret_key_here"
-
Start the service:
docker-compose up -d
-
Access SearxNG:
- Web UI: http://localhost:8080
- JSON API: http://localhost:8080/search?q=your_query&format=json
-
Build the image:
docker build -t searxng-custom . -
Run the container:
docker run -d \ -p 8080:8080 \ -v $(pwd)/settings.yml:/etc/searxng/settings.yml:ro \ -e SEARXNG_BASE_URL=http://localhost:8080 \ --name searxng \ searxng-custom
Once running, you can query the JSON API:
# Simple search
curl "http://localhost:8080/search?q=test&format=json"
# Search with category filter
curl "http://localhost:8080/search?q=test&format=json&categories=general"
# Search with language
curl "http://localhost:8080/search?q=test&format=json&language=en"Edit settings.yml to customize:
- Search engines
- UI preferences
- Security settings
- Rate limiting
- And more...
Refer to the SearxNG documentation for all available options.
- Change the secret key in
settings.ymlbefore deploying to production - The
limiteris disabled by default - enable it for production use - Image proxy is enabled for privacy
docker-compose downdocker-compose logs -f searxng