NAV Navbar
shell

Public API

This API doesn't require any authentication.

API endpoint: https://virtuse.exchange/api/v1

All requests to this API must be POST-requests with header "Content-Type": "application/json". Request and response bodies are always in JSON.

The server returns HTTP 200 code if a request has been processed.

Every request body must have method property.

If a method call has been succeed than response contains data, otherwise it contains an object with error property with error code you can find in our Error codes list

There is a limit on number of API requests: 3 requests per second for an IP-address.

Get ticker

curl "https://virtuse.exchange/api/v1" \
  -X POST \
  -H "Content-Type: application/json" \
  -d '{"method": "public/get_ticker", "pair": "ETH_BTC"}'

The above command returns JSON structured like this:

{
  "ETH_BTC": {
    "low": "0.019836",
    "last": "0.019866",
    "open": "0.020038",
    "high": "0.020121",
    "volume": { "base": "899.99186723", "quote": "18.02275815907166" },
    "base": "ETH",
    "quote": "BTC",
    "type": "crypto"
  }
}

Method name

public/get_ticker

This method returns 24h price information for the selected symbol. If pair parameter is not defined, it will return summary information for all pairs that renews every 30 seconds, otherwise it will return the latest information for a selected pair without any caching.

Input parameters

Parameter Description Mandatory
pair A trading pair code, base and quote currencies separated by "_" symbol no

Output model

An associative array with indexes containing pair codes. Each element of the array is an object with following properties:

Property Description Mandatory
open Open price of 24h period yes
high Highest price of 24h period yes
low Lowest price of 24h period yes
last Latest price of 24h period yes
volume An object with two properties, 24h trading volume in base and quote currencies yes
base Base currency yes
quote Quote currency yes
type Type of the base currency: crypto or digital asset yes

Get currencies

curl "https://virtuse.exchange/api/v1" \
  -X POST \
  -H "Content-Type: application/json" \
  -d '{"method": "public/get_currencies"}'

The above command returns JSON structured like this:

{
  "BTC": {
    "withdrawal_is_active": true,
    "deposit_is_active": false,
    "withdrawal_fee_min": "0.001",
    "withdrawal_fee": "0.15"
  },
  "ETH": {
    "withdrawal_is_active": true,
    "deposit_is_active": true,
    "withdrawal_fee_min": "0.01",
    "withdrawal_fee": "0.15"
  }
}

Method name

public/get_currencies

This method returns a list of all currencies present on the exchange and information on them.

Input parameters

The are no input parameters for this method.

Output model

An associative array with indexes containing currency codes. Each element of the array is an object with following properties:

Property Description Mandatory
withdrawal_is_active Withdraw function status of selected currency yes
deposit_is_active Deposit function status of selected currency yes
withdrawal_fee_min Minimal withdrawal fee for selected currency, absolute value in selected currency yes
withdrawal_fee Withdrawal fee for selected currency, as a percentage yes

Get trading pairs

curl "https://virtuse.exchange/api/v1" \
  -X POST \
  -H "Content-Type: application/json" \
  -d '{"method": "public/get_pairs"}'

The above command returns JSON structured like this:

{
  "ETH_BTC": {
    "is_active": true,
    "min_amount": "40",
    "min_price": "0.000001",
    "price_step": "0.0000001",
    "amount_step": "10"
  },
  "ETH_ETH": {
    "is_active": false,
    "min_amount": "40",
    "min_price": "0.00001",
    "price_step": "0.000001",
    "amount_step": "10"
  }
}

Method name

public/get_pairs

This method returns a list of all trading pairs present on the exchange and information on them.

Input parameters

The are no input parameters for this method.

Output model

An associative array with indexes containing trading pairs names. Each element of the array is an object with following properties:

Property Description Mandatory
is_active Shows status of trading for the selected pair yes
min_amount Minimum amount for placing an order yes
min_price Minimum price for placing an order yes
price_step Price step for placing an order yes
amount_step Amount step for placing an order yes

Get order book

curl "https://virtuse.exchange/api/v1" \
  -X POST \
  -H "Content-Type: application/json" \
  -d '{"method": "public/get_order_book","pair": "ETH_ETH", "limit": 3}'

The above command returns JSON structured like this:

{
  "asks": [
    { "price": "0.00002538", "amount": "0.3112" },
    { "price": "0.00002539", "amount": "1.55" },
    { "price": "0.00002540", "amount": "0.6343" }
  ],
  "bids": [
    { "price": "0.00002536", "amount": "0.1434" },
    { "price": "0.00002535", "amount": "0.65464" },
    { "price": "0.00002534", "amount": "2.657533" }
  ]
}

Method name

public/get_order_book

This method returns top of order book for the selected pair.

Input parameters

Parameter Description Mandatory
pair A trading pair code, base and quote currencies separated by "_" symbol yes
limit Number of price levels to return, default 100, maximum 100 no

Output model

An object with following properties:

Property Description Mandatory
asks An array of objects with 2 properties in each: price and amount, that represent respectively price level in the order book and total amount on orders on this level yes
bids An array of objects with 2 properties in each: price and amount, that represent respectively price level in the order book and total amount on orders on this level yes

Get last trades

curl "https://virtuse.exchange/api/v1" \
  -X POST \
  -H "Content-Type: application/json" \
  -d '{"method": "public/get_last_trades","pair": "ETH_BTC", "limit": 500}'

The above command returns JSON structured like this:

[
  {
    "trade_id": 12323,
    "price": "0.00002536",
    "amount": { "base": "485591.80457052", "quote": "12.32432" },
    "timestamp": 1568138743
  }
]

Method name

public/get_last_trades

This method returns last trades for the selected pair.

Input parameters

Parameter Description Mandatory
pair A trading pair code, base and quote currencies separated by "_" symbol yes
limit Number of trades to return, default 100, maximum 500 no

Output model

An array that contains objects with following properties:

Property Description Mandatory
trade_id ID of the trade yes
price Price of the trade yes
amount An object with two properties, base and quote that represent size of the trade in base and quote currency respectively yes
timestamp Unix timestamp of the trade

Get candlestick chart data

curl "https://virtuse.exchange/api/v1" \
  -X POST \
  -d '{"method": "public/get_chart_data", "pair": "ETH_BTC", "period": "1h", "timeFrom": 1575774142,"timeTo": 1575990142}'

The above command returns JSON structured like this:

[
  {
    "open": "0.00002538",
    "high": "0.000026",
    "low": "0.000025",
    "close": "0.00002545",
    "volume": { "base": "485591.80457052", "quote": "12.32432" },
    "timestamp": 1568138400
  }
]

Method name

public/get_chart_data

This method returns candlestick chart data for the selected pair.

Input parameters

Parameter Description Mandatory
pair A trading pair code, base and quote currencies separated by "_" symbol yes
period Period of a candle, correct values: "5m", "15m", "30m", "1h", "6h", "1d", "3d", "1w", "2w", "1M" yes
timeFrom Unix timestamp no
timeTo Unix timestamp, maximum time interval mustn't exceed 60 periods no

Output model

An array that contains objects with following properties:

Property Description Mandatory
open Open price of the candle yes
high Highest price of the candle yes
low Lowest price of the candle yes
close Close price of the candle yes
volume An object with two properties, the candle trading volume in base and quote currencies yes
timestamp Unix timestamp of beginning of the candle period yes

Spot Trading API

This API requires authentication using HMAC SHA512 signature that must be calculated from the request body and then included into Signature header. Property key_id must be included into the request body before signing.

API endpoint: https://virtuse.exchange/api/v1

All requests to this API must be POST-requests with header "Content-Type": "application/json". Request and response bodies are always in JSON.

The server returns HTTP 200 code if a request has been processed.

Every request body must have method property.

If a method call has been succeed than the response contains data, otherwise it contains an object with error property with error code you can find in our Error codes list

There is a limit on number of API requests: 3 requests per second for a user.

Get trading fees

curl "https://virtuse.exchange/api/v1" \
  -X POST \
  -H "Content-Type: application/json" \
  -H "Signature: 6aaef6ed1f5491b27e3c5cae835d78522ced21ba7840ed15d65f1a1ae84cec9f6e21b9dd505846920c23355d1e33cc6b0afc44d5394de7b8c58b213654fa92f3" \
  -d '{"method": "spot/get_trading_fees","key_id": "60b9fc508d32e6ce81dbb422abd638a2"}'

The above command returns JSON structured like this:

"0.001"

Method name

spot/get_trading_fees

This method returns the current trading fee.

Input parameters

The are no input parameters for this method.

Output model

The size of trading fee in percents divided by 100

Place an order

curl "https://virtuse.exchange/api/v1" \
  -X POST \
  -H "Content-Type: application/json" \
  -H "Signature: 6aaef6ed1f5491b27e3c5cae835d78522ced21ba7840ed15d65f1a1ae84cec9f6e21b9dd505846920c23355d1e33cc6b0afc44d5394de7b8c58b213654fa92f3" \
  -d '{"method": "spot/place_order","key_id": "60b9fc508d32e6ce81dbb422abd638a2", "side": "sell", "type":"limit", "pair": "ETH_BTC", "amount": "3421.32424", "price": "0.00003214"}'

The above command returns JSON structured like this:

3833954

Method name

spot/place_order

This method places an order and returns it's id.

Input parameters

Parameter Description Mandatory
pair A trading pair code, base and quote currencies separated by "_" symbol yes
side Is it buy or sell order yes
type There are two order types on the exchange: limit and market yes
amount Amount of the order, in quote currency for a market buy order and base currency for others yes
price Limit price of the order no

Output model

Order ID - an integer with ID of the created order

Cancel an order

curl "https://virtuse.exchange/api/v1" \
  -X POST \
  -H "Content-Type: application/json" \
  -H "Signature: 6aaef6ed1f5491b27e3c5cae835d78522ced21ba7840ed15d65f1a1ae84cec9f6e21b9dd505846920c23355d1e33cc6b0afc44d5394de7b8c58b213654fa92f3" \
  -d '{"method": "spot/cancel_order","key_id": "60b9fc508d32e6ce81dbb422abd638a2", "pair": "ETH_BTC", "order_id": 3833954}'

The above command returns JSON structured like this:

3833954

Method name

spot/cancel_order

This method cancels an order and returns it's id.

Input parameters

Parameter Description Mandatory
pair A trading pair code, base and quote currencies separated by "_" symbol yes
order_id ID of the order to cancel, integer yes

Output model

Order ID - an integer with ID of the canceled order

Get active orders

curl "https://virtuse.exchange/api/v1" \
  -X POST \
  -H "Content-Type: application/json" \
  -H "Signature: 6aaef6ed1f5491b27e3c5cae835d78522ced21ba7840ed15d65f1a1ae84cec9f6e21b9dd505846920c23355d1e33cc6b0afc44d5394de7b8c58b213654fa92f3" \
  -d '{"method": "spot/get_active_orders","key_id": "60b9fc508d32e6ce81dbb422abd638a2", "pair": "ETH_BTC"}'

The above command returns JSON structured like this:

[
  {
    "left": "0.81219372",
    "type": "limit",
    "side": "buy",
    "price": "0.01775",
    "amount": "0.81219372",
    "order_id": 3964050,
    "fees": "0",
    "placed": 1576257714,
    "updated": 1576257714,
    "filled": {
      "base": "0",
      "quote": "0"
    }
  }
]

Method name

spot/get_active_orders

This method returns a list of all active orders for the selected pair.

Input parameters

Parameter Description Mandatory
pair A trading pair code, base and quote currencies separated by "_" symbol yes

Output model

An array that contains objects with following properties:

Property Description Mandatory
order_id Order ID, integer yes
placed Unix timestamp, time when order was placed yes
updated Unix timestamp, time when order was updated yes
side Is it buy or sell order yes
type There are two order types on the exchange: limit and market yes
amount Amount of the order yes
left Left amount of the order yes
price Limit price of the order no
filled Filled amount, object with base and quote amount yes
fees If side is buy - amount of fee in base currency, sell - in quote currency, that charged from filled part yes

Get executed orders

curl "https://virtuse.exchange/api/v1" \
  -X POST \
  -H "Content-Type: application/json" \
  -H "Signature: 6aaef6ed1f5491b27e3c5cae835d78522ced21ba7840ed15d65f1a1ae84cec9f6e21b9dd505846920c23355d1e33cc6b0afc44d5394de7b8c58b213654fa92f3" \
  -d '{"method": "spot/get_executed_orders","key_id": "60b9fc508d32e6ce81dbb422abd638a2", "pair": "ETH_BTC", "from": 1576259205, "to": 1576262805}'

The above command returns JSON structured like this:

[
  {
    "amount": "0.37738912",
    "type": "limit",
    "price": "0.019967",
    "side": "buy",
    "order_id": 3972854,
    "fees": "0",
    "placed": 1576262787,
    "filled": {
      "base": "0.37631411",
      "quote": "0.00749128498777"
    }
  }
]

Method name

spot/get_executed_orders

This method returns a list of executed orders for the selected pair.

Input parameters

Parameter Description Mandatory
pair A trading pair code, base and quote currencies separated by "_" symbol yes
from Unix timestamp yes
to Unix timestamp yes
limit Number of orders to return, default 10, maximum 50 no

Output model

An array that contains objects with following properties:

Property Description Mandatory
order_id Order ID, integer yes
placed Unix timestamp, time when order was placed yes
side Is it buy or sell order yes
type There are two order types on the exchange: limit and market yes
amount Amount of the order yes
price Limit price of the order no
filled Filled amount, object with base and quote amount yes
fees If side is buy - amount of fee in base currency, sell - in quote currency, that charged from filled part yes

Get order

curl "https://virtuse.exchange/api/v1" \
  -X POST \
  -H "Content-Type: application/json" \
  -H "Signature: 6aaef6ed1f5491b27e3c5cae835d78522ced21ba7840ed15d65f1a1ae84cec9f6e21b9dd505846920c23355d1e33cc6b0afc44d5394de7b8c58b213654fa92f3" \
  -d '{"method": "spot/get_order","key_id": "60b9fc508d32e6ce81dbb422abd638a2", "order_id": 3972854, "status": "executed"}'

The above command returns JSON structured like this:

[
  {
    "amount": "0.37738912",
    "type": "limit",
    "price": "0.019967",
    "side": "buy",
    "order_id": 3972854,
    "fees": "0",
    "placed": 1576262787,
    "filled": {
      "base": "0.37631411",
      "quote": "0.00749128498777"
    }
  }
]

Method name

spot/get_order

This method returns information about an order.

Input parameters

Parameter Description Mandatory
pair A trading pair code, base and quote currencies separated by "_" symbol yes
order_id Order ID, integer yes
status executed or active yes

Output model

An object with following properties:

Property Description Mandatory
order_id Order ID, integer yes
placed Unix timestamp, time when order was placed yes
side Is it buy or sell order yes
type There are two order types on the exchange: limit and market yes
amount Amount of the order yes
price Limit price of the order no
filled Filled amount, object with base and quote amount yes
fees If side is buy - amount of fee in base currency, sell - in quote currency, that charged from filled part yes

Get my trades

curl "https://virtuse.exchange/api/v1" \
  -X POST \
  -H "Content-Type: application/json" \
  -H "Signature: 6aaef6ed1f5491b27e3c5cae835d78522ced21ba7840ed15d65f1a1ae84cec9f6e21b9dd505846920c23355d1e33cc6b0afc44d5394de7b8c58b213654fa92f3" \
  -d '{"method": "spot/get_my_trades","key_id": "60b9fc508d32e6ce81dbb422abd638a2", "pair": "ETH_BTC"}'

The above command returns JSON structured like this:

[
  {
    "side": "buy",
    "price": "0.019836",
    "fee": "0",
    "amount": {
      "base": "0.32727536",
      "quote": "0.00649183404096"
    },
    "timestamp": 1576513932,
    "trade_id": 1656069,
    "order_id": 4391157
  }
]

Method name

spot/get_my_trades

This method returns list of trades for the selected pair.

Input parameters

Parameter Description Mandatory
pair A trading pair code, base and quote currencies separated by "_" symbol yes
offset Offset for the selection, default 0 no
limit Number of orders to return, default 10, maximum 30 no

Output model

An array that contains objects with following properties:

Property Description Mandatory
trade_id Trade ID, integer yes
order_id Order ID , integer yes
timestamp Unix timestamp, the trade time yes
side Was it user's buy or sell order yes
amount Amount of the trade, object with base and quote amount yes
price Price of the trade yes
fee Fee of the trade yes

Get order trades

curl "https://virtuse.exchange/api/v1" \
  -X POST \
  -H "Content-Type: application/json" \
  -H "Signature: 6aaef6ed1f5491b27e3c5cae835d78522ced21ba7840ed15d65f1a1ae84cec9f6e21b9dd505846920c23355d1e33cc6b0afc44d5394de7b8c58b213654fa92f3" \
  -d '{"method": "spot/get_order_trades","key_id": "60b9fc508d32e6ce81dbb422abd638a2", "order_id": 4393868}'

The above command returns JSON structured like this:

[
  {
    "price": "0.019841",
    "amount": {
      "base": "0.29795537",
      "quote": "0.00591173249617"
    },
    "fee": "0",
    "timestamp": 1576515477,
    "trade_id": 1657003
  }
]

Method name

spot/get_order_trades

This method returns list of trades for a particular order.

Input parameters

Parameter Description Mandatory
order_id An order ID, integer yes
offset Offset for the selection, default 0 no
limit Number of orders to return, default 10, maximum 30 no

Output model

An array that contains objects with following properties:

Property Description Mandatory
trade_id Trade ID, integer yes
timestamp Unix timestamp, the trade time yes
amount Amount of the trade, object with base and quote amount yes
price Price of the trade yes
fee Fee of the trade yes

Get balances

curl "https://virtuse.exchange/api/v1" \
  -X POST \
  -H "Content-Type: application/json" \
  -H "Signature: 6aaef6ed1f5491b27e3c5cae835d78522ced21ba7840ed15d65f1a1ae84cec9f6e21b9dd505846920c23355d1e33cc6b0afc44d5394de7b8c58b213654fa92f3" \
  -d '{"method": "spot/get_balances","key_id": "60b9fc508d32e6ce81dbb422abd638a2", "currency": "BTC"}'

The above command returns JSON structured like this:

{
  "BTC": {
    "available": "0.1213",
    "total": "2.5213",
    "on_orders": "2.4"
  }
}

Method name

spot/get_balances

This method returns list of balances for the selected currency.

Input parameters

Parameter Description Mandatory
currency Currency code no

Output model

An associative array with indexes containing currencies names that contains objects with following properties:

Property Description Mandatory
available Available amount for placing orders yes
total Total amount of the currency on balance yes
on_orders Amount, currently used in placed orders yes

Errors

The Virtuse API uses the following error codes for error property of a response:

error Meaning
40001 Unauthorized, not enough privileges
40101 Wrong method
40102 Wrong parameter
40103 Missed parameter
40201 Order amount is less than minimum
40202 Order price is less than minimum
40203 Wrong amount step
40204 Wrong price step
40221 Order doesn't exist
40222 Order rejected
40231 Not enough funds
50000 Unknown error