Skip to content

Commit b95ee05

Browse files
committed
feat: Upbit.get_orderbook_levels() 호가 모아보기 단위 정보 조회 지원
1 parent ef3b7ae commit b95ee05

File tree

2 files changed

+39
-1
lines changed

2 files changed

+39
-1
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,12 @@ data = res.json()
9797
| | 일(Day) 캔들 | get_candles_day |
9898
| | 주(Week) 캔들 | get_candles_week |
9999
| | 월(Month) 캔들 | get_candles_month |
100-
| | 연(Year) 캔들 | get_candles_year |
100+
| | 연(Year) 캔들 | get_candles_year |
101101
| 시세 체결 조회 | 최근 체결 내역 | get_trades_ticks |
102102
| 시세 현재가 조회 | 현재가 정보 | get_ticker |
103103
| 시세 현재가 조회 | 마켓 단위 현재가 정보 | get_tickers_by_quote |
104104
| 시세 호가 조회 | 호가 정보 | get_orderbook |
105+
| | 호가 모아보기 단위 정보 | get_orderbook_levels |
105106

106107
### Requests 사용
107108
[Requests][requests] 라이브러리를 사용합니다.

upbit/upbit.py

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2168,3 +2168,40 @@ def get_orderbook(self,
21682168
}
21692169

21702170
return self._request('get', url, params=params, **kwargs)
2171+
2172+
def get_orderbook_levels(self,
2173+
markets: List[str],
2174+
**kwargs) -> Response:
2175+
"""호가 모아보기 단위 정보 조회
2176+
2177+
API 요청 및 응답에 대한 자세한 정보는 공식 문서 참고:
2178+
`Upbit API Doc <https://docs.upbit.com/reference/supported_levels>`_
2179+
2180+
:param markets: 마켓 코드 리스트 (ex. ["KRW-BTC"])
2181+
:param kwargs: `requests.Session.request` 호출에 사용할 파라미터
2182+
2183+
:return: API 서버 응답
2184+
2185+
Usage::
2186+
2187+
upbit = Upbit()
2188+
res = upbit.get_orderbook_levels(['KRW-BTC'])
2189+
print(res.json())
2190+
2191+
[{
2192+
"market": "KRW-BTC",
2193+
"supported_levels": [
2194+
0,
2195+
10000,
2196+
100000,
2197+
1000000,
2198+
10000000
2199+
]
2200+
}, ...]
2201+
"""
2202+
url = self._endpoint + "/orderbook/supported_levels"
2203+
params = {
2204+
"markets": markets,
2205+
}
2206+
2207+
return self._request('get', url, params=params, **kwargs)

0 commit comments

Comments
 (0)