Check API

The check command combines all available check types (spelling, grammar and style) of text in a single command.

Command name: check

API endpoint

See Overview.

Parameters

These parameters work with any cmd.

Name
Type
Required
Description

serviceid

string

Cloud only

Cloud API key. Required for Cloud requests. Not used on-premises.

format

string

No

Response format. Values: json (default), xml.

callback

string

No

JSONP wrapper function name. Use only with format=json.

short_answer

boolean

No

JSON only. When true, shortens JSON keys to reduce payload size. See boolean parameters.

See Overview for details.

Here is a list of all possible parameters and values that can be used with the check command.

Parameter
Possible values
Default value
Description

cmd

  • check

Command name for checking text for all types of writing errors.

lang

auto

A short code of a language which will be used for check.

tokens

  • Array of strings, e.g. ["This is a sentence number 1.", "This is a sentence number 2."]

A piece of text separated in tokens that will be sent for check. The text should be presented as an array of strings. Right now each string is a token which equals one sentence.

You can use either tokens or text at a time in a request.

text

  • plain text

A piece of text which will be sent for check. The text has to be in the UTF-8 encoding. Any found tags in the text will be interpreted as plain text as well.

Avoid using # and & symbols in the text.

user_dictionary

  • user dictionary name (e.g. testdict)

A user dictionary name which will be used during spell checking.

user_wordlist

  • additional wordlist

The list of additional comma-separated words which will be used for spell checking.

custom_dictionary

  • custom dictionary IDs (e.g. 100694)

For Cloud: list of all dictionaries

For self-hosted: empty list

Global custom dictionary ID(s) which can be used during spell checking.

Each new Dictionary on the creation obtains its unique Dictionary ID. Depending on the type of the version of product you are using, refer to Cloudarrow-up-right or Serverarrow-up-right guides respectively.

ignore_all_caps

  • 0 – Do not ignore all words written in capital letters (e.g. UPPERCASE).

  • 1 – Ignore all words written in capital letters.

0

Ignore capitalized words.

ignore_words_with_numbers

  • 0 – Do not ignore words that contain numbers (e.g. Number1).

  • 1 – Ignore words that contain numbers.

0

Ignore words containing numbers.

ignore_mixed_case

  • 0 – Do not ignore words with mixed case letters (e.g. MixedCase).

  • 1 – Ignore words with mixed case letters.

0

Ignore words written with mixed case letters.

ignore_domain_names

  • 0 – Do not ignore web addresses that start with either “www”, “http:” or “https:” and end with a domain name.

  • 1 – Ignore web addresses and domain names.

0

Ignore domain names, web addresses.

min_word_length

  • minimal number of letters in a word to be checked

3

The minimal number of letters in the word which will be checked for spelling. E.g. if 3 is specified, the words with 2 letters and less will be ignored.

disable_spelling

  • true

  • false

false

Disable the check text for spelling errors. See boolean parameters.

disable_grammar

  • true

  • false

false

Disable the check text for grammar and style problems. See boolean parameters.

disable_style_guide

  • true

  • false

false

Disabling style guide functionality. See boolean parameters.

auto_lang_priorities

{"en":"en_US", "es":"es_ES"}

Priority of language dialect for auto-detected language code. For example, auto-detect returns "en", then American English will be used as a language for check.

disabled_rules

  • JSON array

[]

Disabling specific grammar rules IDs.

disabled_categories

  • JSON array

[]

Disabling specific grammar rules categories.

check_kit

  • ai

  • ai_lt

  • lt_hs

  • ai_lt_hs0

  • ai_lt_hs1

Depends on service default configuration

Enable special engine combinations:

  • ai AI engine

  • lt LanguageTool

  • hs Hunspell

  • 0 and 1 — applicable to Hunspell only; 0 means without suggestions, 1 means with suggestions

Example: ai_lt_hs1 means use AI, LanguageTool, and Hunspell with suggestions for the request.

enforce_ai

  • true

  • false

false

To replace the classic algorithmic engines with an AI-powered engine. It only works along with languages which supported AI.

Response Structure

The result is an array of objects which contains matches, where matches is also an array of objects consisting of attribute-value pairs.

The table below represents the following attribute-value pairs:

Attribute

Type

Value

Description

type

string

  • spelling

  • grammar

  • style

Type of the match found.

offset

unsigned number

Start position of a match found in a sentence/text.

length

unsigned number

The length of the match.

ud

boolean

  • true

  • false

True if a misspelled word is present in a user dictionary.

url

boolean

  • true

  • false

True if match is a part of the URL/URI.

suggestions

array of strings

Suggested corrections for spelling, grammar or style problem.

rule

string

A short description of the match by rule; available only for type 'grammar'.

message

string

Description of the problem; available only for type 'grammar'.

probability

float number

between 0.0 and 1.0

Probability of the match.

Type: Spelling

Type: Grammar

Example 1.1 [GET]: Check request for American English text with all available check types (output in JSON)

Request URL (GET):

Parameters:

  • Command: check

  • Text: this sample text demonstrates the work of the Web API service.

  • Language: en_US

  • Format: json

Request response:

Example 1.2 [GET]: Check request for American English text with all available check types (output in XML)

Request URL (GET):

Parameters:

  • Command: check

  • Text: this sampl text demonstrates the work of the Web API service.

  • Language: en_US

  • Format: xml

Request response:

Example 1.3 [GET]: Check request for American English text as two tokens with all available check types (output in JSON)

Request URL (GET):

Parameters:

  • Command: check

  • Tokens: ["this sampl text.", " It demonstrate the work of the Web API service."]

  • Language: en_US

  • Format: json

Request response:

Example 1.4 [GET]: Check request for American English text as two tokens with all available check types and shortened response (output in JSON)

Request URL (GET):

Parameters:

  • Command: check

  • Tokens: ["this sampl text.", " It demonstrate the work of the Web API service."]

  • Language: en_US

  • Format: json

  • Short Answer: true

Request response:

Example 1.5 [POST]: Check request for American English text with all available check types (output in JSON)

Here we use the same request and parameters as described in example 1.1 but form it as a POST request.

Request URL (POST):

Body (Raw):

Request response:

Example 1.6 [POST]: Check request for text with the auto-detected language (output in JSON)

In this POST type request, we use “auto” as a value for language and define the priorities for the language dialects. If “en” is detected, then British English will be used during check request.

Request body (POST):

Last updated

Was this helpful?