About

Iqfinex public API provides access to Iqfinex’s market information with the help of REST requests. Any questions you have can be asked to our mail info@iqfinex.com or in telegram group https://t.me/iqfinexairdrop.

API URL

https://datacenter.iqfinex.com/

Authorization

In order to access authorized section methods you need to create an api key. Api key can be generated in the personal cabinet on API page. It is recommended to restrict your key to a certain ip for better security. Received key you need to add to the header Authorization of the each http request to authorized methods. Account info request can be used for testing connection.

HTTP Status codes
Code Description
200 OK Successful request
400 Bad Request. Returns JSON with the error message
401 Invalid login data
402 Forbidden. Action is forbidden for API key
403 Authorization token expired
500 Internal Server Error
503 Service Unavailable. Service is down for maintenance
504 Gateway Timeout. Request timeout expired

Time format

All dates are returned in timestamp(seconds) format in UTC. Example: "1543657837"

Public API

Currencies

Get available currencies.

GET /v1/currencies
GET /v1/currency/:name
Result fields
Field Type Description
name string Ticker
alias string Full name
commission double withdrawal commission
type string "Coin" or "Token"
confirmations int number of confirmations to accept incoming deposit
min_withdrawal double minimal volume to witdrawal
min_deposit double minimal volume to deposit
isDeposit bool is deposit enabled
isWithdrawal bool is withdrawal enabled
Request example
https://datacenter.iqfinex.com/v1/currency/BTC
Response example
{
    "status":200,
    "data":{
        "name":"BTC",
        "alias":"Bitcoin",
        "commission":0.0005,
        "type":"Coin",
        "confirmations":6,
        "min_withdrawal":0.001,
        "min_deposit":0.001,
        "isDeposit":true,
        "isWithdrawal":true
    }
}

Assets

Get available trading pairs.

GET /v1/assets
GET /v1/asset/:name
Result fields
Field Type Description
pair string asset name
right string Right currency of asset
left string Left currency of asset
accuracy string Price digits number
min_volume double minimal amount to open order
isTrade bool is trade allowed
Request example
https://datacenter.iqfinex.com/v1/asset/BTCUSDT
Response example
{
    "status":200,
    "data":{
        "pair":"BTCUSDT",
        "right":"USDT",
        "left":"BTC",
        "accuracy":2,
        "min_volume":0.001,
        "isTrade":true
    }
}

Tickers

Ticker shows the best current bid and ask, as well as the last trade price. It also includes information about the current daily candle (daily volume, open, high and low prices).

GET /v1/tickers
GET /v1/ticker/:asset
Result fields
Field Type Description
bid double price of the best buy order in orderbook
ask double price of the best sell order in orderbook
bid_vol double volume of the order with bid price
ask_vol double volume of the order with ask price
buy_size double Total volume of buy orders
sell_size double Total volume of sell orders
high double Daily highest price
low double Daily lowest price
last double Last trade price
volume24 double Daily trade volume
percentChange double daily percent price change
timestamp int UTC in seconds
Request example
https://datacenter.iqfinex.com/v1/ticker/BTCUSDT
Response example
{
    "status":200,
    "data":{
        "bid":3368.69,
        "ask": 3376.13,
        "bid_vol": 0.8359902,
        "ask_vol": 3.3522075,
        "buy_size": 144.0633642,
        "sell_size": 29.8255086,
        "high": 3530.87,
        "low": 3342.87,
        "last": 3373.18,
        "volume24": 198.65963,
        "percentChange": -3.89,
        "timestamp":1552290919
    }
}

Orderbook

An order book is a list of buy and sell orders for a specific asset, organized by a price. In url you should specify asset(BTCUSDT) and rounding level. Rounding level can take 0 - 3 values and denote the number of digits to round.
Here is how BTCUSDT price "3632.12" will look like on different rounding levels:
0 level : "3632.12";
1 level : "3632.1";
2 level : "3632";
3 level : "3630".

GET /v1/orderbook/:asset/:rounding
Result fields
Field Type Description
buy Object Object, where keys are prices of buy orders and values are an arrays with the first element - price volume, second - number of aggregated orders
sell Object Object, where keys are prices of sell orders and values are an arrays with the first element - price volume, second - number of aggregated orders
Request example
https://datacenter.iqfinex.com/v1/orderbook/BTCUSDT/0
Response example
{
    "status":200,
    "data":{
        "buy": {
            "3373": [ // "price"
                0.03, // "volume" 
                1     // "positions"  
            ],
            "3375": [
                0.312,
                1
            ],
            "3376": [
                0.0024783,
                1
            ],
            "3377": [
                0.15,
                1
            ],
        },
        "sell": {
            "3395": [
                0.2297748,
                1
            ],
            "3396": [
                0.015,
                1
            ],
            "3397": [
                0.0896475,
                1
            ],
            "3398": [
                1.2776565,
                2
            ]
        }    
    }
}

Trades

Get a list of the most recent trades for the given trading pair

GET /v1/trades/:asset
Parameters
Field Type Description
limit integer Optional. Number of rows to return. Default 10. Max 100.
offset integer Optional. Number of rows to skip before rows selection. Default 0
sort string Optional. Sort direction. Accepted values: ASC, DESC. Default DESC
Result fields
Field Type Description
id integer Trade personal id
volume double Trade volume
price string Trade price
close_time intger Trade time in timestamp UTC seconds
type string Type of trade. Values : buy or sell. Depends on taker and maker sides.
Request example
https://datacenter.iqfinex.com/v1/trades/BTCUSDT?limit=3&sort;=DESC
Response example
{
    "status":200,
    "data":{
        "count": 134204,
        "rows": [
            {
                "id": 752986,
                "type": "sell",
                "volume": 0.030548,
                "price": 3388.65,
                "close_time": 1544180753,
                "asset": "BTCUSDT"
            },
            {
                "id": 752977,
                "type": "buy",
                "volume": 0.050624,
                "price": 3388.45,
                "close_time": 1544180720,
                "asset": "BTCUSDT"
            },
            {
                "id": 752966,
                "type": "sell",
                "volume": 0.055038,
                "price": 3389.29,
                "close_time": 1544180681,
                "asset": "BTCUSDT"
            }
        ]
    }
}

Candles

Get recent candle history for the given trading pair. Candles are used for the price moving representation. We follow OHLC chart format. "Frame" parameter is a candle size in seconds. Available frames: 60,120,300,900,1800,3600,7200,14400,28800,43200,86400,604800.

GET /v1/candles/:asset/:frame
Parameters
Field Type Description
limit integer Optional. Number of rows to return. Default 20. Max 500.
offset integer Optional. Number of rows to skip before rows selection. Default 0
Request example
https://datacenter.iqfinex.com/v1/candles/ETHBTC/300?limit=3
Response example
{
    "status":200,
    "data":{
        "count":3600
        "rows":[
            [
                0.034375,  // "open"
                0.034399,  // "high"
                0.03428,   // "low" 
                0.034381,  // "close"
                4.1961     // "volume"
                           // "no close time because candle is still active"
            ],
            [
                0.034322,  // "open"
                0.034425,  // "high"
                0.03417,   // "low"
                0.034375,  // "close"
                15.3358,   // "volume"
                1552378200 // "close time"
            ],
            [
                0.034358,
                0.034358,
                0.0339,
                0.034322,
                30.36213,
                1552377900
            ]
        ]
    }   
}

Authorized API

Account Info

Get personal information and permissions of the api key.

GET /v1/account/info
Result fields
Field Type Description
id integer personal identificator
email string account email
role integer ignore
keylabel string label of the api token
isTrade bool is available to open/cancel orders
isWithdrawal bool is available to make withdrawals
whitelist string ip whitelist separated by ","
Request example
https://datacenter.iqfinex.com/v1/account/info
Response example
{
    "status":200,
    "data":{
        "id": 1,
        "email": "test@test.com",
        "role": 1,
        "keylabel": "Development",
        "isTrade": false,
        "isWithdrawal": false,
        "whitelist": "1.1.1.1,2.2.2.2"
    }
}

Balance

Get balance of the each coin.

GET /v1/balance
Result fields
Field Type Description
balance double all balance including opened orders and pending withdrawals
free_balance string available balance
Request example
https://datacenter.iqfinex.com/v1/balance
Response example
{
    "status":200,
    "data":{
        "BTC": {
            "balance": 1.5,
            "free_balance": 1.2
        },
        "BTG": {
            "balance": 0,
            "free_balance": 0
        },
        "ETH": {
            "balance": 52.48052531,
            "free_balance": 52.48052531
        }
    }
}

Open order

Open limit/market/stop-limit order.

POST /v1/order
Body parameters
Field Type Description
asset string asset name (for example ETHBTC)
cmd string type of order, can be "buy" or "sell"
volume double order size in left currency (for example in ETHBTC - ETH)
price double Optional. Order price for 1 volume in right currency (for example in ETHBTC - BTC). If not specified order will be executed by market price (market order).
stopPrice double Optional. if specified, order will be opened only when the market price reach or overcome stopPrice (stop-limit order).
Result fields
Field Type Description
id integer id of opened order
asset string order asset
cmd string order type
volume double order size
price double order price (if limit or stop-limit order)
stopPrice double order stop price (if stop-limit order).
open_time integer UTC in seconds
Request example
POST https://datacenter.iqfinex.com/v1/order
Body:{
    "asset": "ETHBTC",
    "cmd": "sell",
    "volume": 1.245,
    "price": 0.03437,
}
Response example
{
    "status":200,
    "data":{
        "id": 304962
        "asset": "ETHBTC",
        "cmd": "sell",
        "volume": 1.245,
        "price": 0.03437,
        "open_time": 1552371582
    }
}

Cancel order

Cancel opened order by id. Id of order returns in response of open order request. You can both get orders to cancel by opened orders request.

POST /v1/order/:id/cancel
Result fields
Field Type Description
id integer id of opened order
asset string order asset
cmd string order type
volume double order size
price double order price
stopPrice double order stop price (if stop-limit order).
open_time integer UTC in seconds
Request example
POST https://datacenter.iqfinex.com/v1/order/304964/cancel
Response example
{
    "status":200,
    "data": {
        "id": 304964
        "asset": "ETHBTC",
        "cmd": "sell",
        "volume": 1.52,
        "price": 0.03437,
        "open_time": 1552460758,
    }        
}

Opened orders

Get opened orders list.

GET /v1/orders/opened
Result fields
Field Type Description
id integer id of opened order
asset string order asset
cmd string order type
volume double order size
price double order price
stopPrice double order stop price (if stop-limit order).
open_time integer UTC in seconds
Request example
https://datacenter.iqfinex.com/v1/orders/opened
Response example
{
    "status":200,
    "data": {
        "count": 1,
        "rows": [
            {
                "id": 304963
                "asset": "ETHBTC",
                "cmd": "sell",
                "volume": 1.52,
                "price": 0.03437,
                "open_time": 1552398562,
            }
        ]
    }
}

Closed orders

Get closed orders history.

GET /v1/orders/closed
Parameters
Field Type Description
limit integer Optional. Number of rows to return. Default 20. Max 100
offset integer Optional. Number of rows to skip before rows selection. Default 0
sort string Optional. Sort direction. Accepted values: ASC, DESC. Default DESC
Result fields
Field Type Description
id integer id of opened order
asset string order asset
cmd string order type
volume double order size
price double order price
open_time integer UTC in seconds
close_time integer UTC in seconds
Request example
https://datacenter.iqfinex.com/v1/orders/closed?limit=3&offset;=0&sort;=DESC
Response example
{
    "status":200,
    "data": {
        "count": 95,
        "rows": [
            {
                "id": 305283,
                "asset": "ETHBTC",
                "cmd": "sell",
                "volume": 1.12,
                "price": 0.03437,
                "open_time": 1551767713,
                "close_time": 1551767713
            },
            {
                "id": 305282,
                "asset": "ETHBTC",
                "cmd": "buy",
                "volume": 1,
                "price": 0.03432,
                "open_time": 1551767709,
                "close_time": 1551767713
            },
            {
                "id": 305281,
                "asset": "ETHBTC",
                "volume": 1,
                "cmd": "sell",
                "price": 0.03457,
                "open_time": 1551767670,
                "close_time": 1551767695
            }
        ]
    }
}

Order status

Get opened order info by id. Can be used for checking order for activeness. When order closed it is no more shows by this request.

GET /v1/order/opened/:id
Result fields
Field Type Description
id integer id of opened order
asset string order asset
cmd string order type
volume double order size
price double order price
stopPrice double order stop price (if stop-limit order).
open_time integer UTC in seconds
Request example
https://datacenter.iqfinex.com/v1/order/opened/304965
Response example
{
    "status":200,
    "data": {
        "id": 304965
        "asset": "ETHBTC",
        "cmd": "sell",
        "volume": 1,
        "price": 2,
        "open_time": 1552461849,
    }
}