Using Bareun from the CLI (sample client)
When you want to check Bareun quickly without writing code, the sample client and REST calls are convenient. You can call morphological analysis with a single command-line line and immediately check whether the server is up, whether your key is valid, and whether the analysis results match your expectations.
This document explains how to test Bareun quickly from the CLI.
The fastest method: a REST call
REST (HTTP/1.1) can be called with curl alone, with no extra installation, so it is the fastest way to do a first check.
curl -s -X POST https://api.bareun.ai/bareun.LanguageService/AnalyzeSyntax \
-H "api-key: koba-XXXX-..." \
-H "Content-Type: application/json" \
-d '{"document":{"content":"오늘 날씨가 참 좋네요.","language":"ko_KR"},
"encoding_type":"UTF8"}'
curl -s -X POST http://localhost:5656/bareun.LanguageService/AnalyzeSyntax \
-H "api-key: koba-XXXX-..." \
-H "Content-Type: application/json" \
-d '{"document":{"content":"오늘 날씨가 참 좋네요.","language":"ko_KR"},
"encoding_type":"UTF8"}'
Python sample client
If you install bareunpy, you can print analysis results with a short script.
# quick_check.py: analyzes one sentence and prints the morphemes and POS tags.
from bareunpy import Tagger
tagger = Tagger("koba-XXXX-...", host="api.bareun.ai", port=443)
res = tagger.tags(["바른이 잘 동작하는지 확인합니다."])
print(res.pos()) # [(form, POS), ...]
pip install bareunpy
python quick_check.py
Where to connect
| Environment | Address |
|---|---|
| Cloud | api.bareun.ai:443 (TLS, API key required) |
| Self-hosted (native) | localhost:5656 |
| Docker distribution | localhost:5656 |
Quick check sequence
graph LR
A[Check server address] --> B[Set API key]
B --> C[Call with curl or the sample client]
C --> D{Normal response?}
D -->|Yes| OK[Start integrating]
D -->|No| E[Check key, address, and encoding]
- Decide the address to call (cloud, self-hosted, or Docker).
- Prepare a
koba-API key (required for cloud calls). - Try analyzing one sentence with
curlor the sample client. - If the response is abnormal, check the key, the address, and
encoding_type.
Start testing with something light
When you first check the connection, a single curl line (REST) is the fastest.
After you confirm a normal response, you can move to a client for your language
(bareunpy, Java, JS, R) in your real code.
Frequently asked questions
Q. Can I test Bareun without writing code?
Yes. REST (HTTP/1.1) is supported, so you can call AnalyzeSyntax with a single curl line and see the result.
Call api.bareun.ai:443 for the cloud and localhost:5656 for a self-hosted installation.
Q. Which port do I call for a self-hosted installation?
The default port is 5656 for both the native installation and the Docker distribution.
The cloud uses 443 (TLS).
Q. What do I check with the sample client?
You quickly check server availability, API key validity, and whether the analysis results (morphemes and POS tags) match your expectations. We recommend moving to your real application code after you confirm everything works.
Q. What path should I use when calling Bareun with curl?
The Bareun server handles gRPC, connect-web, and HTTP+JSON on one port through connect-go,
so REST calls also use the Connect path POST /bareun.LanguageService/AnalyzeSyntax.
Send the koba- key in the api-key header and put document in the body as JSON.
Q. How do I install the Python sample client?
Install it with pip install bareunpy. Then pass the koba- key and address to Tagger, analyze one sentence, and print the morphemes and POS tags with res.pos() to quickly check that it works.