Giter VIP home page Giter VIP logo

pyupbit's Introduction

pyupbit

Python Wrapper for Upbit API

Installation

pip install pyupbit

Import

import pyupbit

Quotation API

암호화폐 목록

업비트가 지원하는 암호화폐 목록을 얻어온다.

print(pyupbit.get_tickers())

암호화폐 목록 (KRW/BTC/ETH/USDT)

업비트가 지원하는 암호화폐 목록 중 특정 Fiat로 매매가 가능한 목록만 얻어온다.

print(pyupbit.get_tickers(fiat="KRW"))
print(pyupbit.get_tickers(fiat="BTC"))
print(pyupbit.get_tickers(fiat="ETH"))
print(pyupbit.get_tickers(fiat="USDT"))

최근 체결가격

특정 암호화폐에 대한 현재가를 얻어온다.

print(get_current_price("KRW-BTC"))

차트 데이터

print(get_ohlcv("KRW-BTC"))                             # 기본 일봉 데이터
print(get_ohlcv("KRW-BTC", interval="minute"))          # 분봉 데이터
print(get_ohlcv("KRW-BTC", interval="week"))            # 주봉 데이터 

매수/매도 호가

print(get_orderbook(tickers="KRW-BTC")
print(get_orderbook(tickers=["KRW-BTC", "KRW-XRP"]))

Exchange API

로그인

Access Key와 Sercret Key를 사용해서 로그인한다.

access = "73kVqowGQOGEjdR31221j31j2ifekjkgjekgjekg"          # 본인 값으로 변경
secret = "egjekgj3iekeEEkej3i3j3iejjwiEejiejeEeijg"          # 본인 값으로 변경
upbit = Upbit(access, secret)

잔고 조회

print(upbit.get_balances())

매수/매도 주문

리플을 507원에 20개 매수한다. 리플을 500원에 20개 매도한다.

# 매도
print(upbit.sell_limit_order("KRW-XRP", 507, 20))

# 매수
print(upbit.buy_limit_order("KRW-XRP", 500, 20))

매수/매도 주문 취소

주문 함수의 리턴 값 중 uuid 값을 사용해서 주문을 취소할 수 있다.

print(upbit.cancel_order('e57a3bc0-0b0b-4540-96f2-f35f19c51e8d'))

pyupbit's People

Contributors

brayden-jo avatar sharebook-kr avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.