← Back to Skills Marketplace
tgparkk

KIS Trading (한국투자증권)

by tgparkk · GitHub ↗ · v1.0.0
cross-platform ⚠ suspicious
783
Downloads
0
Stars
1
Active Installs
1
Versions
Install in OpenClaw
/install kis-trading
Description
한국투자증권(KIS) Open API를 이용한 국내 주식 트레이딩. 잔고 조회, 시세 확인, 매수/매도 주문, 매매 내역, 시장 개황 등. | Korean stock trading via KIS (Korea Investment & Securities) Open API. Balance, quotes, buy/sell orders, trade history, market overview.
README (SKILL.md)

KIS 주식 트레이딩

한국투자증권 Open API를 통한 국내 주식 매매 스킬.

Korean stock trading skill using KIS (Korea Investment & Securities) Open API. Supports balance inquiry, real-time quotes, buy/sell orders, trade history, and market overview for stocks listed on KRX (KOSPI/KOSDAQ).

설정

config 파일(~/.kis-trading/config.ini)에 아래 값을 설정:

[KIS]
APP_KEY = your_app_key
APP_SECRET = your_app_secret
ACCOUNT_NO = 12345678-01
BASE_URL = https://openapi.koreainvestment.com:9443
# 모의투자: https://openapivts.koreainvestment.com:29443

설정 확인:

python3 scripts/setup.py --config ~/.kis-trading/config.ini --check

잔고 조회

"잔고 보여줘", "계좌 잔고", "예수금", "매수 가능 금액"

python3 scripts/balance.py --config ~/.kis-trading/config.ini

보유 종목

"보유 종목", "내 주식", "수익률"

python3 scripts/holdings.py --config ~/.kis-trading/config.ini

종목 시세

"삼성전자 현재가", "005930 시세", "카카오 주가"

python3 scripts/quote.py --config ~/.kis-trading/config.ini --code 005930
python3 scripts/quote.py --config ~/.kis-trading/config.ini --name 삼성전자

매수/매도 주문

"삼성전자 10주 매수", "카카오 5주 매도"

⚠️ 주문은 반드시 사용자에게 확인을 받은 후 실행할 것!

# 시장가 매수
python3 scripts/order.py --config ~/.kis-trading/config.ini --side buy --code 005930 --qty 10 --market

# 지정가 매수
python3 scripts/order.py --config ~/.kis-trading/config.ini --side buy --code 005930 --qty 10 --price 70000

# 매도
python3 scripts/order.py --config ~/.kis-trading/config.ini --side sell --code 005930 --qty 10 --market

주문 전 반드시:

  1. 종목명, 수량, 가격을 사용자에게 보여주고 확인 요청
  2. --dry-run 으로 주문 내용 미리 확인 가능
  3. 확인 후 실제 주문 실행

매매 내역

"매매 내역", "오늘 체결 내역", "주문 내역"

python3 scripts/history.py --config ~/.kis-trading/config.ini
python3 scripts/history.py --config ~/.kis-trading/config.ini --start 20240101 --end 20240131

시장 개황

"시장 개황", "거래량 상위", "코스피 지수"

python3 scripts/market.py --config ~/.kis-trading/config.ini --action index
python3 scripts/market.py --config ~/.kis-trading/config.ini --action volume-rank

주의사항

  • 실전 투자 시 반드시 BASE_URL을 실전 URL로 설정
  • 모의투자와 실전투자의 TR ID가 다를 수 있음
  • API 호출은 초당 20건 제한 (자동 제어됨)
  • 주문은 절대 사용자 확인 없이 실행하지 말 것
Usage Guidance
This skill appears to implement the KIS trading API as advertised, but review and test before using with real money. - Verify the config file format and names: the code expects [KIS] APP_KEY, APP_SECRET, ACCOUNT_NO and BASE_URL in ~/.kis-trading/config.ini. SKILL.md metadata keys (KIS_...) do not match the code and should be corrected. - Use the demo BASE_URL (openapivts...) and a mock/demo account first to confirm behavior. - Be aware credentials (APP_SECRET) are stored in a local config file and an access token is cached under ~/.kis-trading/token.json. Ensure those files have appropriate filesystem permissions and only put minimal-scoped credentials in them. - The SKILL.md asks the agent to confirm orders, but the code does not enforce interactive confirmation in non-interactive invocations. If you allow the agent to invoke skills autonomously, it could place orders programmatically. Restrict autonomous invocation or require explicit human confirmation in your agent policy before executing order commands. - If you cannot audit or host the skill yourself, consider using a trusted, reviewed integration from your broker or run these scripts locally under your direct control. If you install, first exercise only read-only endpoints (balance/quote/history) and validate all behaviors in demo mode.
Capability Analysis
Type: OpenClaw Skill Name: kis-trading Version: 1.0.0 The OpenClaw AgentSkills bundle for KIS stock trading appears benign. All Python scripts interact with the legitimate Korea Investment & Securities (KIS) Open API for its stated purpose (balance, quotes, orders, history). Sensitive API keys and tokens are handled appropriately, with the token cached locally with restricted file permissions. Crucially, the SKILL.md explicitly and repeatedly instructs the AI agent to obtain user confirmation before executing any trade orders, demonstrating a strong commitment to user safety rather than malicious prompt injection. No evidence of data exfiltration, malicious execution, persistence, or obfuscation was found.
Capability Assessment
Purpose & Capability
Name/description align with shipped Python scripts: balance, holdings, quote, market, history, order and setup. Requested binary (python3) and dependency (requests) are appropriate for the stated purpose. The implementation uses a local config (~/ .kis-trading/config.ini) rather than environment variables, which is coherent for a CLI-style trading tool.
Instruction Scope
SKILL.md and scripts limit network activity to KIS endpoints and explain required commands. However, the safety instruction to 'always confirm with the user before placing orders' is only a human-guidance comment — nothing in the code enforces an interactive confirmation when run programmatically. An automated agent with permission to run the skill could call scripts (e.g., scripts/order.py) and place real trades. Scripts also read/write files under the user's home directory (~/.kis-trading), which contain sensitive credentials and cached tokens.
Install Mechanism
There is no install spec (instruction-only skill with included scripts). SKILL.md lists pip ['requests'] as a dependency; the code uses only requests for HTTP. No external downloads, package installs from unknown URLs, or archive extraction are present. Risk from install mechanism is low.
Credentials
The skill uses a config file for APP_KEY / APP_SECRET / ACCOUNT_NO and caches an access token to ~/.kis-trading/token.json. This is proportionate to trading functionality. Two small inconsistencies: SKILL.md metadata lists config_keys named KIS_APP_KEY / KIS_APP_SECRET / KIS_ACCOUNT_NO / KIS_BASE_URL while the code expects APP_KEY / APP_SECRET / ACCOUNT_NO and reads BASE_URL from the config; registry metadata also lists no required env vars. Storing secrets in a plaintext config file and caching tokens to disk are expected here but are sensitive and worth being explicit about.
Persistence & Privilege
The skill does not request always:true and does not modify other skills. It does persist an OAuth token to ~/.kis-trading/token.json (attempting to set file mode 600). That persistence is reasonable for usability, but when combined with the skill's ability to place live orders and the platform's normal autonomous-invocation capability, it increases blast radius if the skill or agent is compromised.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install kis-trading
  3. After installation, invoke the skill by name or use /kis-trading
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
Initial release: KIS API integration for Korean stock trading
Metadata
Slug kis-trading
Version 1.0.0
License
All-time Installs 1
Active Installs 1
Total Versions 1
Frequently Asked Questions

What is KIS Trading (한국투자증권)?

한국투자증권(KIS) Open API를 이용한 국내 주식 트레이딩. 잔고 조회, 시세 확인, 매수/매도 주문, 매매 내역, 시장 개황 등. | Korean stock trading via KIS (Korea Investment & Securities) Open API. Balance, quotes, buy/sell orders, trade history, market overview. It is an AI Agent Skill for Claude Code / OpenClaw, with 783 downloads so far.

How do I install KIS Trading (한국투자증권)?

Run "/install kis-trading" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is KIS Trading (한국투자증권) free?

Yes, KIS Trading (한국투자증권) is completely free (open-source). You can download, install and use it at no cost.

Which platforms does KIS Trading (한국투자증권) support?

KIS Trading (한국투자증권) is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created KIS Trading (한국투자증권)?

It is built and maintained by tgparkk (@tgparkk); the current version is v1.0.0.

💬 Comments