Bithumb Private API 신청
- Bithumb 홈페이지에서 별도로 신청
잔고확인하기
import pybithumb
import time
con_key = "86168bd96316eb6f3edc603f5e3fae56"
sec_key = "be2b81d44557f027aa361364c0e01e42"
bithumb = pybithumb.Bithumb(con_key, sec_key)
for ticker in pybithumb.get_tickers() :
balance = bithumb.get_balance(ticker)
print(ticker, " ", balance)
time.sleep(0.1)
매수하기
order = bithumb.buy_limit_order("BTC", 3900000, 0.001)
print(order)
매도하기
order = bithumb.sell_limit_order("BTC", 4000000, 1)
print(order)
주문취소하기
import time
# 코드 생략
order = bithumb.buy_limit_order("BTC", 3000000, 0.001 )
print(order)
time.sleep(10)
cancel = bithumb.cancel_order(order)
print(cancel)