search-tools

Test Unsaved Search Tool

Changed on

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.

post/api/v1/search-tools/test

Request

  • The document declares no server URL.
  • Auth: one of:
    • API key in header Otari-Key
    • API key in header x-api-key

Request body

api_basestring nullable

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

api_keystring nullable

Provider API key. Stored encrypted; never returned.

fetch_toolstring nullable

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.

kind'search' | 'fetch'

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

namestring required

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.

optionsobject nullable

Provider-native request fields used as defaults (e.g. exa's 'type', searxng's 'engines').

providerstring required

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

querystring nullable

For a search instance: the query to run.

timeoutnumber nullable

Per-request timeout in seconds.

urlstring nullable

For a fetch instance: the page to fetch.

Example request

{
  "api_base": "http://searxng:8080",
  "name": "local",
  "provider": "searxng"
}

Response

Successful Response

charactersinteger nullable

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

errorstring nullable

When not ok, the error's tag: timeout, network, http_error, invalid_response, or the provider's own.

hitsinteger nullable

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

okboolean required

Whether the provider answered the call without an error.

Changes