# Overview

The HTTP API uses a single endpoint.

It is **not RESTful**.

You control the API using the `cmd` parameter.

### On this page

* [API endpoint](#api-endpoint)
* [Request method](#request-method)
* [`cmd` (command)](#cmd-command)
* [Common parameters](#common-parameters)
  * [`serviceid`](#serviceid)
  * [`format`](#format)
  * [`callback`](#callback)
  * [`short_answer`](#short_answer-boolean)
* [Boolean parameter values](#boolean-parameter-values)
* [Errors](#errors)

### API endpoint

{% tabs %}
{% tab title="Cloud" %}
`https://svc.webspellchecker.net/api`

Pass parameters in the query string (GET) or request body (POST).

`serviceid` is required.
{% endtab %}

{% tab title="On-premises" %}
`http(s)://<host>:<port>/<virtual_dir>/api`

Pass parameters in the query string (GET) or request body (POST).

`serviceid` is not used.
{% endtab %}
{% endtabs %}

### Request method

Use **GET** or **POST**.

There is no functional difference.

* GET: parameters go in the URL query string.
* POST: parameters go in the request body.
  * Raw `key=value&...` parameters.
  * Or a JSON payload.

### `cmd` (command)

`cmd` selects the operation to run.

Examples: `check`, `autocorrect`, `autocomplete`.

See command docs for the full parameter list per command.

* [Check API](/api-reference/check-api.md)
* [Spelling autocorrect API](/api-reference/spelling-autocorrect-api.md)
* [Text autocomplete API](/api-reference/text-autocomplete-api.md)
* [Custom dictionary API](/api-reference/custom-dictionary-api.md)
* [User custom dictionary API](/api-reference/user-custom-dictionary-api.md)
* [Detect language API](/api-reference/detect-language-api.md)
* [Auxiliary API commands](/api-reference/auxiliary-api-commands.md)

### Common parameters

These parameters can be used with any `cmd`.

At a glance:

* `serviceid`: Cloud API key
* `format`: response format (`json` or `xml`)
* `callback`: JSONP wrapper (JSON only)
* `short_answer`: shorten JSON keys (`true` or `false`)

#### `serviceid`

{% hint style="info" %}
Cloud only. Required for Cloud requests.
{% endhint %}

API key required to make requests.

#### `format`

{% hint style="info" %}
Default: `json`.
{% endhint %}

Response format.

Supported values:

* `json` (default)
* `xml`

#### `callback`

{% hint style="info" %}
Use it only with `format=json`.
{% endhint %}

Wraps the response as JSONP:

`/**/<callback_value>(<actual_response>)`

#### `serviceid`

{% hint style="info" %}
Cloud only. Required for Cloud requests.
{% endhint %}

API key required to make requests.

#### `short_answer` (boolean)

{% hint style="info" %}
JSON only. It does not affect XML output.
{% endhint %}

When `true`, shortens keys in the JSON response.

This reduces the response size.

Example (`short_answer=false`):

```json
{
  "result": [
    {
      "matches": [
        {
          "type": "spelling",
          "offset": 0,
          "length": 4,
          "message": "Spelling mistake",
          "probability": 1,
          "suggestions": [
            "hello",
            "hole",
            "help"
          ]
        }
      ]
    }
  ]
}
```

Example (`short_answer=true`):

```json
{
  "r": [
    {
      "m": [
        {
          "t": "spelling",
          "o": 0,
          "l": 4,
          "m": "Spelling mistake",
          "p": 1,
          "s": [
            "hello",
            "hole",
            "help"
          ]
        }
      ]
    }
  ]
}
```

### Boolean parameter values

When a parameter is boolean, these values are accepted.

**True** values:

* `yes`
* `y`
* `1`
* `enable`
* `on`
* `true`
* `t`

**False** values:

* `no`
* `n`
* `0`
* `disable`
* `off`
* `false`
* `f`

### Errors

See [HTTP response status codes](/api-reference/http-response-status-codes.md).

Errors across commands use the same response structure.

* `error`: always `true` for an error response
* `message`: human-readable description

Example:

```json
{
  "error": true,
  "message": "Language code not found."
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.wproofreader.com/api-reference/overview.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
