> For the complete documentation index, see [llms.txt](https://docs.mora-bot.kr/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mora-bot.kr/api/guide/version1/spellingtest.md).

# 맞춤법검사

### Templates

* API는 모두 GET 메서드를 사용합니다
* GET URL : <https://mora-bot.kr/api/v1/grammar?string={검사할> 문장}

| Field       | Type   | Description  |
| ----------- | ------ | ------------ |
| original    | String | 호출된 문장       |
| wrong       | String | 호출된 문장의 틀린부분 |
| suggestions | String | 호출된 문장의 추천문장 |
| more        | String | 호출된 문장의 해설   |

{% code lineNumbers="true" %}

```json
// 응답 내용
{
    "message":"there is nothing wrong",
    "license":"hanspell module used https://www.npmjs.com/package/hanspell",
    "status":200,
    "original":"안녕하세요",
    "errnum":0,
    "success":true
}
```

{% endcode %}

### NodeJS

{% code lineNumbers="true" %}

```javascript
// node-fetch
let text = '검사할 문장'
const fetch = require('node-fetch')
fetch(`https://mora-bot.kr/api/v1/grammar?string=${encodeURI(text)}`)
    .then(res => res.json())
    .then(json => {
        console.log(`라이선스 : ${json.license}`)
        console.log(`원래 문장 : ${json.original}`)
        console.log(`틀린 부분 : ${json.wrong}`)
        console.log(`추천 : ${json.suggestions}`)
        console.log(`해설 : ${json.more}`)
    });

// request
let text = '검사할 문장'
let api_url = `https://mora-bot.kr/api/v1/grammar?string=${encodeURI(text)}`
const request = require('request');
let options = {
    url: api_url
}
request.get(options, function (error, response, body) {
    if (!error && response.status == 200) {
        let json = JSON.parse(body)
        console.log(`라이선스 : ${json.license}`)
        console.log(`원래 문장 : ${json.original}`)
        console.log(`틀린 부분 : ${json.wrong || 0}`)
        console.log(`추천 : ${json.suggestions || '틀린 부분 없음'}`)
        console.log(`해설 : ${json.more || '틀린 부분 없음'}`)
    } else {
        console.log('error = ' + response.errorcode);
    }
});
```

{% endcode %}

### Python

{% code lineNumbers="true" %}

```python
import requests

response = requests.get("https:/mora-bot.kr/api/v1/grammar?string=검사할문장")
result = response.json()

if response.status == 200:
  print(result)
else:
  print(f"Error Code: {response.errorcode}")
```

{% endcode %}


---

# 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.mora-bot.kr/api/guide/version1/spellingtest.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.
