Skip to main content

searxng-serpapi

An external SearXNG plugin that fetches Google web and image results from SerpAPI. Useful when a SearXNG instance cannot scrape Google directly because of IP blocks or CAPTCHAs.

The plugin routes the images category to google_images and other categories to google, and forwards pagination, time range, safe search, and locale settings.

Installation

Install from PyPI into the Python environment running SearXNG:

pip install searxng-serpapi

In a Docker image:

FROM searxng/searxng:latest
RUN pip install searxng-serpapi

From a local checkout:

pip install .

To use the plugin without rebuilding a SearXNG container image, copy src/searxng_serpapi/ into a mounted directory such as /etc/searxng/searxng_serpapi/ and set PYTHONPATH=/etc/searxng. Do not place this package inside searx/engines.

Configuration

Enable the plugin under plugins: and put SerpAPI options under a top-level serpapi: block in settings.yml:

use_default_settings: true

plugins:
  searxng_serpapi.plugin.SXNGPlugin:
    active: true

serpapi:
  api_key: "YOUR_SERPAPI_KEY_HERE"
  backend: auto
  timeout: 10.0
  safe_search: true
  # language: "en"
  # country: "us"

See example-settings.yml for a full example.

Option Default Description
serpapi.api_key none SerpAPI API key.
SERPAPI_API_KEY none Environment variable fallback for the SerpAPI API key.
serpapi.backend auto auto, google, or google_images.
serpapi.timeout 10.0 Request timeout in seconds.
serpapi.safe_search true Forward SearXNG safe search to SerpAPI.
serpapi.language "" Fallback hl language code when the SearXNG query language is all or auto.
serpapi.country "" Fallback two-letter ISO gl country code when the query locale has no region.

Restart SearXNG after changing settings.yml or updating the package.

Development

uv sync --frozen
uv run ruff format --check .
uv run ruff check .
uv run pyright
uv run pytest -v

License

AGPL-3.0-or-later. See LICENSE.

Metadata

Release files for searxng-serpapi 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for searxng-serpapi 1.0.0
File Size Uploaded Provenance Actions
searxng_serpapi-1.0.0.tar.gz 55.4 kB With provenance Details for searxng_serpapi-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for searxng-serpapi 1.0.0
File Interpreter ABI Platform Actions
searxng_serpapi-1.0.0-py3-none-any.whl Python 3 none any Details for searxng_serpapi-1.0.0-py3-none-any.whl

Total release size: 82.4 kB

Release files / searxng_serpapi-1.0.0.tar.gz

Download URL searxng_serpapi-1.0.0.tar.gz
Size 55.4 kB
Tags Source
SHA-256 checksum
How to use checksums
b929d2d02d158d270804030a0819f9e4bc69aaf93e07d153acfa86890ac5f845
BLAKE2b-256 checksum
How to use checksums
e0a034ca84f083b89a7e66f710f5cce5192a11bd7106eacfe3a28982a3a92139
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.

Transparency log

Release files / searxng_serpapi-1.0.0-py3-none-any.whl

Download URL searxng_serpapi-1.0.0-py3-none-any.whl
Size 27.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f246b633fb7ed0d30bd27916c9d34e27529696c61aa1b3d8a80846cef4ccc938
BLAKE2b-256 checksum
How to use checksums
21469a51f2a37f4ca0880578937de4c22888d696c0b0639b50040ad1c013565c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.

Transparency log

Security for searxng-serpapi 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for searxng_serpapi-1.0.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page