KIS Developers menu

API 문서 HOME API 문서 [해외선물옵션] 실시간시세


[해외선물옵션]실시간시세

해외선물옵션 실시간체결가[실시간-017]

WEBSOCKET

해외선물옵션 실시간체결가[실시간-017]

기본정보

  • Method
    POST
  • 실전 Domain
    ws://ops.koreainvestment.com:21000
  • 모의 Domain
    모의투자 미지원
  • URL
    /tryitout/HDFFF020
  • Format
     
  • Content-Type
    utf-8

개요

(중요) 해외선물옵션시세 출력값을 해석하실 때 ffcode.mst(해외선물종목마스터 파일)에 있는 sCalcDesz(계산 소수점) 값을 활용하셔야 정확한 값을 받아오실 수 있습니다.

- ffcode.mst(해외선물종목마스터 파일) 다운로드 방법 2가지
1) 한국투자증권 Github의 파이썬 샘플코드를 사용하여 mst 파일 다운로드 및 excel 파일로 정제
https://github.com/koreainvestment/open-trading-api/blob/main/stocks_info/overseas_future_code.py

2) 혹은 포럼 - FAQ - 종목정보 다운로드 - 해외선물옵션 클릭하셔서 ffcode.mst(해외선물종목마스터 파일)을 다운로드 후
Github의 헤더정보(https://github.com/koreainvestment/open-trading-api/blob/main/stocks_info/해외선물옵션정보.h)를 참고하여 해석

- 소수점 계산 시, ffcode.mst(해외선물종목마스터 파일)의 sCalcDesz(계산 소수점) 값 참고
EX) ffcode.mst 파일의 sCalcDesz(계산 소수점) 값
품목코드 6A 계산소수점 -4 → 시세 6882.5 수신 시 0.68825 로 해석
품목코드 GC 계산소수점 -1 → 시세 19225 수신 시 1922.5 로 해석


[참고자료]

실시간시세(웹소켓) 파이썬 샘플코드는 한국투자증권 Github 참고 부탁드립니다.
https://github.com/koreainvestment/open-trading-api/blob/main/websocket/python/ws_domestic_overseas_all.py

실시간시세(웹소켓) API 사용방법에 대한 자세한 설명은 한국투자증권 Wikidocs 참고 부탁드립니다.
https://wikidocs.net/book/7847 (국내주식 업데이트 완료, 추후 해외주식·국내선물옵션 업데이트 예정)

종목코드 마스터파일 파이썬 정제코드는 한국투자증권 Github 참고 부탁드립니다.
https://github.com/koreainvestment/open-trading-api/tree/main/stocks_info

LAYOUT

Request

Header

Element 한글명 Type Required Length Description
approval_key 웹소켓접속키 String Y 36 실시간 (웹소켓) 접속키 발급 API(/oauth2/Approval)를 사용하여 발급받은 웹소켓 접속키
tr_type 등록/해제 String Y 1 "1: 등록, 2:해제"
custtype 고객 타입 String Y 1 B : 법인 / P : 개인
content-type 컨텐츠타입 String Y 20 utf-8

Body

Element 한글명 Type Required Length Description
tr_id 거래ID String Y 7 HDFFF020
tr_key 종목코드 String Y 6 종목코드

Response

Body

Element 한글명 Type Required Length Description
series_cd 종목코드 Object Y 32 '각 항목사이에는 구분자로 ^ 사용,
모든 데이터타입은 String으로 변환되어 push 처리됨'
-bsns_date 영업일자 String Y 8
-mrkt_open_date 장개시일자 String Y 8
-mrkt_open_time 장개시시각 String Y 6
-mrkt_close_date 장종료일자 String Y 8
-mrkt_close_time 장종료시각 String Y 6
-prev_price 전일종가 String Y 15 전일종가, 체결가격, 전일대비가, 시가, 고가, 저가
※ ffcode.mst(해외선물종목마스터 파일)의 sCalcDesz(계산 소수점) 값 참고
-recv_date 수신일자 String Y 8
-recv_time 수신시각 String Y 6 수신시각(recv_time) = 실제 체결시각
-active_flag 본장_전산장구분 String Y 1
-last_price 체결가격 String Y 15
-last_qntt 체결수량 String Y 10
-prev_diff_price 전일대비가 String Y 15
-prev_diff_rate 등락률 String Y 10
-open_price 시가 String Y 15
-high_price 고가 String Y 15
-low_price 저가 String Y 15
-vol 누적거래량 String Y 10
-prev_sign 전일대비부호 String Y 1
-quotsign 체결구분 String Y 1 2:매수체결 5:매도체결
-recv_time2 수신시각2 만분의일초 String Y 4
-psttl_price 전일정산가 String Y 15
-psttl_sign 전일정산가대비 String Y 1
-psttl_diff_price 전일정산가대비가격 String Y 15
-psttl_diff_rate 전일정산가대비율 String Y 10

해외선물옵션 실시간호가[실시간-018]

WEBSOCKET

해외선물옵션 실시간호가[실시간-018]

기본정보

  • Method
    POST
  • 실전 Domain
    ws://ops.koreainvestment.com:21000
  • 모의 Domain
    모의투자 미지원
  • URL
    /tryitout/HDFFF010
  • Format
     
  • Content-Type
    utf-8

개요

(중요) 해외선물옵션시세 출력값을 해석하실 때 ffcode.mst(해외선물종목마스터 파일)에 있는 sCalcDesz(계산 소수점) 값을 활용하셔야 정확한 값을 받아오실 수 있습니다.

- ffcode.mst(해외선물종목마스터 파일) 다운로드 방법 2가지
1) 한국투자증권 Github의 파이썬 샘플코드를 사용하여 mst 파일 다운로드 및 excel 파일로 정제
https://github.com/koreainvestment/open-trading-api/blob/main/stocks_info/overseas_future_code.py

2) 혹은 포럼 - FAQ - 종목정보 다운로드 - 해외선물옵션 클릭하셔서 ffcode.mst(해외선물종목마스터 파일)을 다운로드 후
Github의 헤더정보(https://github.com/koreainvestment/open-trading-api/blob/main/stocks_info/해외선물옵션정보.h)를 참고하여 해석

- 소수점 계산 시, ffcode.mst(해외선물종목마스터 파일)의 sCalcDesz(계산 소수점) 값 참고
EX) ffcode.mst 파일의 sCalcDesz(계산 소수점) 값
품목코드 6A 계산소수점 -4 → 시세 6882.5 수신 시 0.68825 로 해석
품목코드 GC 계산소수점 -1 → 시세 19225 수신 시 1922.5 로 해석


[참고자료]

실시간시세(웹소켓) 파이썬 샘플코드는 한국투자증권 Github 참고 부탁드립니다.
https://github.com/koreainvestment/open-trading-api/blob/main/websocket/python/ws_domestic_overseas_all.py

실시간시세(웹소켓) API 사용방법에 대한 자세한 설명은 한국투자증권 Wikidocs 참고 부탁드립니다.
https://wikidocs.net/book/7847 (국내주식 업데이트 완료, 추후 해외주식·국내선물옵션 업데이트 예정)

종목코드 마스터파일 파이썬 정제코드는 한국투자증권 Github 참고 부탁드립니다.
https://github.com/koreainvestment/open-trading-api/tree/main/stocks_info

LAYOUT

Request

Header

Element 한글명 Type Required Length Description
approval_key 웹소켓접속키 String Y 36 실시간 (웹소켓) 접속키 발급 API(/oauth2/Approval)를 사용하여 발급받은 웹소켓 접속키
custtype 고객 타입 String Y 1 B : 법인 / P : 개인
tr_type 등록/해제 String Y 1 "1: 등록, 2:해제"
content-type 컨텐츠타입 String Y 20 utf-8

Body

Element 한글명 Type Required Length Description
tr_id 거래ID String Y 7 HDFFF010
tr_key 종목코드 String Y 6 종목코드

Response

Body

Element 한글명 Type Required Length Description
series_cd 종목코드 Object Y 32 '각 항목사이에는 구분자로 ^ 사용,
모든 데이터타입은 String으로 변환되어 push 처리됨'
-recv_date 수신일자 String Y 8
-recv_time 수신시각 String Y 12
-prev_price 전일종가 String Y 15 전일종가, 매수1호가~매도5호가
※ ffcode.mst(해외선물종목마스터 파일)의 sCalcDesz(계산 소수점) 값 참고
-bid_qntt_1 매수1수량 String Y 10
-bid_num_1 매수1번호 String Y 10
-bid_price_1 매수1호가 String Y 15
-ask_qntt_1 매도1수량 String Y 10
-ask_num_1 매도1번호 String Y 10
-ask_price_1 매도1호가 String Y 15
-bid_qntt_2 매수2수량 String Y 10
-bid_num_2 매수2번호 String Y 10
-bid_price_2 매수2호가 String Y 15
-ask_qntt_2 매도2수량 String Y 10
-ask_num_2 매도2번호 String Y 10
-ask_price_2 매도2호가 String Y 15
-bid_qntt_3 매수3수량 String Y 10
-bid_num_3 매수3번호 String Y 10
-bid_price_3 매수3호가 String Y 15
-ask_qntt_3 매도3수량 String Y 10
-ask_num_3 매도3번호 String Y 10
-ask_price_3 매도3호가 String Y 15
-bid_qntt_4 매수4수량 String Y 10
-bid_num_4 매수4번호 String Y 10
-bid_price_4 매수4호가 String Y 15
-ask_qntt_4 매도4수량 String Y 10
-ask_num_4 매도4번호 String Y 10
-ask_price_4 매도4호가 String Y 15
-bid_qntt_5 매수5수량 String Y 10
-bid_num_5 매수5번호 String Y 10
-bid_price_5 매수5호가 String Y 15
-ask_qntt_5 매도5수량 String Y 10
-ask_num_5 매도5번호 String Y 10
-ask_price_5 매도5호가 String Y 15
-sttl_price 전일정산가 String Y 15

해외선물옵션 실시간주문내역통보[실시간-019]

WEBSOCKET

해외선물옵션 실시간주문내역통보[실시간-019]

기본정보

  • Method
    POST
  • 실전 Domain
    ws://ops.koreainvestment.com:21000
  • 모의 Domain
    모의투자 미지원
  • URL
    /tryitout/HDFFF1C0
  • Format
     
  • Content-Type
    utf-8

개요

[참고자료]

실시간시세(웹소켓) 파이썬 샘플코드는 한국투자증권 Github 참고 부탁드립니다.
https://github.com/koreainvestment/open-trading-api/blob/main/websocket/python/ws_domestic_overseas_all.py

실시간시세(웹소켓) API 사용방법에 대한 자세한 설명은 한국투자증권 Wikidocs 참고 부탁드립니다.
https://wikidocs.net/book/7847 (국내주식 업데이트 완료, 추후 해외주식·국내선물옵션 업데이트 예정)

종목코드 마스터파일 파이썬 정제코드는 한국투자증권 Github 참고 부탁드립니다.
https://github.com/koreainvestment/open-trading-api/tree/main/stocks_info

LAYOUT

Request

Header

Element 한글명 Type Required Length Description
approval_key 웹소켓접속키 String Y 36 실시간 (웹소켓) 접속키 발급 API(/oauth2/Approval)를 사용하여 발급받은 웹소켓 접속키
tr_type 등록/해제 String Y 1 "1: 등록, 2:해제"
custtype 고객 타입 String Y 1 B : 법인 / P : 개인
content-type 컨텐츠타입 String Y 20 utf-8

Body

Element 한글명 Type Required Length Description
tr_id 거래ID String Y 7 HDFFF1C0
tr_key HTSID String Y 8 HTSID

Response

Body

Element 한글명 Type Required Length Description
user_id 유저ID Object Y 8 '각 항목사이에는 구분자로 ^ 사용,
모든 데이터타입은 String으로 변환되어 push 처리됨'
-acct_no 계좌번호 String Y 10
-ord_dt 주문일자 String Y 8
-odno 주문번호 String Y 10
-orgn_ord_dt 원주문일자 String Y 8
-orgn_odno 원주문번호 String Y 10
-series 종목명 String Y 32
-rvse_cncl_dvsn_cd 정정취소구분코드 String Y 2 해당없음 : 00 , 정정 : 01 , 취소 : 02
-sll_buy_dvsn_cd 매도매수구분코드 String Y 2 01 : 매도, 02 : 매수
-cplx_ord_dvsn_cd 복합주문구분코드 String Y 1 0 (hedge청산만 이용)
-prce_tp 가격구분코드 String Y 1 1:Limit, 2:Market, 3:Stop(Stop가격시 시장가)
-fm_excg_rcit_dvsn_cd FM거래소접수구분코드 String Y 2 01:접수전, 02:응답, 03:거부
-ord_qty 주문수량 String Y 18
-fm_lmt_pric FMLIMIT가격 String Y 21
-fm_stop_ord_pric FMSTOP주문가격 String Y 21
-tot_ccld_qty 총체결수량 String Y 18
-tot_ccld_uv 총체결단가 String Y 21
-ord_remq 잔량 String Y 21
-fm_ord_grp_dt FM주문그룹일자 String Y 8 주문일자(ORD_DT)와 동일
-ord_grp_stno 주문그룹번호 String Y 12
-ord_dtl_dtime 주문상세일시 String Y 17
-oprt_dtl_dtime 조작상세일시 String Y 17
-work_empl 주문자 String Y 8
-crcy_cd 통화코드 String Y 3
-lqd_yn 청산여부(Y/N) String Y 1
-lqd_lmt_pric 청산LIMIT가격 String Y 21
-lqd_stop_pric 청산STOP가격 String Y 21
-trd_cond 체결조건코드 String Y 1
-term_ord_vald_dtime 기간주문유효상세일시 String Y 17
-spec_tp 계좌청산유형구분코드 String Y 1
-ecis_rsvn_ord_yn 행사예약주문여부 String Y 1
-fuop_item_dvsn_cd 선물옵션종목구분코드 String Y 2
-auto_ord_dvsn_cd 자동주문 전략구분 String Y 2

해외선물옵션 실시간체결내역통보[실시간-020]

WEBSOCKET

해외선물옵션 실시간체결내역통보[실시간-020]

기본정보

  • Method
    POST
  • 실전 Domain
    ws://ops.koreainvestment.com:21000
  • 모의 Domain
    모의투자 미지원
  • URL
    /tryitout/HDFFF2C0
  • Format
     
  • Content-Type
    application/json; charset=utf-8

개요

LAYOUT

Request

Header

Element 한글명 Type Required Length Description
approval_key 웹소켓 접속키 String Y 36 실시간 (웹소켓) 접속키 발급 API(/oauth2/Approval)를 사용하여 발급받은 웹소켓 접속키
tr_type 등록/해제 String Y 1 "1: 등록, 2:해제"
custtype 고객 타입 String Y 1 B : 법인 / P : 개인
content-type 컨텐츠타입 String Y 20 utf-8

Body

Element 한글명 Type Required Length Description
tr_id 거래ID String Y 7 HDFFF2C0
tr_key HTSID String Y 8 HTSID

Response

Body

Element 한글명 Type Required Length Description
user_id 유저ID Object Y 8 '각 항목사이에는 구분자로 ^ 사용,
모든 데이터타입은 String으로 변환되어 push 처리됨'
-acct_no 계좌번호 String Y 10
-ord_dt 주문일자 String Y 8
-odno 주문번호 String Y 10
-orgn_ord_dt 원주문일자 String Y 8
-orgn_odno 원주문번호 String Y 10
-series 종목명 String Y 32
-rvse_cncl_dvsn_cd 정정취소구분코드 String Y 2 해당없음 : 00 , 정정 : 01 , 취소 : 02
-sll_buy_dvsn_cd 매도매수구분코드 String Y 2 01 : 매도, 02 : 매수
-cplx_ord_dvsn_cd 복합주문구분코드 String Y 1 0 (hedge청산만 이용)
-prce_tp 가격구분코드 String Y 1
-fm_excg_rcit_dvsn_cd FM거래소접수구분코드 String Y 2
-ord_qty 주문수량 String Y 18
-fm_lmt_pric FMLIMIT가격 String Y 21
-fm_stop_ord_pric FMSTOP주문가격 String Y 21
-tot_ccld_qty 총체결수량 String Y 18 동일한 주문건에 대한 누적된 체결수량 (하나의 주문건에 여러건의 체결내역 발생)
-tot_ccld_uv 총체결단가 String Y 21
-ord_remq 잔량 String Y 21
-fm_ord_grp_dt FM주문그룹일자 String Y 8
-ord_grp_stno 주문그룹번호 String Y 12
-ord_dtl_dtime 주문상세일시 String Y 17
-oprt_dtl_dtime 조작상세일시 String Y 17
-work_empl 주문자 String Y 8
-ccld_dt 체결일자 String Y 8
-ccno 체결번호 String Y 11
-api_ccno API 체결번호 String Y 20
-ccld_qty 체결수량 String Y 18 매 체결 단위 체결수량임 (여러건 체결내역 누적 체결수량인 총체결수량과 다름)
-fm_ccld_pric FM체결가격 String Y 21
-crcy_cd 통화코드 String Y 3
-trst_fee 위탁수수료 String Y 21
-ord_mdia_online_yn 주문매체온라인여부 String Y 1
-fm_ccld_amt FM체결금액 String Y 21
-fuop_item_dvsn_cd 선물옵션종목구분코드 String Y 2