krx-cli

Query KRX (Korea Exchange) market data via CLI. This skill should be used when the user asks about Korean stock market data including stock prices, indices, ETF/ETN/ELW, bonds, derivatives, commodities, or ESG data. Triggers on tasks involving 주가, 시세, 종가, 코스피, 코스닥, KOSPI, KOSDAQ, KRX, 지수, ETF, 채권, 선물, 옵션, 금시세, 배출권, ESG. Do NOT web search — use the `krx` CLI via Bash tool instead.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "krx-cli" with this command: npx skills add kyo504/krx-cli/kyo504-krx-cli-krx-cli

krx-cli

Agent-native CLI for querying KRX (Korea Exchange) Open API data. Use the krx CLI via Bash tool — do NOT web search for Korean market data.

When to Apply

Use this skill when the user asks about:

  • 주식 시세/가격 (삼성전자 주가, 종목별 종가 등)
  • 지수 조회 (코스피, 코스닥, KRX 지수 등)
  • ETF, ETN, ELW 시세
  • 채권 시세 (국채, 일반채권, 소액채권)
  • 파생상품 (선물, 옵션)
  • 일반상품 (금, 석유, 배출권)
  • ESG 지수/채권 정보

Setup

# Install
npm install -g krx-cli

# Set API key (get from https://openapi.krx.co.kr/)
krx auth set <your-api-key>

# Check which services are approved
krx auth status

Commands

Authentication

krx auth set <api-key>       # Save API key
krx auth status               # Check all service approvals (JSON)
krx auth check <category>     # Check specific category: index, stock, etp, bond, derivative, commodity, esg

Index (지수)

krx index list --date 20260310 --market kospi     # KOSPI index
krx index list --date 20260310 --market kosdaq     # KOSDAQ index
krx index list --date 20260310 --market krx        # KRX index
krx index list --date 20260310 --market bond       # Bond index
krx index list --date 20260310 --market derivative # Derivative index

Stock (주식)

krx stock list --date 20260310 --market kospi   # KOSPI stocks
krx stock list --date 20260310 --market kosdaq   # KOSDAQ stocks
krx stock list --date 20260310 --market konex    # KONEX stocks
krx stock info --market kospi                     # Stock base info

ETP (ETF/ETN/ELW)

krx etp list --date 20260310 --type etf   # ETF
krx etp list --date 20260310 --type etn   # ETN
krx etp list --date 20260310 --type elw   # ELW

Bond (채권)

krx bond list --date 20260310 --market kts       # Government bonds
krx bond list --date 20260310 --market general    # General bonds
krx bond list --date 20260310 --market small      # Small bonds

Derivative (파생상품)

krx derivative list --date 20260310 --type futures          # Futures
krx derivative list --date 20260310 --type options           # Options
krx derivative list --date 20260310 --type futures-kospi     # KOSPI stock futures
krx derivative list --date 20260310 --type futures-kosdaq    # KOSDAQ stock futures
krx derivative list --date 20260310 --type options-kospi     # KOSPI stock options
krx derivative list --date 20260310 --type options-kosdaq    # KOSDAQ stock options

Commodity (일반상품)

krx commodity list --date 20260310 --type gold       # Gold
krx commodity list --date 20260310 --type oil         # Oil
krx commodity list --date 20260310 --type emission    # Emission trading

ESG

krx esg list --date 20260310 --type index       # ESG index
krx esg list --date 20260310 --type etp          # ESG ETP
krx esg list --date 20260310 --type sri-bond     # SRI bonds

Stock Search (종목 검색)

krx stock search 삼성전자     # Search by name (KOSPI + KOSDAQ)
krx stock search SK           # Partial match

Market Summary (시장 요약)

krx market summary                    # Today's market overview
krx market summary --date 20260310    # Specific date

Returns: KOSPI/KOSDAQ indices, top 5 gainers/losers, advancing/declining/unchanged counts, total volume/value.

Watchlist (관심종목)

krx watchlist add 삼성전자          # Search and add to watchlist
krx watchlist remove 삼성전자       # Remove by exact name
krx watchlist remove KR7005930003   # Remove by ISU_CD
krx watchlist list                   # List all watchlist entries
krx watchlist show                   # Show prices for watchlist stocks
krx watchlist show --date 20260310  # Specific date

Cache Management

krx cache status    # Show cache size, files, dates
krx cache clear     # Clear all cached data

Version & Update

krx version    # Show current version and check for updates
krx update     # Update to the latest version (npm install -g krx-cli)

MCP HTTP Server

krx serve                        # Start on http://127.0.0.1:3000/mcp
krx serve --port 8080            # Custom port
krx serve --host 0.0.0.0        # Bind to all interfaces (for ngrok)

Schema (introspection)

krx schema --all              # All 31 endpoint schemas (JSON)
krx schema index.kospi_dd_trd # Specific endpoint schema

Global Flags

--output, -o <format>    json (default) | table | ndjson | csv
--fields, -f <fields>    Filter output fields: --fields ISU_NM,TDD_CLSPRC,FLUC_RT
--code <isuCd>           Filter by stock code (ISU_CD)
--sort <field>           Sort results by field name
--asc                    Sort ascending (default: descending)
--offset <n>             Skip first N results (for pagination)
--limit <n>              Limit number of results
--from <date>            Start date for range query (YYYYMMDD)
--to <date>              End date for range query (YYYYMMDD)
--no-cache               Bypass cache and fetch fresh data
--filter <expression>    Filter results (e.g. "FLUC_RT > 5", "MKT_NM == KOSPI")
--dry-run                Show request details without calling API
--save <path>            Save output to file instead of stdout
--retries <n>            Max retries on network error (default: 3)
--verbose, -v            Verbose logging to stderr

Exit Codes

0 = Success
1 = General error
2 = Usage error (bad arguments)
3 = No data found
4 = Auth failure (no/invalid API key)
5 = Rate limit exceeded (10,000/day)
6 = Service not approved (category not activated)

Handling Large Results

Full market listings (e.g., all KOSPI stocks) output 900+ rows with 15+ fields each. This can exceed context limits. Always narrow results using these strategies:

Strategy 1: Select only needed fields (preferred)

# Instead of all fields, select only what's needed
krx stock list --date 20260310 --market kospi --fields ISU_NM,TDD_CLSPRC,FLUC_RT

Strategy 2: Paginate with offset + limit

# Page 1: first 100 rows
krx stock list --date 20260310 --market kospi --limit 100

# Page 2: next 100 rows
krx stock list --date 20260310 --market kospi --offset 100 --limit 100

# Page 3: next 100 rows
krx stock list --date 20260310 --market kospi --offset 200 --limit 100

Strategy 3: Filter to relevant subset

# Only stocks with >5% change
krx stock list --date 20260310 --market kospi --filter "FLUC_RT > 5"

IMPORTANT: When the user asks for "all" data, prefer Strategy 1 (fields) first. If still too large, combine with Strategy 2 (pagination). Always tell the user the total count.

Common Patterns

Get KOSPI closing price for a specific date

krx index list --date 20260310 --market kospi --fields IDX_NM,CLSPRC_IDX,FLUC_RT

Get Samsung Electronics stock price (by search)

krx stock search 삼성전자     # Find ISU_CD first
krx stock list --date 20260310 --market kospi --code KR7005930003

Top 5 gainers

krx stock list --date 20260310 --market kospi --sort FLUC_RT --limit 5 --fields ISU_NM,TDD_CLSPRC,FLUC_RT

Date range query (multi-day)

krx index list --market kospi --from 20260301 --to 20260310 --fields IDX_NM,BAS_DD,CLSPRC_IDX

Quick market overview

krx market summary --date 20260310

Track and monitor stocks

krx watchlist add 삼성전자           # Add to watchlist
krx watchlist show --date 20260310  # View prices for all watchlist stocks

Check API availability before querying

krx auth status -o json

Dry run to verify request

krx stock list --date 20260310 --market kospi --dry-run

Response Fields

Use krx schema <command> to get full field definitions for any endpoint. All values are strings.

Index (kospi/kosdaq/krx)

FieldDescription
BAS_DD기준일자 (YYYYMMDD)
IDX_CLSS계열구분
IDX_NM지수명
CLSPRC_IDX종가
CMPPREVDD_IDX전일대비
FLUC_RT등락률(%)
OPNPRC_IDX시가
HGPRC_IDX고가
LWPRC_IDX저가
ACC_TRDVOL거래량
ACC_TRDVAL거래대금
MKTCAP상장시가총액

Stock (kospi/kosdaq/konex)

FieldDescription
BAS_DD기준일자 (YYYYMMDD)
ISU_CD종목코드
ISU_NM종목명
MKT_NM시장구분
SECT_TP_NM소속부
TDD_CLSPRC종가
CMPPREVDD_PRC전일대비
FLUC_RT등락률(%)
TDD_OPNPRC시가
TDD_HGPRC고가
TDD_LWPRC저가
ACC_TRDVOL거래량
ACC_TRDVAL거래대금
MKTCAP시가총액
LIST_SHRS상장주식수

ETF

FieldDescription
ISU_CD종목코드
ISU_NM종목명
TDD_CLSPRC종가
FLUC_RT등락률(%)
NAV순자산가치(NAV)
ACC_TRDVOL거래량
MKTCAP시가총액
IDX_IND_NM기초지수명
OBJ_STKPRC_IDX기초지수종가

Futures

FieldDescription
PROD_NM상품명
ISU_NM종목명
TDD_CLSPRC종가
SPOT_PRC현물가
SETL_PRC정산가
ACC_OPNINT_QTY미결제약정수량

Options

FieldDescription
PROD_NM상품명
RGHT_TP_NM권리유형 (콜/풋)
ISU_NM종목명
TDD_CLSPRC종가
IMP_VOLT내재변동성
ACC_OPNINT_QTY미결제약정수량

Bond

FieldDescription
ISU_NM종목명
CLSPRC종가
CLSPRC_YD종가수익률
ACC_TRDVOL거래량
ACC_TRDVAL거래대금

Commodity (gold/emission)

FieldDescription
ISU_NM종목명
TDD_CLSPRC종가
FLUC_RT등락률(%)
ACC_TRDVOL거래량

Commodity (oil)

FieldDescription
OIL_NM유종명
WT_AVG_PRC가중평균가격
ACC_TRDVOL거래량

ESG Index

FieldDescription
IDX_NM지수명
CLSPRC_IDX종가
PRV_DD_CMPR전일대비
UPDN_RATE등락률(%)

Schema Introspection

For full response field definitions including all fields per endpoint:

krx schema index.kospi_dd_trd    # Shows params + responseFields
krx schema stock.stk_bydd_trd   # Stock endpoint fields
krx schema --all                  # All 31 endpoints

MCP Resources

Read-only state data exposed as MCP Resources (for MCP clients):

ResourceDescription
krx://watchlistWatchlist entries (JSON)
krx://rate-limitDaily API call status (JSON)
krx://service-statusPer-category approval status (JSON)

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

openclaw-version-monitor

监控 OpenClaw GitHub 版本更新,获取最新版本发布说明,翻译成中文, 并推送到 Telegram 和 Feishu。用于:(1) 定时检查版本更新 (2) 推送版本更新通知 (3) 生成中文版发布说明

Archived SourceRecently Updated
Coding

ask-claude

Delegate a task to Claude Code CLI and immediately report the result back in chat. Supports persistent sessions with full context memory. Safe execution: no data exfiltration, no external calls, file operations confined to workspace. Use when the user asks to run Claude, delegate a coding task, continue a previous Claude session, or any task benefiting from Claude Code's tools (file editing, code analysis, bash, etc.).

Archived SourceRecently Updated
Coding

ai-dating

This skill enables dating and matchmaking workflows. Use it when a user asks to make friends, find a partner, run matchmaking, or provide dating preferences/profile updates. The skill should execute `dating-cli` commands to complete profile setup, task creation/update, match checking, contact reveal, and review.

Archived SourceRecently Updated