Use the standalone CLI installed from a GitHub Release. In the repository
checkout, replace ytm below with bun run cli --; this invokes the Rust/Clap
binary. The Node package is a private development SDK; the release pipeline
publishes only the CLI. For an in-process Node integration, import
YtmClient and the operation-specific validation helpers from @sjunepark/ytm.
ytm kinds --format json
ytm history --count 180 --end-date 2026-09-08 --format json
ytm matrix --base-date 2026-06-08 --kind 국채 --format json --pretty
ytm matrix --base-date 2026-06-07 --kind 80 --fallback previous-available --lookback-days 10 --format json
- For the latest N observation dates, use
history --count N --end-date YYYY-MM-DD, with optional inclusive--start-date. Count is 1–2000; the exact backward scan stops within 2000 calendar days. Do not combine count with a date list or previous-available fallback. A shortfall raisesinsufficient_history. - A numeric yield anywhere qualifies a date; missing cells may remain. Report
requestedDates.lengthas the selected date count and preservecountSelection.availableCountcounts date/category pairs, not dates. - Dates accept
YYYY-MM-DD,YYYY.MM.DD, orYYYYMMDD. - Kind accepts a source code or Korean label. The canonical catalog includes
80Corporate bonds (privately placed), distinct from70corporate bonds (unsecured). - Exact-date lookup is the default. Use
previous-availableonly when the caller authorizes walking backward through calendar dates. - Date fallback runs only after confirmed unavailable data. Eligible transient transport failures retry within bounded attempt and retrieval budgets; exhausted transport failures, protocol failures, and source-format failures abort retrieval rather than selecting an earlier date.
- JSON is the default agent-readable output. Execution and invalid-invocation
failures are structured JSON; inspect their recovery metadata before
retrying.
ytm help <unknown>instead prints a plain-text help error and exits with status 2. - Report requested and resolved dates, kind, tenors, and rows by applicable target bonds.
Source
-or empty yields becomenullwhile raw text remains available.
import { YtmClient, validateMatrixInput } from "@sjunepark/ytm";
const client = new YtmClient();
const validation = validateMatrixInput({
baseDate: "2026-06-08",
kind: "회사채(사모)"
});
if (!validation.ok) throw validation.error;
const result = await client.matrix(validation.input);