Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ujhin/python-upbit-client
Upbit(업비트) Cryptocurrency Exchange OPEN API Client for Python
https://github.com/ujhin/python-upbit-client
api api-client api-rest crypto crypto-exchange cryptocurrency cryptocurrency-exchanges market-data open-api python python-upbit sdk swagger swagger-codegen trading ujhin upbit upbit-api upbit-client upbit-exchange
Last synced: 7 days ago
JSON representation
Upbit(업비트) Cryptocurrency Exchange OPEN API Client for Python
- Host: GitHub
- URL: https://github.com/ujhin/python-upbit-client
- Owner: uJhin
- License: mit
- Created: 2021-01-11T17:31:01.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-07-17T10:32:07.000Z (4 months ago)
- Last Synced: 2024-10-13T23:41:20.458Z (about 1 month ago)
- Topics: api, api-client, api-rest, crypto, crypto-exchange, cryptocurrency, cryptocurrency-exchanges, market-data, open-api, python, python-upbit, sdk, swagger, swagger-codegen, trading, ujhin, upbit, upbit-api, upbit-client, upbit-exchange
- Language: Python
- Homepage: https://ujhin.github.io/upbit-client-docs
- Size: 112 KB
- Stars: 47
- Watchers: 1
- Forks: 35
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
Awesome Lists containing this project
README
.. image:: https://raw.githubusercontent.com/uJhin/upbit-client/main/logo/logo.png
:align: center- `Base Repository `_
- `Python Upbit Client Repository `_Upbit OPEN API Client
######################
- @Author: `uJhin `_
- @GitHub: https://github.com/uJhin/upbit-client/
- @Official Documents: https://ujhin.github.io/upbit-client-docs/Install
*******
- pip command.. code:: console
pip install upbit-client
- git command
.. code:: console
git clone https://github.com/uJhin/python-upbit-client.git
Quick Start
***************REST Client
===========- Check Your API Keys
.. code:: python
# /v1/api_keys
from upbit.client import Upbit
access_key = "Your Access Key"
secret_key = "Your Secret Key"client = Upbit(access_key, secret_key)
api_keys = client.APIKey.APIKey_info()
print(api_keys['result'])- Buy Currency
.. code:: python
# /v1/orders
from upbit.client import Upbit
access_key = "Your Access Key"
secret_key = "Your Secret Key"client = Upbit(access_key, secret_key)
order = client.Order.Order_new(
market='KRW-BTC',
side='bid',
volume='0.1',
price='3000000',
ord_type='limit'
)
print(order['result'])- Sell Currency
.. code:: python
# /v1/orders
from upbit.client import Upbit
access_key = "Your Access Key"
secret_key = "Your Secret Key"client = Upbit(access_key, secret_key)
order = client.Order.Order_new(
market='KRW-BTC',
side='ask',
volume='0.1',
price='3000000',
ord_type='limit'
)
print(order['result'])WebSocket Client
================- Get Real-Time Ticker
.. code:: python
# Using WebSocket
import json
import asynciofrom upbit.websocket import UpbitWebSocket
# Definition async function
async def ticker(sock, payload):
async with sock as conn:
await conn.send(payload)
while True:
recv = await conn.recv()
data = recv.decode('utf8')
result = json.loads(data)
print(result)sock = UpbitWebSocket()
currencies = ['KRW-BTC', 'KRW-ETH']
type_field = sock.generate_type_field(
type='ticker',
codes=currencies,
)
payload = sock.generate_payload(
type_fields=[type_field]
)event_loop = asyncio.get_event_loop()
event_loop.run_until_complete( ticker(sock, payload) )Donation
*********
.. image:: https://img.shields.io/badge/BTC-3NVw2seiTQddGQwc1apqudKxuTqebpyL3s-blue?style=flat-square&logo=bitcoin
:alt: uJhin's BTC
.. image:: https://img.shields.io/badge/ETH-0x60dd373f59862d9df776596889b997e24bee42eb-blue?style=flat-square&logo=ethereum
:alt: uJhin's ETH