EXMO API - LabMazurokCom/Blockchain GitHub Wiki

Intro

Website: https://exmo.com/

Documentation: https://exmo.com/en/api

Limits: UNKNOWN.

Fee used in bot: 0.2% (maker and taker).

Order book

https://api.exmo.com/v1/order_book/?pair=BTC_USD&limit=50

N.B. Maximum limit is 1000.

N.B. They also have BTC_USDT pair.

Response:

{
    "BTC_USD": {
        "ask_quantity": "3",
        "ask_amount": "500",
        "ask_top": "100",
        "bid_quantity": "1",
        "bid_amount": "99",
        "bid_top": "99",
        "ask": [
            ['8197.99764077', '0.02328718', '190.9082467'],
            ['8198', '0.00002172', '0.17806056'],
            ...
        ]
        "bid": [
            ['8161.26830272', '0.00100225', '8.17963115'],
            ['8161.26818147', '0.00746168', '60.89677156'],
            ...
        ]
    }
}
Field Meaning
ask_quantity the sum of all quantity values in sell orders
ask_amount the sum of all total sum values in sell orders
ask_top minimum sell price
bid_quantity the sum of all quantity values in buy orders
bid_amount the sum of all total sum values in buy orders
bid_top maximum buy price
bid the list of buy orders where every field is: price, quantity and amount
ask the list of sell orders where every field is: price, quantity and amount

Ticker

https://api.exmo.com/v1/ticker

N.B. Returns all pairs at once.

Response:

{
    'BTC_USD': {
        'buy_price': '8174.9999999',
        'sell_price': '8175',
        'last_trade': '8175',
        'high': '8235.99651404',
        'low': '7476.99957425',
        'avg': '7823.90003812',
        'vol': '1626.36514197',
        'vol_curr': '13295535.03545099',
        'updated': 1523621733
    },
    'BCH_ETH': {
        'buy_price': '1.50766132',
        'sell_price': '1.50991226',
        'last_trade': '1.504646',
        'high': '1.572',
        'low': '1.457',
        'avg': '1.50363679',
        'vol': '210.72959741',
        'vol_curr': '316.15761499',
        'updated': 1523621732
    },
    ...
}
Field Meaning
high maximum deal price within the last 24 hours
low minimum deal price within the last 24 hours
avg average deal price within the last 24 hours
vol the volume of deals within the last 24 hours
vol_curr the total value of all deals within the last 24 hours
last_trade last deal price
buy_price current maximum buy price
sell_price current minimum sell price
updated date and time of data update

Currency limits

https://api.exmo.com/v1/pair_settings/

Order types

Buy order / sell order (smth similar to limit order on other exchanges?!)

User can set both price and quantity. (Can be executed partially?!)

Buy market order / sell market order

User can set only quantity of base currency to buy or to sell respectively

Buy market total order / sell market total order

User can set only quantity of quote currency. It's a buy/sell market order for a certain amount.

Example: user sets quantity 100 on the pair BTC/USD. It means he wants to buy BTC for the amount of 100 USD.

Private API request example

import requests
import hashlib
import hmac
import time
import urllib

api_key='API_KEY'
api_secret='API_SECRET'

nonce = int(round(time.time() * 1000))

params = {}
params['nonce'] = nonce
params['pair'] = 'BTC_USD'
params['quantity'] = 5
params['price'] = 5
params['type'] = 'sell'
params = urllib.parse.urlencode(params)

api_secret = bytes(api_secret, encoding='utf-8')

H = hmac.new(key = api_secret, digestmod = hashlib.sha512)
H.update(params.encode('utf-8'))
sign = H.hexdigest()

headers = {
    "Content-type": "application/x-www-form-urlencoded",
    "key": api_key,
    "Sign": sign
}

endpoint = "https://api.exmo.com"
req = "/v1/order_create"

r = requests.post(endpoint + req, data=params, headers=headers)

print(r.text)