Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ujhin/upbit-client

Upbit(업비트) Cryptocurrency Exchange Open API Client of Multi-Programming Language Support
https://github.com/ujhin/upbit-client

api api-client api-connector api-rest bitcoin client crypto cryptocurrency cryptocurrency-exchanges exchange http-client market-data open-api python sdk trading ujhin upbit upbit-api upbit-client

Last synced: about 3 hours ago
JSON representation

Upbit(업비트) Cryptocurrency Exchange Open API Client of Multi-Programming Language Support

Awesome Lists containing this project

README

        

























Upbit Client Documents





Support


















Upbit Client


Upbit(업비트) Cryptocurrency Exchange API Client


### Description
Upbit(업비트) Cryptocurrency Exchange Open API Client of Multi-Programming Language Support

### Swagger Generated Support Languages
- [Python](https://github.com/uJhin/upbit-client/tree/main/swg_generated/python/)
- [C++](https://github.com/uJhin/upbit-client/tree/main/swg_generated/cpp)
- [CSharp](https://github.com/uJhin/upbit-client/tree/main/swg_generated/csharp/)
- [Objective-C](https://github.com/uJhin/upbit-client/tree/main/swg_generated/objective-c)
- [Java](https://github.com/uJhin/upbit-client/tree/main/swg_generated/java/)
- [JavaScript](https://github.com/uJhin/upbit-client/tree/main/swg_generated/)
- [PHP](https://github.com/uJhin/upbit-client/tree/main/swg_generated/php/SwaggerClient-php/)
- [Android](https://github.com/uJhin/upbit-client/tree/main/swg_generated/android)
- [Kotlin](https://github.com/uJhin/upbit-client/tree/main/swg_generated/)
- [Go](https://github.com/uJhin/upbit-client/tree/main/swg_generated/go/)
- [Lua](https://github.com/uJhin/upbit-client/tree/main/swg_generated/lua)
- [R](https://github.com/uJhin/upbit-client/tree/main/swg_generated/r)
- [Rust](https://github.com/uJhin/upbit-client/tree/main/swg_generated/rust)
- [Scala](https://github.com/uJhin/upbit-client/tree/main/swg_generated/scala)

### Install
- `pip` command
```console
pip install upbit-client
```
- `git` command
```console
git clone https://github.com/uJhin/upbit-client.git
```

### Quick Start
#### REST Client
- Check Your API Keys
```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
```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

```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
```python
# 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


uJhin's BTC


uJhin's ETH