본문 바로가기

VBA/Code

[VBA] 업비트 Open API>시세 캔들 조회>주(Week) 캔들

반응형

API Reference

HTTP Method API URL
GET https://api.upbit.com/v1/candles/weeks

 

QUERY PARAMS

필드명 필수 여부 설명 타입
market Y 마켓 코드 (ex. KRW-BTC, BTC-BCC) String
to N

마지막 캔들 시각 (exclusive). 포맷 : yyyy-MM-dd'T'HH:mm:ssXXX or yyyy-MM-dd HH:mm:ss.

비워서 요청시 가장 최근 캔들

String
count N 캔들 개수 Integer

 

Response

필드명 설명 타입
market 마켓명 String
candle_date_time_utc 캔들 기준 시각(UTC 기준) String
candle_date_time_kst 캔들 기준 시각(KST 기준) String
opening_price 시가 Double
high_price 고가 Double
low_price 저가 Double
trade_price 종가 Double
timestamp 해당 캔들에서 마지막 틱이 저장된 시각 Long
candle_acc_trade_price 누적 거래 금액 Double
candle_acc_trade_volume 누적 거래량 Double
first_day_of_period 캔들 기간의 가장 첫 날 String

convertingPriceUnit 파라미터의 경우, 원화 마켓이 아닌 다른 마켓(ex. BTC, ETH)의 일봉 요청시 종가를 명시된 파라미터 값으로 환산해 converted_trade_price 필드에 추가하여 반환합니다.

현재는 원화(KRW) 로 변환하는 기능만 제공하며 추후 기능을 확장할 수 있습니다.

 

VBA Code

Sub Upbit_Candles_Week() 
     
    Dim WinHttp As New WinHttp.WinHttpRequest 
    Dim url As String, market As String, toDate As String, count As Integer 
     
    url = "https://api.upbit.com/v1/candles/weeks" 
    market = "KRW-BTC" 
    toDate = Format(Now, "YYYY-MM-DD HH:MM:SS") 
    count = 200 
     
    With WinHttp 
        .Open "GET", url & "?market=" & market & "&to=" & toDate & "&count=" & count 
        .SetRequestHeader "user-agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:60.0) Gecko/20100101 Firefox/60.0" 
        .Send 
        .WaitForResponse 
        Debug.Print .ResponseText 
    End With 

    Set WinHttp = Nothing

End Sub 

 

Download

업비트 OPEN API_주(Week) 캔들.zip
0.02MB

 

업비트 OPEN API

EXCHANGE API 자산 전체 계좌 조회 https://xlmaster.tistory.com/25
주문 주문 가능 정보 https://xlmaster.tistory.com/26
개별 주문 조회 https://xlmaster.tistory.com/32
주문 리스트 조회 https://xlmaster.tistory.com/27
주문 취소 접수 https://xlmaster.tistory.com/28
주문하기 https://xlmaster.tistory.com/29
출금 출금 리스트 조회 https://xlmaster.tistory.com/30
개별 출금 조회 https://xlmaster.tistory.com/31
출금 가능 정보 https://xlmaster.tistory.com/33
코인 출금하기 https://xlmaster.tistory.com/34
원화 출금하기 https://xlmaster.tistory.com/35
입금 입금 리스트 조회 https://xlmaster.tistory.com/36
개별 입금 조회 https://xlmaster.tistory.com/37
입금 주소 생성 요청 https://xlmaster.tistory.com/38
전체 입금 주소 조회 https://xlmaster.tistory.com/39
개별 입금 주소 조회 https://xlmaster.tistory.com/40
QUOTATION API 시세 종목 조회 마켓 코드 조회 https://xlmaster.tistory.com/15
시세 캔들 조회 분(Minute) 캔들 https://xlmaster.tistory.com/16
일(Day) 캔들 https://xlmaster.tistory.com/17
주(Week) 캔들 https://xlmaster.tistory.com/18
월(Month) 캔들 https://xlmaster.tistory.com/19
시세 체결 조회 당일 체결 내역 https://xlmaster.tistory.com/20
시세 Ticker 조회 현재가 정보 https://xlmaster.tistory.com/21
시세 호가 정보(Orderbook) 조회 호가 정보 조회 https://xlmaster.tistory.com/22

 

Upbit Open API v1.0.6

반응형