Skip to content

Account Commands

Yu Jin edited this page Jul 15, 2026 · 2 revisions

계좌 조회 (account)

kiwoom account 그룹은 계좌 잔고, 예수금, 수익률, 주문/체결 내역 등 계좌 관련 정보를 조회합니다.

모든 계좌 조회에는 유효한 토큰이 필요합니다. 토큰이 없거나 만료되면 exit code 3이 반환됩니다.

v2.0+: balance / deposit / pnl / orders / history는 기본적으로 국내+미국 통합으로 표시됩니다. --market kr|us로 필터링할 수 있습니다. 미국주식 참고.

기본 명령어

list -- 계좌번호 목록

kiwoom account list
# 계좌번호: 1234567

API: ka00001

balance -- 계좌 평가현황

잔고, 보유종목, 손익을 한눈에 보여주는 핵심 명령어입니다.

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 (제외)

deposit -- 예수금 상세

kiwoom account deposit                    # 추정조회 (기본)
kiwoom account deposit --type normal      # 일반조회

API: kt00001 | 옵션: --type (estimate/normal)

asset -- 추정자산

kiwoom account asset
kiwoom account asset --delist 1           # 상장폐지 제외

API: kt00003

today -- 당일현황

kiwoom account today

API: kt00017

margin-detail -- 증거금 세부내역

kiwoom account margin-detail

API: kt00013

수익률 (account returns)

summary -- 계좌 수익률

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)

daily-balance -- 일별 잔고수익률

kiwoom account returns daily-balance
kiwoom account returns daily-balance --date 20260301

API: ka01690 | 옵션: --date (YYYYMMDD, 기본=오늘)

daily-detail -- 일별 수익률 상세

kiwoom account returns daily-detail --from 20260301 --to 20260331

API: kt00016 | 옵션: --from (필수), --to (필수)

daily-asset -- 일별 예탁자산

kiwoom account returns daily-asset --from 20260301 --to 20260331

API: kt00002 | 옵션: --from (필수), --to (필수)

실현손익 (account pnl)

today -- 당일 실현손익

종목코드가 필수입니다.

kiwoom account pnl today 005930

API: ka10077

by-date -- 일자별 실현손익

kiwoom account pnl by-date --from 20260301
kiwoom account pnl by-date --from 20260301 --code 005930    # 특정 종목

API: ka10072 | 옵션: --from (필수), --code (선택)

by-period -- 기간별 실현손익

kiwoom account pnl by-period --from 20260301 --to 20260331
kiwoom account pnl by-period --from 20260301 --to 20260331 --code 005930

API: ka10073 | 옵션: --from (필수), --to (필수), --code (선택)

daily -- 일자별 실현손익

kiwoom account pnl daily --from 20260301 --to 20260331

API: ka10074 | 옵션: --from (필수), --to (필수)

주문/체결 조회 (account orders)

pending -- 미체결 주문

현재 미체결 상태인 주문을 조회합니다.

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)

executed -- 체결 내역

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

detail -- 주문체결 상세

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 KRX

API: kt00007

옵션 설명
--date 주문일자 YYYYMMDD (기본=당일)
--qry-type 조회구분 1 (주문순), 2 (역순), 3 (미체결), 4 (체결)
--asset 주식채권구분 0 (전체), 1 (주식), 2 (채권)
--side 매도수구분 0 (전체), 1 (매도), 2 (매수)
--code 종목코드 선택
--from-order 시작주문번호 선택
--exchange 거래소구분 % (전체), KRX, NXT, SOR

status -- 주문체결 현황

kiwoom account orders status
kiwoom account orders status --date 20260301 --market 1    # 코스피만

API: kt00009

split-detail -- 분할주문 상세

kiwoom account orders split-detail 0000139

API: ka10088

잔고/평가 (account holdings)

eval -- 계좌평가 잔고

kiwoom account holdings eval
kiwoom account holdings eval --qry-type 2             # 개별 표시
kiwoom account holdings eval --exchange NXT

API: kt00018 | 옵션: --qry-type (1=합산, 2=개별), --exchange (KRX/NXT)

settled -- 체결잔고

kiwoom account holdings settled
kiwoom account holdings settled --exchange NXT

API: kt00005

next-settle -- 익일결제예정

kiwoom account holdings next-settle

API: kt00008

주문가능 금액/수량 (account orderable)

amount -- 주문 인출가능 금액

kiwoom account orderable amount 005930 --side buy --price 70000
kiwoom account orderable amount 005930 --side sell --price 70000

API: kt00010 | 옵션: --side (buy/sell, 필수), --price (필수)

margin-qty -- 증거금율별 주문가능 수량

kiwoom account orderable margin-qty 005930
kiwoom account orderable margin-qty 005930 --price 70000

API: kt00011

credit-qty -- 신용보증금율별 주문가능 수량

kiwoom account orderable credit-qty 005930
kiwoom account orderable credit-qty 005930 --price 70000

API: kt00012

환전 (account exchange) — v2.0+

미국주식 거래를 위한 원화↔달러 환전입니다.

exchange rate — 환율 조회

kiwoom account exchange rate

API: ust31301

exchange estimate — 환전 예상 금액

kiwoom account exchange estimate 1000000

API: ust31300

exchange apply — 환전 신청

kiwoom account exchange apply 1000000 --confirm

주문과 동일하게 미리보기 + 확인 게이트를 거칩니다. API: ust31302

거래내역 (account history)

transactions -- 위탁 종합거래내역

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 005930

API: kt00015

옵션 설명
--from 시작일자 YYYYMMDD (필수)
--to 종료일자 YYYYMMDD (필수)
--type 구분 0 (전체), 1 (입출금), 2 (입출고), 3 (매매), 4 (매수), 5 (매도), 6 (입금), 7 (출금)
--code 종목코드 선택
--exchange 거래소구분 % (전체), KRX, NXT

journal -- 당일 매매일지

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 (신용매매만)

관련 페이지

Clone this wiki locally