﻿# SearXNG JSON output depends on instance configuration

Check whether a SearXNG instance enables JSON before building a consumer, and distinguish disabled formats from unavailable engines or empty search results.

Author: Retrivium editorial team
Updated: 2026-11-03
Canonical URL: https://retrivium.ai/journal/guide-searxng-json-format-config/
Language: en

## Confirm the instance capability

A research client can open a SearXNG search page successfully and still fail when requesting machine-readable output. HTML availability does not establish JSON availability. Treat the chosen instance as a configured service with its own capabilities, rather than assuming every deployment exposes the full software feature set in the same way.

## Use the documented request form

The [Search API](https://docs.searxng.org/dev/search_api.html) supports GET parameters and form-encoded POST requests. Set `format` deliberately when requesting JSON. Do not send an arbitrary JSON request body merely because the response is expected to be JSON. Request encoding and response representation are separate parts of the caller's contract.

## Interpret disabled formats correctly

The API guide says an output format not enabled by the instance returns a forbidden response. [Search settings](https://docs.searxng.org/admin/settings/settings_search.html) controls the allowed formats. This is not an empty search result and does not show that the query found no documents. Preserve the response status before attempting to parse the expected payload.

If the application owns the instance, its documented configuration can explain the capability. If it uses another operator's instance, follow the operator's published access policy. Do not treat repeated failure as a reason to circumvent that configuration or automatically move the user's queries among unknown hosts.

## Separate engine availability

[Engine settings](https://docs.searxng.org/admin/settings/settings_engines.html) has another configuration layer: an engine can be disabled, inactive, or require a key. These states affect retrieval candidates after the representation question is resolved. Keep a capability record for output format and a separate record for the selected retrieval configuration, so a client can explain which stage failed.

## Validate the boundary with stored cases

Test a valid JSON search, a disabled-format response, and a successful representation containing no matching results. Ensure the application reports three distinct outcomes. A parser should not convert an HTML error page into a successful empty list simply because it cannot find the expected result field.

The existing guides to [response contracts](/journal/learn-openrouter-response-contract/) and [contract migration](/journal/provider-api-contract-deprecation-migration/) help organize that boundary. Store instance identity and checked capability with the integration record; a later operator configuration change should be diagnosable without inventing a change in search relevance.
