Upbit OPEN API Client
@Author: uJhin
@Official Documents: https://ujhin.github.io/upbit-client-docs/
Install
pip command
pip install upbit-client
git command
git clone https://github.com/uJhin/python-upbit-client.git
Quick Start
REST Client
Check Your API Keys
# /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
# /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
# /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
# Using WebSocket
import json
import asyncio
from 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
Metadata
Release files for upbit-client 1.3.4.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| upbit-client-1.3.4.1.tar.gz | 13.6 kB | Without provenance | Details for upbit-client-1.3.4.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| upbit_client-1.3.4.1-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details for upbit_client-1.3.4.1-py2.py3-none-any.whl |
Total release size: 27.9 kB
Release files / upbit-client-1.3.4.1.tar.gz
| Download URL | upbit-client-1.3.4.1.tar.gz |
|---|---|
| Size | 13.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
af097d59934d7508cea3b3fdfcdddea248a1ef6d2f675b1e593529a5d9901335
|
|
BLAKE2b-256 checksum How to use checksums |
1c12d672175b65326fe5e777f624be0393849fe4f0e52b3cb31dcdbc1bc9084e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.3
|
Release files / upbit_client-1.3.4.1-py2.py3-none-any.whl
| Download URL | upbit_client-1.3.4.1-py2.py3-none-any.whl |
|---|---|
| Size | 14.4 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
8660727f05a62022cce313a23e50aac09817a1319bb8ba755a6178726118eed4
|
|
BLAKE2b-256 checksum How to use checksums |
e88b861f97b05b4995b01881506476b5cab207f1bcf64720a57d937387793731
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.3
|
Security for upbit-client 1.3.4.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.