|
Documentation API v3
Public market
Public pool
Private market
Private pool
Private account
Method:
GET /api/v3/market_data/
This method allows fetching market data on spot markets.
Parameters:
pair (market ticker) optional
- multiple markets can be specified separated by commas
- examples: btc_usdt or btc_usdt,eth_usdt
- default is all markets
PHP Request Example:
$base_url = 'https://Mubadil.com';
$method = '/api/v3/market_data/';
$param['pair'] = 'btc_usdt,eth_usdt';
$params = '?'.http_build_query($param);
$ch = curl_init($base_url.$method.$params);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
curl_close($ch);
The above example will return market data only for the BTC/USDT and ETH/USDT markets.
Return:
{
"result":"success",
"list":{
"btc_usdt":{
"price":69000,
"low":69000,
"high":69000,
"ask":0,
"bid":60048,
"trend":0,
"offer":0,
"liquidity":1.96287096,
"asset_1_volume":0,
"asset_2_volume":0,
"traders":0,
"trades":0,
"timestamp":1733460302
},
...
}
}
Description:
list - list of markets
price - last price
low - minimum price over 24 hours
high - maximum price over 24 hours
ask - best sell price
bid - best buy price
trend - price change over 24 hours
offer - total offer
liquidity - total liquidity
asset_1_volume - primary volume over 24 hours
asset_2_volume - secondary volume over 24 hours
traders - active traders over 24 hours
traders - executed trades over 24 hours
timestamp - data update timestamp
Method:
GET /api/v3/market_limit/
This method allows fetching trading limits on spot markets.
Parameters:
pair (market ticker) optional
- multiple markets can be specified separated by commas
- examples: btc_usdt or btc_usdt,eth_usdt
- default is all markets
PHP Request Example:
$base_url = 'https://Mubadil.com';
$method = '/api/v3/market_limit/';
$param['pair'] = 'btc_usdt,eth_usdt';
$params = '?'.http_build_query($param);
$ch = curl_init($base_url.$method.$params);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
curl_close($ch);
The above example will return trading limits only for the BTC/USDT and ETH/USDT markets.
Return:
{
"result":"success",
"list":{
"btc_usdt":{
"step_price":,
"decimal_price":0,
"min_price_buy":,
"max_price_buy":,
"min_price_sell":,
"max_price_sell":,
"min_amount":,
"step_amount":,
"decimal_amount":,
"min_volume":,
"step_volume":,
"decimal_volume":,
"timestamp":
},
...
}
}
Description:
list - list of markets
step_price - price step
decimal_price - price precision
min_price_buy - minimum buy price
max_price_buy - maximum buy price
min_price_sell - minimum sell price
max_price_sell - maximum sell price
min_amount - minimum amount
step_amount - amount step
decimal_amount - amount precision
min_volume - minimum volume
step_volume - volume step
decimal_volume - volume precision
timestamp - data update timestamp
Method:
GET /api/v3/market_depth/
This method allows fetching the order book depth on spot markets.
Parameters:
pair (market ticker) optional
- multiple markets can be specified separated by commas
- examples: btc_usdt or btc_usdt,eth_usdt
- default is all markets
limit (number of orders) optional
- specify from 1 to 100 orders
- default is 10 orders
PHP Request Example:
$base_url = 'https://Mubadil.com';
$method = '/api/v3/market_depth/';
$param['pair'] = 'btc_usdt,eth_usdt';
$param['limit'] = 25;
$params = '?'.http_build_query($param);
$ch = curl_init($base_url.$method.$params);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
curl_close($ch);
The above example will return the top 25 orders grouped by price for buying/selling only for the BTC/USDT and ETH/USDT markets.
Return:
{
"result":"success",
"list":{
"btc_usdt":{
"asks": [
[,],
[,],
[,],
...
],
"bids": [
[60048,0.00000572],
[60020,0.00001032],
[41000,0.00002439],
...
]
},
...
}
}
Description:
list - list of markets
asks - sell orders [price,quantity]
bids - buy orders [price,quantity]
Method:
GET /api/v3/market_trades/
This method allows fetching the history of recent trades on spot markets.
Parameters:
pair (market ticker) optional
- multiple markets can be specified separated by commas
- examples: btc_usdt or btc_usdt,eth_usdt
- default is all markets
from (start timestamp) optional
- example: 1697300000
- default is absent
to (end timestamp) optional
- example: 1697310000
- default is absent
limit (number of trades) optional
- specify from 1 to 100 trades
- default is 10 trades
PHP Request Example:
$base_url = 'https://Mubadil.com';
$method = '/api/v3/market_history/';
$param['pair'] = 'btc_usdt,eth_usdt';
$param['limit'] = 15;
$param['from'] = 1697300000;
$param['to'] = 1697320000;
$params = '?'.http_build_query($param);
$ch = curl_init($base_url.$method.$params);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
curl_close($ch);
The above example will return the history of the last 15 trades only for the BTC/USDT and ETH/USDT markets.
Return:
{
"result":"success",
"list":{
"s11_usdt":[
{
"trade_id":1,
"type":"buy",
"amount":1,
"price":0.1,
"timestamp":1697390831
},
...
]
...
}
}
Description:
result - result of the request
list - list of markets
order_id - order identifier
type - order type
amount - order primary volume
price - order price
timestamp - trade execution timestamp
Method:
GET /api/v3/pool_data/
This method allows obtaining market data on liquidity pools.
Parameters:
pair (market ticker) optional
- you can specify multiple markets separated by commas
- examples: btc_usdt or btc_usdt,eth_usdt
- by default, all markets
PHP Request Example:
$base_url = 'https://mubadil.com';
$method = '/api/v3/pool_data/';
$param['pair'] = 'btc_usdt,eth_usdt';
$params = '?'.http_build_query($param);
$ch = curl_init($base_url.$method.$params);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
curl_close($ch);
The above example will return market data only for the markets BTC/USDT and ETH/USDT.
Return:
{
"result":"success",
"list":{
"btc_usdt":{
"price":,
"low":,
"high":,
"trend":,
"offer":,
"liquidity":,
"asset_1_volume":,
"asset_2_volume":,
"traders":,
"trades":,
"providers":,
"timestamp":
},
...
},
}
Description:
list - list of markets
price - initial price
low - minimum price in the last 24 hours
high - maximum price in the last 24 hours
trend - price change in the last 24 hours
offer - total offer
liquidity - total liquidity
asset_1_volume - primary volume in the last 24 hours
asset_2_volume - secondary volume in the last 24 hours
traders - active traders in the last 24 hours
providers - liquidity providers
timestamp - data update timestamp
Method:
GET /api/v3/pool_limit/
This method allows retrieving trading limits on liquidity pools.
Parameters:
pair (market ticker) optional
- you can specify multiple markets separated by commas
- examples: btc_usdt or btc_usdt,eth_usdt
- by default, all markets
PHP Request Example:
$base_url = 'https://Mubadil.com';
$method = '/api/v3/pool_limit/';
$param['pair'] = 'btc_usdt,eth_usdt';
$params = '?'.http_build_query($param);
$ch = curl_init($base_url.$method.$params);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
curl_close($ch);
The above example will return trading limits only for the markets BTC/USDT and ETH/USDT.
Return:
{
"result":"success",
"list":{
"btc_usdt":{
"max_price_buy":,
"min_price_sell":,
"min_amount":,
"step_amount":,
"decimal_amount":,
"min_volume":,
"step_volume":,
"decimal_volume":,
"timestamp":
},
...
}
}
Description:
list - list of markets
max_price_buy - maximum buying price
min_price_sell - minimum selling price
min_amount - minimum quantity
step_amount - quantity step
decimal_amount - quantity precision
min_volume - minimum volume
step_volume - volume step
decimal_volume - volume precision
timestamp - timestamp of data update
Method:
GET /api/v3/pool_history/
This method allows retrieving the trade history on liquidity pools.
Parameters:
pair (market ticker) optional
- you can specify multiple markets separated by commas
- examples: btc_usdt or btc_usdt,eth_usdt
- by default, all markets
from (start timestamp) optional
- example: 1697300000
- by default, not specified
to (end timestamp) optional
- example: 1697310000
- by default, not specified
limit (number of trades) optional
- you can specify from 1 to 100 trades
- by default, 10 trades
PHP Request Example:
$base_url = 'https://mubadil.com';
$method = '/api/v3/pool_history/';
$param['pair'] = 'btc_usdt,eth_usdt';
$param['from'] = 12345;
$param['to'] = 123456789;
$param['limit'] = 25;
$params = '?'.http_build_query($param);
$ch = curl_init($base_url.$method.$params);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
curl_close($ch);
The above example will return the history of the last 15 trades only for the markets BTC/USDT and ETH/USDT.
Return:
{
"result":"success",
"list":{
"s11_usdt":[
{
"trade_id":1,
"type":"buy",
"amount":1,
"price":0.1,
"timestamp":1697390831
},
...
]
...
}
}
Description:
result - result of the request execution
list - list of markets
order_id - order identifier
type - order type
amount - order primary volume
price - order price
timestamp - timestamp of the trade execution
Method:
POST /api/v3/market_trade/
This method allows performing trading operations on spot markets.
Parameters:
pair (market ticker) mandatory
- example: btc_usdt
type (order type) mandatory
- example: buy for buying or sell for selling
amount (limit amount of coins) mandatory
- example: 0.01
price (limit price) mandatory
- example: 25000.
tonce (timestamp in milliseconds) mandatory
- should be less than the server timestamp
- should be greater for each request
PHP Request Examples:
To call this method, a digital signature is required via API keys v3, with trading permissions.
$base_url = 'https://Mubadil.com';
$method = '/api/v3/market_trade/';
$api_key = 'YOUR_API_KEY';
$secret_key = 'YOUR_API_SECRET';
$param['pair'] = 'btc_usd';
$param['type'] = 'buy';
$param['amount'] = 0.01;
$param['price'] = 25000;
$param['tonce'] = round(microtime(true) * 1000);
$params = http_build_query($param);
$sign = hash_hmac('sha256', $params, $secret_key);
$headers = [
'API-Key: ' . $api_key,
'API-Sign: ' . $sign
];
$ch = curl_init($base_url.$method);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$result = curl_exec($ch);
curl_close($ch);
The above example will execute a limit buy or create a buy order for 0.01 BTC at a price of 25000 BTC/USDT.
Return:
{
"result":"success",
"trade": {
"trade_id":1,
"pair":"btc_usd",
"type":"buy",
"amount":0.01,
"price":4900,
"timestamp":1586000000
}
"order": {
"order_id":2,
"pair":"btc_usd",
"type":"buy",
"amount":0.01,
"price":4900,
"timestamp":1586000000
}
}
Description:
trade - data for the executed trade
trade_id - trade identifier
pair - market ticker
type - trade type
amount - primary trade volume
price - trade price
timestamp - trade execution timestamp
order - data for the open order
order_id - order identifier
pair - market ticker
type - order type
amount - primary order volume
price - order price
timestamp - order opening timestamp
Method:
POST /api/v3/market_cancel/
This method allows canceling orders on spot markets.
Parameters:
order_id (order identifier) mandatory
- example: 123
tonce (timestamp in milliseconds) mandatory
- should be less than the server's timestamp
- should be greater for each request
PHP Request Examples:
To call this method, a digital signature is required through API keys v3, with trading permissions.
$base_url = 'https://Mubadil.com';
$method = '/api/v3/market_cancel/';
$api_key = 'YOUR_API_KEY';
$secret_key = 'YOUR_API_SECRET';
$param['order_id'] = 123;
$param['tonce'] = round(microtime(true) * 1000);
$params = http_build_query($param);
$sign = hash_hmac('sha256', $params, $secret_key);
$headers = [
'API-Key: ' . $api_key,
'API-Sign: ' . $sign
];
$ch = curl_init($base_url.$method);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$result = curl_exec($ch);
curl_close($ch);
The above example will cancel the order with the order identifier 123.
Return:
{
"result":"success"
}
Description:
result - the result of the request execution
Method:
POST /api/v3/market_orders/
This method allows fetching open orders on spot markets.
Parameters:
pair (market ticker) optional
- multiple markets can be specified separated by commas
- examples: btc_usdt or btc_usdt,eth_usdt
- default is all markets
tonce (timestamp in milliseconds) mandatory
- should be less than the server timestamp
- should be greater for each request
PHP Request Examples:
To call this method, a digital signature is required via API keys v3, with trading permissions.
$base_url = 'https://Mubadil.com';
$method = '/api/v3/market_orders/';
$api_key = 'YOUR_API_KEY';
$secret_key = 'YOUR_API_SECRET';
$param['pair'] = 'btc_usdt,eth_usdt';
$param['tonce'] = round(microtime(true) * 1000);
$params = http_build_query($param);
$sign = hash_hmac('sha256', $params, $secret_key);
$headers = [
'API-Key: ' . $api_key,
'API-Sign: ' . $sign
];
$ch = curl_init($base_url.$method);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$result = curl_exec($ch);
curl_close($ch);
The above example will return open orders only for the BTC/USDT and ETH/USDT markets.
Return:
{
"result":"success",
"data":{
"btc_usdt":[
{
"order_id":1,
"type":"buy",
"amount":0.01,
"price":27000,
"timestamp":1696779593
},
...
],
...
}
}
Description:
result - result of the request
list - list of markets
order_id - order identifier
type - order type
amount - primary order volume
price - order price
timestamp - order opening timestamp
Method:
POST /api/v3/market_trades/
This method allows retrieving the own trade history on spot markets.
Parameters:
pair (market ticker) optional
- you can specify multiple markets separated by commas
- examples: btc_usdt or btc_usdt,eth_usdt
- default is all markets
from (start timestamp) optional
- example: 1697300000
- default is not set
to (end timestamp) optional
- example: 1697310000
- default is not set
limit (number of trades) optional
- you can specify from 1 to 100 trades
- default is 10 trades
tonce (timestamp in milliseconds) mandatory
- should be less than the server timestamp
- should be greater for each request
PHP Request Examples:
To call this method, a digital signature is required via API keys v3, with trading permissions.
$base_url = 'https://mubadil.com';
$method = '/api/v3/market_trades/';
$api_key = 'YOUR_API_KEY';
$secret_key = 'YOUR_API_SECRET';
$param['pair'] = 'btc_usdt,eth_usdt';
$param['from'] = 1697300000;
$param['to'] = 1697320000;
$param['limit'] = 15;
$param['tonce'] = round(microtime(true) * 1000);
$params = http_build_query($param);
$sign = hash_hmac('sha256', $params, $secret_key);
$headers = [
'API-Key: ' . $api_key,
'API-Sign: ' . $sign
];
$ch = curl_init($base_url.$method);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$result = curl_exec($ch);
curl_close($ch);
The above example will return the trade history of the last 15 trades only for the markets BTC/USDT and ETH/USDT.
Return:
{
"result":"success",
"list":{
"s11_usdt":[
{
"trade_id":1,
"type":"buy",
"amount":1,
"price":0.1,
"unix_add":1697390831
},
...
]
...
}
}
Description:
result - result of the request execution
list - list of markets
order_id - order identifier
type - order type
amount - primary order volume
price - order price
timestamp - order opening timestamp
Method:
POST /api/v3/pool_add/
This method allows adding liquidity to liquidity pools.
Parameters:
pair (market ticker) mandatory
- example: btc_usdt
amount (primary liquidity) mandatory
- example: 0.01
tonce (timestamp in milliseconds) mandatory
- should be less than the server timestamp
- should be greater for each request
PHP Request Example:
To call this method, a digital signature is required via API keys v3, with trading permissions.
$base_url = 'https://mubadil.com';
$method = '/api/v3/pool_add/';
$api_key = 'YOUR_API_KEY';
$secret_key = 'YOUR_API_SECRET';
$param['pair'] = 'btc_usdt';
$param['amount'] = 0.01;
$param['tonce'] = round(microtime(true) * 1000);
$params = http_build_query($param);
$sign = hash_hmac('sha256', $params, $secret_key);
$headers = [
'API-Key: ' . $api_key,
'API-Sign: ' . $sign
];
$ch = curl_init($base_url.$method);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$result = curl_exec($ch);
curl_close($ch);
The above example will add liquidity of 0.01 BTC to the BTC/USDT pool.
Return:
{
"result":"success",
"data": {
"share_id":2,
"pair":"btc_usd",
"asset_1_amount":0.01,
"asset_2_amount":0.1,
"price":10,
"timestamp":1586000000
}
}
Description:
data - data about the added liquidity share
share_id - liquidity share identifier
pair - market ticker
asset_1_amount - added primary liquidity
asset_2_amount - added secondary liquidity
price - liquidity addition price
timestamp - timestamp of liquidity share addition
Method:
POST /api/v3/pool_trade/
This method allows performing trading operations on liquidity pools.
Parameters:
pair (market ticker) required
- example: btc_usdt
type (order type) required
- example: buy for buying or sell for selling
amount (amount of coins) required
- example: 0.01
tonce (timestamp in milliseconds) required
- must be less than the server's timestamp
- must be greater for each request
PHP Request Example:
To call this method, a digital signature is required through API keys v3, with trading rights.
$base_url = 'https://mubadil.com';
$method = '/api/v3/pool_trade/';
$api_key = 'YOUR_API_KEY';
$secret_key = 'YOUR_API_SECRET';
$param['pair'] = 'btc_usd';
$param['type'] = 'buy';
$param['amount'] = 0.01;
$param['tonce'] = round(microtime(true) * 1000);
$params = http_build_query($param);
$sign = hash_hmac('sha256', $params, $secret_key);
$headers = [
'API-Key: ' . $api_key,
'API-Sign: ' . $sign
];
$ch = curl_init($base_url.$method);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$result = curl_exec($ch);
curl_close($ch);
The example above will execute a purchase order for 0.01 BTC on the liquidity pool BTC/USDT.
Return:
{
"result":"success",
"trade": {
"trade_id":1,
"pair":"btc_usd",
"type":"buy",
"amount":0.01,
"price":4900,
"timestamp":1586000000
}
}
Description:
trade - data of the executed trade
trade_id - trade identifier
pair - market ticker
type - trade type
amount - primary trade amount
price - trade price
timestamp - timestamp of the trade
Method:
POST /api/v3/pool_cancel/
This method allows canceling liquidity shares on liquidity pools.
Parameters:
share_id (liquidity share identifier) mandatory
- example: 123
tonce (timestamp in milliseconds) mandatory
- should be less than the server timestamp
- should be greater for each request
PHP Request Example:
To call this method, a digital signature is required via API keys v3, with trading permissions.
$base_url = 'https://mubadil.com';
$method = '/api/v3/pool_cancel/';
$api_key = 'YOUR_API_KEY';
$secret_key = 'YOUR_API_SECRET';
$param['share_id'] = 12345;
$param['tonce'] = round(microtime(true) * 1000);
$params = http_build_query($param);
$sign = hash_hmac('sha256', $params, $secret_key);
$headers = [
'API-Key: ' . $api_key,
'API-Sign: ' . $sign
];
$ch = curl_init($base_url.$method);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$result = curl_exec($ch);
curl_close($ch);
The above example will cancel the liquidity share with the identifier 12345.
Return:
{
"result":"success"
}
Description:
result - result of the request execution
Method:
POST /api/v3/pool_shares/
This method allows retrieving open liquidity on liquidity pools.
Parameters:
pair (market ticker) optional
- you can specify multiple markets separated by commas
- examples: btc_usdt or btc_usdt,eth_usdt
- by default, all markets
tonce (timestamp in milliseconds) required
- must be less than the server's timestamp
- must be greater for each request
PHP Request Example:
To call this method, a digital signature is required through API keys v3, with trading rights.
$base_url = 'https://mubadil.com';
$method = '/api/v3/pool_shares/';
$api_key = 'YOUR_API_KEY';
$secret_key = 'YOUR_API_SECRET';
$param['pair'] = 'btc_usdt,eth_usdt';
$param['tonce'] = round(microtime(true) * 1000);
$params = http_build_query($param);
$sign = hash_hmac('sha256', $params, $secret_key);
$headers = [
'API-Key: ' . $api_key,
'API-Sign: ' . $sign
];
$ch = curl_init($base_url.$method);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$result = curl_exec($ch);
curl_close($ch);
The example above will return open liquidity shares only for the markets BTC/USDT and ETH/USDT.
Return:
{
"result":"success",
"list":{
"btc_usdt":[
{
"share_id":1,
"asset_1_amount":0.01,
"asset_2_amount":1,
"share":1,
"timestamp":1696779593
},
...
],
...
}
}
Description:
result - result of the request
list - list of markets
share_id - liquidity identifier
asset_1_amount - primary liquidity
asset_2_amount - secondary liquidity
share - liquidity share in percentage
timestamp - timestamp of liquidity addition
Method:
POST /api/v3/pool_trades/
This method allows you to retrieve your own trade history on liquidity pools.
Parameters:
pair (market ticker) optional
- you can specify multiple markets separated by commas
- examples: btc_usdt or btc_usdt,eth_usdt
- default is all markets
from (start timestamp) optional
- example: 1697300000
- default is absent
to (end timestamp) optional
- example: 1697310000
- default is absent
limit (number of trades) optional
- you can specify from 1 to 100 trades
- default is 10 trades
tonce (timestamp in milliseconds) required
- must be less than the server's timestamp
- must be greater for each request
PHP Request Example:
To call this method, a digital signature is required through API keys v3, with trading rights.
$base_url = 'https://mubadil.com';
$method = '/api/v3/pool_trades/';
$api_key = 'YOUR_API_KEY';
$secret_key = 'YOUR_API_SECRET';
$param['pair'] = 'btc_usdt';
$param['from'] = 1697300000;
$param['to'] = 1697310000;
$param['limit'] = 25;
$param['tonce'] = round(microtime(true) * 1000);
$params = http_build_query($param);
$sign = hash_hmac('sha256', $params, $secret_key);
$headers = [
'API-Key: ' . $api_key,
'API-Sign: ' . $sign
];
$ch = curl_init($base_url.$method);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$result = curl_exec($ch);
curl_close($ch);
The example above will return your own trade history only for the BTC/USDT market.
Return:
{
"result":"success",
"list":{
"s11_usdt":[
{
"trade_id":1,
"type":"buy",
"amount":1,
"price":0.1,
"timestamp":1697390831
},
...
]
...
}
}
Description:
result - result of the request
list - list of markets
order_id - order identifier
type - order type
amount - primary order amount
price - order price
timestamp - order opening timestamp
Method:
POST /api/v3/balances/
This method allows you to retrieve balances.
Parameters:
ticker (coin ticker) optional
- you can specify multiple coins separated by commas
- examples: btc or btc,eth
- default is all coins
tonce (timestamp in milliseconds) mandatory
- must be less than the server timestamp
- must be greater for each request
PHP Request Example:
To call this method, a digital signature through API keys v3 with read permissions is required.
$base_url = 'https://mubadil.com';
$method = '/api/v3/balances/';
$api_key = 'YOUR_API_KEY';
$secret_key = 'YOUR_API_SECRET';
$param['ticker'] = 'btc,eth';
$param['tonce'] = round(microtime(true) * 1000);
$params = http_build_query($param);
$sign = hash_hmac('sha256', $params, $secret_key);
$headers = [
'API-Key: ' . $api_key,
'API-Sign: ' . $sign
];
$ch = curl_init($base_url.$method);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$result = curl_exec($ch);
curl_close($ch);
The above example will return balances only for BTC and ETH coins.
Response:
{
"result":"success",
"list":{
"btc":{
"spot":0.01,
"in_orders":0.01,
"in_pools":0.01,
"advertising":0.1,
"in_advertising":0.1
},
...
}
}
Description:
result - result of the request execution
list - list of coins
spot - spot account
in_orders - funds in orders
in_pools - funds in pools
advertising - advertising account
in_advertising - funds in advertising
Method:
POST /api/v3/currencies/
This method allows you to retrieve data about coins.
Parameters:
ticker (coin ticker) optional
- you can specify multiple coins separated by commas
- examples: btc or btc,eth
- default is all coins
tonce (timestamp in milliseconds) mandatory
- must be less than the server timestamp
- must be greater for each request
PHP Request Example:
To call this method, a digital signature through API keys v3 with trading permissions is required.
$base_url = 'https://Mubadil.com';
$method = '/api/v3/currencies/';
$api_key = 'YOUR_API_KEY';
$secret_key = 'YOUR_API_SECRET';
$param['ticker'] = 'btc,eth';
$param['tonce'] = round(microtime(true) * 1000);
$params = http_build_query($param);
$sign = hash_hmac('sha256', $params, $secret_key);
$headers = [
'API-Key: ' . $api_key,
'API-Sign: ' . $sign
];
$ch = curl_init($base_url.$method);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$result = curl_exec($ch);
curl_close($ch);
The above example will return data only for BTC and ETH coins.
Response:
{
"result":"success",
"list":{
"btc":{
"name":"Bitcoin",
"site":"https://bitcoin.org",
"deposit_can":1,
"withdraw_can":1,
"chains":{
"btc":{
"deposit_can":1,
"deposit_min":1,
"deposit_fee_fixed":1,
"deposit_fee_percent":,
"deposit_confirmations":1,
"deposit_address_spot":,
"deposit_address_advertising":,
"withdraw_can":1,
"withdraw_min":1,
"withdraw_fee_fixed":1,
"withdraw_fee_percent":,
"explorer":"...",
"reserve":1
},
...
}
},
...
}
}
Description:
result - result of the request execution
list - list of coins
deposit_can - deposit status
withdraw_can - withdrawal status
chains - list of networks
deposit_can - deposit status
deposit_min - minimum deposit
deposit_fee_fixed - fixed deposit fee
deposit_fee_percent - deposit fee percentage
deposit_confirmations - deposit confirmations count
deposit_address_spot - spot deposit address
deposit_address_advertising - advertising deposit address
withdraw_can - withdrawal status
withdraw_min - minimum withdrawal
withdraw_fee_fixed - fixed withdrawal fee
withdraw_fee_percent - withdrawal fee percentage
explorer - explorer
reserve - exchange reserve available for withdrawal
Method:
POST /api/v3/transactions/
This method allows you to retrieve your own history of recent transactions.
Parameters:
ticker (coin ticker) optional
- you can specify multiple coins separated by commas
- examples: btc or btc,eth
- default is all coins
type (transaction direction) optional
- example: on_chain (on the blockchain) or off_chain (off the blockchain)
- default is all transaction directions
direction (transaction type) optional
- example: deposit (deposits) or withdrawal (withdrawals)
- default is all transaction types
from (start timestamp) optional
- example: 1697300000
- default is absent
to (end timestamp) optional
- example: 1697310000
- default is absent
limit (number of transactions) optional
- you can specify from 1 to 100 transactions
- default is 10 transactions
tonce (timestamp in milliseconds) required
- must be less than the server's timestamp
- must be greater for each request
PHP Request Example:
To call this method, a digital signature is required through API keys v3, with trading rights.
$base_url = 'https://mubadil.com';
$method = '/api/v3/transactions/';
$api_key = 'YOUR_API_SECRET';
$secret_key = 'YOUR_API_SECRET';
$param['ticker'] = 'btc';
$param['tonce'] = round(microtime(true) * 1000);
$params = http_build_query($param);
$sign = hash_hmac('sha256', $params, $secret_key);
$headers = [
'API-Key: ' . $api_key,
'API-Sign: ' . $sign
];
$ch = curl_init($base_url.$method);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$result = curl_exec($ch);
curl_close($ch);
The example above will return your own history of recent transactions only for the coins BTC and ETH.
Return:
{
"result":"success",
"list":[
{
"ticker":"usdt",
"type":"on_chain",
"direction":"deposit",
"chain":"btc",
"address":"...",
"amount":1,
"transaction_id":"...",
"status":"completed",
"timestamp":1234567890
},
{
"ticker":"usdt",
"type":"off_chain",
"direction":"withdrawal",
"user_id":123,
"amount":1,
"transaction_id":"...",
"status":"processing",
"timestamp":1234567890
},
...
]
}
Description:
result - result of the request
list - list of transactions
type - transaction type
direction - transaction direction
chain - network
address - address
user_id - user identifier
amount - transaction amount
transaction_id - transaction identifier
timestamp - transaction timestamp
|
|