> For the complete documentation index, see [llms.txt](https://docs.wproofreader.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.wproofreader.com/v6.12.0/api-reference/overview.md).

# 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](/v6.12.0/api-reference/check-api.md)
* [Spelling autocorrect API](/v6.12.0/api-reference/spelling-autocorrect-api.md)
* [Text autocomplete API](/v6.12.0/api-reference/text-autocomplete-api.md)
* [Custom dictionary API](/v6.12.0/api-reference/custom-dictionary-api.md)
* [User custom dictionary API](/v6.12.0/api-reference/user-custom-dictionary-api.md)
* [Detect language API](/v6.12.0/api-reference/detect-language-api.md)
* [Auxiliary API commands](/v6.12.0/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](/v6.12.0/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."
}
```
