For the complete documentation index, see llms.txt. This page is also available as Markdown.

Search tools

List All Search Tools

get

List every search instance POST /api/v1/search can name, or with ?kind=fetch every fetch instance.

stored are the editable rows written through this API; config are the config-file entries, which are still honored and are reported so the operator can see the whole set, builtin_fetch first among the fetch instances. Keys are never returned, only last4.

Authorizations
Otari-KeystringRequired

Enter your API key here (sent as Otari-Key header).

Query parameters
kindstring · enumOptional

Which instances to list: 'search' (the default) or 'fetch'.

Default: searchPossible values:
Responses
200

Successful Response

application/json

Every search instance POST /api/v1/search can name, or every fetch instance, by where it came from.

get/api/v1/search-tools
GET /api/v1/search-tools HTTP/1.1
Otari-Key: YOUR_API_KEY
Accept: */*
{
  "config": [
    {
      "api_base": "text",
      "fetch_tool": "text",
      "has_api_key": true,
      "kind": "search",
      "name": "text",
      "price_per_call": 1,
      "price_source": "own",
      "provider": "text",
      "shadowed": false
    }
  ],
  "stored": [
    {
      "api_base": "text",
      "created_at": "text",
      "decryptable": true,
      "fetch_tool": "text",
      "kind": "search",
      "last4": "text",
      "name": "text",
      "options": {
        "ANY_ADDITIONAL_PROPERTY": "anything"
      },
      "price_per_call": 1,
      "price_source": "own",
      "provider": "text",
      "shadows_config": false,
      "timeout": 1,
      "updated_at": "text"
    }
  ]
}

Create Search Tool

post

Add a search or fetch instance at runtime. Storing an API key requires OTARI_SECRET_KEY.

Creating a second search instance, while the first is the in-loop default only because it is the only one, first sets web_search_default_tool to the first in the same commit, and says so in the response, so that adding an instance never turns in-loop search off. That runtime value wins over the configuration file until it is cleared.

Authorizations
Otari-KeystringRequired

Enter your API key here (sent as Otari-Key header).

Body

Create a stored search or fetch instance. api_key is write-only and requires OTARI_SECRET_KEY.

api_basestring · nullableOptional

Backend endpoint. Omit to inherit the provider's default (searxng inherits web_search_url).

api_keystring · nullableOptional

Provider API key. Stored encrypted; never returned.

fetch_toolstring · nullableOptional

For a search instance: the fetch instance that enriches its results, a configured or stored one or builtin_fetch. Omit it for the fetch default.

kindstring · enumOptional

'search' or 'fetch'. It cannot change once created.

Default: searchPossible values:
namestring · min: 1Required

Name callers pass as 'search_tool_name' or in /api/v1/search/{tool}, or that names a fetch instance. It contains no '/' or ':', is not builtin_fetch or none in any case, and is unique across search and fetch instances.

Pattern: ^[^/:]+$
providerstringRequired

Provider id. GET /api/v1/search-tools/providers lists the search providers, and with ?kind=fetch the fetch providers.

timeoutnumber · nullableOptional

Per-request timeout in seconds.

Responses
201

Successful Response

application/json

A stored instance as created, with the default setting the create also stored, if any.

api_basestring · nullableOptional
created_atstring · nullableOptional
decryptablebooleanOptionalDefault: true
fetch_toolstring · nullableOptional

A search instance's enrichment fetch instance. Null means the fetch default enriches it.

kindstring · enumOptional

Whether this is a search or a fetch instance.

Default: searchPossible values:
last4string · nullableOptional
namestringRequired
noticestring · nullableOptional

What else the create changed, for the operator to read.

pinned_web_search_default_toolstring · nullableOptional

Set when this create also stored web_search_default_tool, naming the search instance that was the in-loop default because it was the only one, so that adding a second does not turn in-loop search off. This runtime value wins over the configuration file until it is cleared.

providerstringRequired
shadows_configbooleanOptional

True when a config-file search tool of the same name exists; the stored one is in effect.

Default: false
timeoutnumber · nullableOptional
updated_atstring · nullableOptional
post/api/v1/search-tools
POST /api/v1/search-tools HTTP/1.1
Otari-Key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 70

{
  "api_base": "http://searxng:8080",
  "name": "local",
  "provider": "searxng"
}
{
  "api_base": "text",
  "created_at": "text",
  "decryptable": true,
  "fetch_tool": "text",
  "kind": "search",
  "last4": "text",
  "name": "text",
  "notice": "text",
  "options": {
    "ANY_ADDITIONAL_PROPERTY": "anything"
  },
  "pinned_web_search_default_tool": "text",
  "provider": "text",
  "shadows_config": false,
  "timeout": 1,
  "updated_at": "text"
}

List Search Providers

get

List the providers a search or fetch tool may name, for the add-tool form.

The list comes from the metadata any-search and any-fetch publish, so a provider either library adds appears with no change to the gateway. Reports per provider whether an API key is required, what endpoint a tool inherits when it declares none, and the native options a tool may set. Providers that exist only for tests are left out, and so is the fetch provider builtin, which only the implicit builtin_fetch tool uses.

What belongs to this deployment rather than to the libraries, its own tools on each provider and an endpoint a tool inherits from its settings, is shown only to a caller who operates the deployment: the tool settings reader withholds the same from anyone else.

Authorizations
Otari-KeystringRequired

Enter your API key here (sent as Otari-Key header).

Query parameters
kindstring · enumOptional

Which providers to list: search providers (the default) or fetch providers.

Default: searchPossible values:
Responses
200

Successful Response

application/json

One provider a search or fetch instance may name, for the add-tool form.

One schema for both capabilities: the fields they share, then each one's own, which are null on the other's entries.

default_api_basestring · nullableOptional

The endpoint a tool on this provider uses when it declares no api_base. Null means nothing supplies one, so an api_base is required. One that comes from the deployment's own settings, such as the web_search_url a searxng tool inherits, is shown only to a caller who operates the deployment: nothing else inherits it, an organization's key included.

doc_urlstring · nullableOptional

The provider's API documentation.

formatsstring[] · nullableOptional

Fetch: the formats the page text comes back in.

idstringRequired

Value to send as 'provider'.

instancesstring[]Optional

The names of this deployment's configured and stored tools on this provider, shown only to a caller who operates the deployment.

key_in_urlboolean · nullableOptional

Search: true when the API key travels in the request URL.

kindstring · enumRequired

Whether this is a search provider or a fetch provider.

Possible values:
max_resultsinteger · nullableOptional

Search: the most results one call can ask for.

max_urls_per_callinteger · nullableOptional

Fetch: the most pages one call can fetch.

query_in_urlboolean · nullableOptional

Search: true when the query travels in the request URL.

renders_javascriptboolean · nullableOptional

Fetch: true when the provider runs a page's JavaScript before reading it.

reports_costbooleanOptional

True when the provider's answer says what each call cost, which is then what the call is billed.

Default: false
reports_final_urlboolean · nullableOptional

Fetch: true when the provider reports where a page was found after redirects. When false it answers with the URL as asked, so a redirect it follows is not checked against the domain policy.

requires_api_basebooleanRequired

True when this provider has no endpoint of its own, so the tool must say where the backend is.

requires_api_keybooleanRequired

True when a tool on this provider must carry an API key.

tierstring · nullableOptional

The library's tier for the provider.

get/api/v1/search-tools/providers
GET /api/v1/search-tools/providers HTTP/1.1
Otari-Key: YOUR_API_KEY
Accept: */*
[
  {
    "default_api_base": "text",
    "doc_url": "text",
    "formats": [
      "text"
    ],
    "id": "text",
    "instances": [
      "text"
    ],
    "key_in_url": true,
    "kind": "search",
    "max_results": 1,
    "max_urls_per_call": 1,
    "options": [
      {
        "cost_tier": false,
        "default": null,
        "description": "",
        "enum": [
          "text"
        ],
        "name": "text",
        "operator_only": false,
        "type": "string"
      }
    ],
    "query_in_url": true,
    "renders_javascript": true,
    "reports_cost": false,
    "reports_final_url": true,
    "requires_api_base": true,
    "requires_api_key": true,
    "tier": "text"
  }
]

Reencrypt Stored Search Tool Keys

post

Re-encrypt stored search-tool keys with the primary OTARI_SECRET_KEY.

The search-tool half of the OTARI_SECRET_KEY rotation procedure; run it alongside POST /api/v1/hosted-providers/reencrypt. Rows that cannot be decrypted are left untouched and must be recovered by replacing the affected tool's key.

Authorizations
Otari-KeystringRequired

Enter your API key here (sent as Otari-Key header).

Responses
200

Successful Response

application/json

Result of re-encrypting stored search-tool keys with the primary secret key.

reencryptedintegerRequired

Number of stored search-tool keys re-encrypted.

skippedintegerOptional

Number of rows whose stored key changed between the read and the write, so the re-encryption was not applied. They already hold whoever wrote them last.

Default: 0
unreadableintegerRequired

Number of encrypted keys left untouched because they could not be decrypted.

post/api/v1/search-tools/reencrypt
POST /api/v1/search-tools/reencrypt HTTP/1.1
Otari-Key: YOUR_API_KEY
Accept: */*
200

Successful Response

{
  "reencrypted": 1,
  "skipped": 0,
  "unreadable": 1
}

Test Unsaved Search Tool

post

Test an instance before saving it, with one search or one fetch.

Takes the create request's fields, held to the create's checks against the instances this worker has loaded, plus query for a search instance or url for a fetch instance. Answers whether the provider answered without an error, the error's tag when it did not, and how many hits or characters came back, never the results or the page.

Authorizations
Otari-KeystringRequired

Enter your API key here (sent as Otari-Key header).

Body

An unsaved search or fetch instance to test, and what to test it with.

api_basestring · nullableOptional

Backend endpoint. Omit to inherit the provider's default (searxng inherits web_search_url).

api_keystring · nullableOptional

Provider API key. Stored encrypted; never returned.

fetch_toolstring · nullableOptional

For a search instance: the fetch instance that enriches its results, a configured or stored one or builtin_fetch. Omit it for the fetch default.

kindstring · enumOptional

'search' or 'fetch'. It cannot change once created.

Default: searchPossible values:
namestring · min: 1Required

Name callers pass as 'search_tool_name' or in /api/v1/search/{tool}, or that names a fetch instance. It contains no '/' or ':', is not builtin_fetch or none in any case, and is unique across search and fetch instances.

Pattern: ^[^/:]+$
providerstringRequired

Provider id. GET /api/v1/search-tools/providers lists the search providers, and with ?kind=fetch the fetch providers.

querystring · min: 1 · nullableOptional

For a search instance: the query to run.

timeoutnumber · nullableOptional

Per-request timeout in seconds.

urlstring · min: 1 · nullableOptional

For a fetch instance: the page to fetch.

Responses
200

Successful Response

application/json

How one search or one fetch went. Never the results or the page.

charactersinteger · nullableOptional

For a fetch that worked: how many characters of page text came back.

errorstring · nullableOptional

When not ok, the error's tag: timeout, network, http_error, invalid_response, unexpected_response (an answer whose shape the provider changed), or the provider's own.

hitsinteger · nullableOptional

For a search that worked: how many hits came back.

okbooleanRequired

Whether the provider answered the call without an error.

post/api/v1/search-tools/test
POST /api/v1/search-tools/test HTTP/1.1
Otari-Key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 70

{
  "api_base": "http://searxng:8080",
  "name": "local",
  "provider": "searxng"
}
{
  "characters": 1,
  "error": "text",
  "hits": 1,
  "ok": true
}

Update Search Tool

patch

Update a stored search or fetch instance. Omitted fields are left as-is; an explicit null clears them.

api_key follows the same rule: omit it to keep the stored key, send a new one to rotate, or send null to clear it (a keyless SearXNG backend). The row is locked FOR UPDATE so the expected_updated_at check and the write it guards are atomic. The tool as it will be after the update is validated, so a change that would leave it unusable (clearing the key of a provider that needs one) is refused rather than stored. Its options are checked against the provider's when the update sets them or changes the provider, and fetch_tool when the update sets it, so rotating the key of an instance stored before those rules never trips on them. kind cannot change, so an instance never moves between the search and fetch maps.

Authorizations
Otari-KeystringRequired

Enter your API key here (sent as Otari-Key header).

Path parameters
namestringRequired
Body

Update a stored search or fetch instance. Omitted fields are unchanged; api_key rotates in place.

api_basestring · nullableOptional
api_keystring · nullableOptional

New API key. Omit to keep the existing one. Never returned.

expected_updated_atstring · nullableOptional

Optimistic concurrency: if set, the update 412s unless it matches the stored updated_at.

fetch_toolstring · nullableOptional

For a search instance: the fetch instance that enriches its results. Null clears it.

kindstring · enum · nullableOptional

Accepted only when it matches the stored kind, which cannot change.

Possible values:
providerstring · nullableOptional
timeoutnumber · nullableOptional
Responses
200

Successful Response

application/json

A runtime-stored search or fetch instance. The API key is never returned, only last4.

api_basestring · nullableOptional
created_atstring · nullableOptional
decryptablebooleanOptionalDefault: true
fetch_toolstring · nullableOptional

A search instance's enrichment fetch instance. Null means the fetch default enriches it.

kindstring · enumOptional

Whether this is a search or a fetch instance.

Default: searchPossible values:
last4string · nullableOptional
namestringRequired
providerstringRequired
shadows_configbooleanOptional

True when a config-file search tool of the same name exists; the stored one is in effect.

Default: false
timeoutnumber · nullableOptional
updated_atstring · nullableOptional
patch/api/v1/search-tools/{name}
PATCH /api/v1/search-tools/{name} HTTP/1.1
Otari-Key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 180

{
  "api_base": "text",
  "api_key": "text",
  "expected_updated_at": "text",
  "fetch_tool": "text",
  "kind": "search",
  "options": {
    "ANY_ADDITIONAL_PROPERTY": "anything"
  },
  "provider": "text",
  "timeout": 1
}
{
  "api_base": "text",
  "created_at": "text",
  "decryptable": true,
  "fetch_tool": "text",
  "kind": "search",
  "last4": "text",
  "name": "text",
  "options": {
    "ANY_ADDITIONAL_PROPERTY": "anything"
  },
  "provider": "text",
  "shadows_config": false,
  "timeout": 1,
  "updated_at": "text"
}

Delete Stored Search Tool

delete

Delete a stored search or fetch instance. A config-file one, or builtin_fetch, cannot be deleted here.

Authorizations
Otari-KeystringRequired

Enter your API key here (sent as Otari-Key header).

Path parameters
namestringRequired
Responses
204

Successful Response

No content

delete/api/v1/search-tools/{name}
DELETE /api/v1/search-tools/{name} HTTP/1.1
Otari-Key: YOUR_API_KEY
Accept: */*

No content

Test Search Tool

post

Test a configured or stored instance with one search or one fetch.

Takes query for a search instance or url for a fetch instance, and answers as POST /search-tools/test does. builtin_fetch, the built-in fetcher, fetches as a fetch tool call does, with no domain policy.

Authorizations
Otari-KeystringRequired

Enter your API key here (sent as Otari-Key header).

Path parameters
namestringRequired
Body

What to test a configured or stored instance with.

querystring · min: 1 · nullableOptional

For a search instance: the query to run.

urlstring · min: 1 · nullableOptional

For a fetch instance: the page to fetch.

Responses
200

Successful Response

application/json

How one search or one fetch went. Never the results or the page.

charactersinteger · nullableOptional

For a fetch that worked: how many characters of page text came back.

errorstring · nullableOptional

When not ok, the error's tag: timeout, network, http_error, invalid_response, unexpected_response (an answer whose shape the provider changed), or the provider's own.

hitsinteger · nullableOptional

For a search that worked: how many hits came back.

okbooleanRequired

Whether the provider answered the call without an error.

post/api/v1/search-tools/{name}/test
POST /api/v1/search-tools/{name}/test HTTP/1.1
Otari-Key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 29

{
  "query": "text",
  "url": "text"
}
{
  "characters": 1,
  "error": "text",
  "hits": 1,
  "ok": true
}

Last updated

Was this helpful?