Grammar check API

Check API combines all available check types and is a replacement for older Check spelling API and Grammar checking API.

Command name: grammar_check

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

#
Parameter
Possible values
Default value
Description

1

format

  • json

  • xml

json

The response format for the output data.

2

callback

  • callback function name

A callback function name that will be used to manipulate with the JSON data received from the server. Such approach enables sharing of data bypassing same-origin policy. It can be used only along with “format=json”.

3

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 a plan text as well.

4

slang

en_US

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

The grammar checking option is available for a specific list of languages marked in Supported languagesarrow-up-right.

5

customerid

[your-service-id]

Example 1: [GET] Grammar check

Request URL (GET):

http(s)://endpoint/?cmd=grammar_check&text=web API provides a gramar checking command that will help you builds a custom solution.&slang=en_US

Parameters:

  • Command: grammar_check

  • Format: json

  • Text: web API provides a gramar checking command that will help you builds a custom solution.

  • Language: en_US

Request response:

[
    {
        "sentence": "web API provides a gramar checking command that will help you builds a custom solution",
        "matches": [
            {
                "message": "This sentence does not start with an uppercase letter",
                "offset": 0,
                "length": 3,
                "rule": {
                    "id": "UPPERCASE_SENTENCE_START"
                },
                "suggestions": [
                    "Web"
                ]
            }
        ]
    }
]

Example 2: [POST] Grammar check request

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

Request URL (POST):

Body (Raw):

Request response:

Last updated

Was this helpful?