-
Notifications
You must be signed in to change notification settings - Fork 1
Account Commands
kiwoom account 그룹은 계좌 잔고, 예수금, 수익률, 주문/체결 내역 등 계좌 관련 정보를 조회합니다.
모든 계좌 조회에는 유효한 토큰이 필요합니다. 토큰이 없거나 만료되면 exit code 3이 반환됩니다.
v2.0+:
balance / deposit / pnl / orders / history는 기본적으로 국내+미국 통합으로 표시됩니다.--market kr|us로 필터링할 수 있습니다. 미국주식 참고.
kiwoom account list
# 계좌번호: 1234567API: ka00001
잔고, 보유종목, 손익을 한눈에 보여주는 핵심 명령어입니다.
kiwoom account balance
kiwoom account balance --exchange NXT # NXT 거래소
kiwoom account balance --delist 1 # 상장폐지 종목 제외API: kt00004
balance 명령어는 서버에서 반환하는 데이터 외에 클라이언트 측에서 평가손익을 추가로 계산합니다:
평가손익 = 유가잔고평가액 - 총매입금액평가손익율 = 평가손익 / 총매입금액 * 100
이 계산은 formatters.py의 _calc_eval_pl() 함수에서 수행됩니다.
| 옵션 | 설명 | 값 |
|---|---|---|
--exchange |
거래소 구분 |
KRX (기본), NXT
|
--delist |
상장폐지 조회 |
0 (전체), 1 (제외) |
kiwoom account deposit # 추정조회 (기본)
kiwoom account deposit --type normal # 일반조회API: kt00001 | 옵션: --type (estimate/normal)
kiwoom account asset
kiwoom account asset --delist 1 # 상장폐지 제외API: kt00003
kiwoom account todayAPI: kt00017
kiwoom account margin-detailAPI: kt00013
kiwoom account returns summary
kiwoom account returns summary --exchange 1 # KRX만
kiwoom account returns summary --exchange 2 # NXT만API: ka10085 | 옵션: --exchange (0=통합, 1=KRX, 2=NXT)
kiwoom account returns daily-balance
kiwoom account returns daily-balance --date 20260301API: ka01690 | 옵션: --date (YYYYMMDD, 기본=오늘)
kiwoom account returns daily-detail --from 20260301 --to 20260331API: kt00016 | 옵션: --from (필수), --to (필수)
kiwoom account returns daily-asset --from 20260301 --to 20260331API: kt00002 | 옵션: --from (필수), --to (필수)
종목코드가 필수입니다.
kiwoom account pnl today 005930API: ka10077
kiwoom account pnl by-date --from 20260301
kiwoom account pnl by-date --from 20260301 --code 005930 # 특정 종목API: ka10072 | 옵션: --from (필수), --code (선택)
kiwoom account pnl by-period --from 20260301 --to 20260331
kiwoom account pnl by-period --from 20260301 --to 20260331 --code 005930API: ka10073 | 옵션: --from (필수), --to (필수), --code (선택)
kiwoom account pnl daily --from 20260301 --to 20260331API: ka10074 | 옵션: --from (필수), --to (필수)
현재 미체결 상태인 주문을 조회합니다.
kiwoom account orders pending
kiwoom account orders pending --trade 1 # 매도만
kiwoom account orders pending --trade 2 # 매수만
kiwoom account orders pending --code 005930 # 특정 종목
kiwoom account orders pending --exchange 1 # KRX만API: ka10075
| 옵션 | 설명 | 값 |
|---|---|---|
--all-stocks |
전체종목구분 |
0 (전체), 1 (종목) |
--trade |
매매구분 |
0 (전체), 1 (매도), 2 (매수) |
--code |
종목코드 | 선택 |
--exchange |
거래소구분 |
0 (통합), 1 (KRX), 2 (NXT) |
kiwoom account orders executed
kiwoom account orders executed --code 005930
kiwoom account orders executed --side 1 # 매도 체결만
kiwoom account orders executed --order-no 0000139 # 특정 주문번호API: ka10076
kiwoom account orders detail
kiwoom account orders detail --date 20260301
kiwoom account orders detail --qry-type 3 # 미체결만
kiwoom account orders detail --qry-type 4 # 체결 내역만
kiwoom account orders detail --side 1 --exchange KRXAPI: kt00007
| 옵션 | 설명 | 값 |
|---|---|---|
--date |
주문일자 | YYYYMMDD (기본=당일) |
--qry-type |
조회구분 |
1 (주문순), 2 (역순), 3 (미체결), 4 (체결) |
--asset |
주식채권구분 |
0 (전체), 1 (주식), 2 (채권) |
--side |
매도수구분 |
0 (전체), 1 (매도), 2 (매수) |
--code |
종목코드 | 선택 |
--from-order |
시작주문번호 | 선택 |
--exchange |
거래소구분 |
% (전체), KRX, NXT, SOR
|
kiwoom account orders status
kiwoom account orders status --date 20260301 --market 1 # 코스피만API: kt00009
kiwoom account orders split-detail 0000139API: ka10088
kiwoom account holdings eval
kiwoom account holdings eval --qry-type 2 # 개별 표시
kiwoom account holdings eval --exchange NXTAPI: kt00018 | 옵션: --qry-type (1=합산, 2=개별), --exchange (KRX/NXT)
kiwoom account holdings settled
kiwoom account holdings settled --exchange NXTAPI: kt00005
kiwoom account holdings next-settleAPI: kt00008
kiwoom account orderable amount 005930 --side buy --price 70000
kiwoom account orderable amount 005930 --side sell --price 70000API: kt00010 | 옵션: --side (buy/sell, 필수), --price (필수)
kiwoom account orderable margin-qty 005930
kiwoom account orderable margin-qty 005930 --price 70000API: kt00011
kiwoom account orderable credit-qty 005930
kiwoom account orderable credit-qty 005930 --price 70000API: kt00012
미국주식 거래를 위한 원화↔달러 환전입니다.
kiwoom account exchange rateAPI: ust31301
kiwoom account exchange estimate 1000000API: ust31300
kiwoom account exchange apply 1000000 --confirm주문과 동일하게 미리보기 + 확인 게이트를 거칩니다. API: ust31302
kiwoom account history transactions --from 20260301 --to 20260331
kiwoom account history transactions --from 20260301 --to 20260331 --type 3 # 매매만
kiwoom account history transactions --from 20260301 --to 20260331 --code 005930API: kt00015
| 옵션 | 설명 | 값 |
|---|---|---|
--from |
시작일자 | YYYYMMDD (필수) |
--to |
종료일자 | YYYYMMDD (필수) |
--type |
구분 |
0 (전체), 1 (입출금), 2 (입출고), 3 (매매), 4 (매수), 5 (매도), 6 (입금), 7 (출금) |
--code |
종목코드 | 선택 |
--exchange |
거래소구분 |
% (전체), KRX, NXT
|
kiwoom account history journal
kiwoom account history journal --date 20260301
kiwoom account history journal --cash-credit 1 # 현금매매만
kiwoom account history journal --cash-credit 2 # 신용매매만API: ka10170
| 옵션 | 설명 | 값 |
|---|---|---|
--date |
기준일자 | YYYYMMDD (기본=당일) |
--odd-lot |
단주구분 |
1 (당일매수에 대한 당일매도), 2 (당일매도 전체) |
--cash-credit |
현금신용구분 |
0 (전체), 1 (현금매매만), 2 (신용매매만) |