# ⌨️ 타자번역

## 타자번역 <a href="#undefined" id="undefined"></a>

* 출처 : <https://npmjs.com/package/inko>

### Templates

* API는 모두 GET 메서드를 사용합니다

## 영어 타자 → 한글 타자 <a href="#en2ko" id="en2ko"></a>

<mark style="color:blue;">`GET`</mark> `https://mora-bot.kr/api/v1/en2ko?text={한글 타자로 변환할 문장}`

#### Query Parameters

| Name                                   | Type   | Description   |
| -------------------------------------- | ------ | ------------- |
| text<mark style="color:red;">\*</mark> | String | 한글 타자로 변환할 문장 |

{% tabs %}
{% tab title="200: OK " %}
{% code lineNumbers="true" %}

```json
// 응답 내용
{
    "license": "inko module used https://www.npmjs.com/package/inko",
    "status": 200,
    "origin": "ahfk",
    "result": "모라",
    "success": true
}
```

{% endcode %}
{% endtab %}
{% endtabs %}

| Field  | Type   | Description |
| ------ | ------ | ----------- |
| origin | String | 호출된 문장      |
| result | String | 변환된 문장      |

### NodeJS

{% code lineNumbers="true" %}

```javascript
// node-fetch
const fetch = require('node-fetch')
fetch(`https://mora-bot.kr/api/v1/en2ko?text=${encodeURI(`택스트`)}`)
    .then(res => res.json())
    .then(json => {
        console.log(json)
        console.log(`입력된 값 : ${json.origin}`);
        console.log(`한글 타자로 : ${json.result}`);
    });

// request
let api_url = `https://mora-bot.kr/api/v1/en2ko?text=${encodeURI(`텍스트`)}`
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.origin}`);
        console.log(`한글 타자로 : ${json.result}`);
    } else {
        console.log('error = ' + response.errorcode);
    }
});
```

{% endcode %}

### Python

{% code lineNumbers="true" %}

```python
import requests

response = requests.get("http://mora-bot.kr/api/v1/en2ko?text=[텍스트]")
result = response.json()

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

{% endcode %}

## 한글 발음 → 영어 발음 <a href="#undefined" id="undefined"></a>

* GET URL : <https://mora-bot.kr/api/v1/ko2en?text={영어> 타자로 변환할 문장}

| Field  | Type   | Description |
| ------ | ------ | ----------- |
| origin | String | 호출된 문장      |
| result | String | 변환된 문장      |

{% code lineNumbers="true" %}

```json
// 응답 내용
{
    "license":"inko module used https://www.npmjs.com/package/inko",
    "status":200,
    "origin":"모라",
    "result":"ahfk",
    "success":true
}
```

{% endcode %}

### NodeJS

{% code lineNumbers="true" %}

```javascript
// node-fetch
const fetch = require('node-fetch')
fetch(`https://mora-bot.kr/api/v1/ko2en?text=${encodeURI(`텍스트`)}`)
    .then(res => res.json())
    .then(json => {
        console.log(json
        console.log(`입력된 값 : ${json.origin}`);
        console.log(`한글 타자로 : ${json.result}`);
    });

// request
let api_url = `https://mora-bot.kr/api/v1/ko2en?text=${encodeURI(`텍스트`)}`
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.origin}`);
        console.log(`한글 타자로 : ${json.result}`);
    } else {
        console.log('error = ' + response.errorcode);
    }
});
```

{% endcode %}

### Python

{% code lineNumbers="true" %}

```python
import requests

response = requests.get("https://mora-bot.kr/api/v1/ko2en?text=[텍스트]")
result = response.json()

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

{% endcode %}


---

# Agent Instructions: 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:

```
GET https://docs.mora-bot.kr/api/guide/version1/tat.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
