> 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.10.0.0/api-reference/legacy-api-commands/grammar-check-api.md).

# Grammar check API

[Check API](/v6.10.0.0/api-reference/check-api.md) combines all available check types and is a replacement for older [Check spelling API](/v6.10.0.0/api-reference/legacy-api-commands/check-spelling-api.md) 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     | <ul><li>json</li><li>xml</li></ul>                                                            | json          | The response format for the output data.                                                                                                                                                                                                                                   |
| 2 | callback   | <ul><li>callback function name</li></ul>                                                      | <p><br></p>   | 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       | <ul><li>plain text</li></ul>                                                                  | <p><br></p>   | 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      | <ul><li><a href="/pages/GUZ6cksYHij4R1JW5Nhz">Supported languages</a> (e.g. en\_US)</li></ul> | en\_US        | <p>A short code of a language which will be used for grammar checking. </p><p>The grammar checking option is available for a specific list of languages marked in <a href="https://docs.webspellchecker.com/display/WSDK/Supported+languages">Supported languages</a>.</p> |
| 5 | customerid | \[your-service-id]                                                                            | <p><br></p>   | <p><br></p>                                                                                                                                                                                                                                                                |

#### Example 1: \[GET] Grammar check <a href="#grammarcheckapi-example1-get-grammarcheck" id="grammarcheckapi-example1-get-grammarcheck"></a>

Request URL (GET):&#x20;

```javascript
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:**

```javascript
[
    {
        "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 <a href="#grammarcheckapi-example2-post-grammarcheckrequest" id="grammarcheckapi-example2-post-grammarcheckrequest"></a>

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

Request URL (POST):&#x20;

```javascript
https://endpoint/?
```

Body (Raw):&#x20;

```javascript
cmd=grammar_check&
text=web API provides a gramar checking command that will help you builds a custom solution.&
slang=en_US
```

**Request response:**

```javascript
[
    {
        "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"
                ]
            }
        ]
    }
]
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.wproofreader.com/v6.10.0.0/api-reference/legacy-api-commands/grammar-check-api.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
