π¦ ClawHub
KRX Stock CLI
by @chloepark85
Korean Exchange (KRX) stock market data CLI. Fetch daily OHLCV, latest-close snapshots, market-cap rankings, index histories (KOSPI/KOSDAQ/KOSPI200/KRX100),...
β‘ When to Use
π‘ Examples
All commands are sub-commands of scripts/krx.py. JSON by default; pass --csv for CSV to stdout.
Dates accept either YYYYMMDD or YYYY-MM-DD.
Ticker lookup
python scripts/krx.py ticker 005930 # β μΌμ±μ μ
python scripts/krx.py ticker "SKνμ΄λμ€" # β 000660
python scripts/krx.py search μΉ΄μΉ΄μ€ --top 5 # substring search
OHLCV
python scripts/krx.py ohlcv 005930 --days 30
python scripts/krx.py ohlcv 005930 --start 20260101 --end 20260420 --csv
Latest-close snapshot
python scripts/krx.py snapshot 005930
Market-cap ranking
python scripts/krx.py marketcap --market KRX --top 50
python scripts/krx.py marketcap --market KOSDAQ --top 20 --csv
--market accepts KRX, KOSPI, KOSDAQ, KONEX, ETF/KR.
List all tickers in a market
python scripts/krx.py list --market KOSPI --top 100
Index
python scripts/krx.py index KS11 --days 90 # KOSPI
python scripts/krx.py index KS200 --days 30 # KOSPI 200
python scripts/krx.py index IXIC --days 30 # NASDAQ Composite
python scripts/krx.py index-list # common codes
Common codes: KS11 KOSPI Β· KQ11 KOSDAQ Β· KS200 KOSPI 200 Β· KRX100 KRX 100 Β· DJI Dow Β· IXIC Nasdaq Β· US500 S&P 500 Β· N225 Nikkei 225 Β· SSEC Shanghai.
TERMINAL
clawhub install krx-stock-cli