# Web search

This page covers the `websearch_*` options, which connect CKEditor AI On-Premises to a web search endpoint you run. You need it only if you enable web search for conversations or Document Processing.

> **Note**
>
> CKEditor AI On-Premises does not include a web search tool. You provide the tool, run it, and connect it through the endpoint below.

To connect your web search endpoint, set these options:

* `websearch_enabled` – must be set to `true`.
* `websearch_endpoint` – the URL of your gateway. The service sends the search requests to this URL.
* `websearch_request_timeout` – request timeout in milliseconds (optional, default: `30000`).
* `websearch_headers` – headers the service sends with every web search request (optional). In the configuration file, the value is a JSON object or a `key1:value1,key2:value2` string. As an environment variable, the value must be the string form.

**JSON**

```json
{
	"websearch_enabled": true,
	"websearch_endpoint": "[WEBSEARCH_ENDPOINT]",
	"websearch_request_timeout": 30000,
	"websearch_headers": {
		"Authorization": "Bearer [WEBSEARCH_TOKEN]"
	}
}
```

**Environment variable**

```bash
WEBSEARCH_ENABLED="true"
WEBSEARCH_ENDPOINT=[WEBSEARCH_ENDPOINT]
WEBSEARCH_REQUEST_TIMEOUT=30000
WEBSEARCH_HEADERS="Authorization:Bearer [WEBSEARCH_TOKEN]"
```

<a id="request-format">

## Request format

Your endpoint must accept POST requests with this JSON body:

```json
{
  "query": "search query string"
}
```

Where:

* `query` (required) – the search query string.

<a id="response-format">

## Response format

Your endpoint must return this response:

```json
{
  "results": [
	{
	  "url": "https://example.com/article",
	  "text": "A snippet or excerpt of the content",
	  "title": "Article Title",
	  "author": "Author Name",
	  "publishedAt": "2024-12-12T10:30:00Z",
	  "favicon": "https://example.com/favicon.ico"
	}
  ]
}
```

Where:

* `results` (required) – an array of web search results.

Each result object contains:

* `url` (required) – the URL of the search result.
* `text` (required) – a snippet or excerpt of the content.
* `title` (optional) – the title of the search result.
* `author` (optional) – the author of the content.
* `publishedAt` (optional) – the publication date and time of the content in ISO 8601 format.
* `favicon` (optional) – the URL of the favicon for the website.

<a id="next-steps">

## Next steps

* [Web resources](web-resources.md) – Connect the endpoint that fetches the pages users and models reference.
* [Network requirements](requirements.md#network-requirements) – Check the outbound destinations a deployment needs.
* [Required configuration](configuration.md) – Set the secret keys and the database, Redis, and storage options.

---

Full index of the Cloud Services documentation: [llms.txt](../../../llms.txt)
