API Documentation

Overview


We provide a simple and powerful API that allows you to programmatically trade on our exchange. You can have multiple API keys each with its own access right. You can manage your APIs on the Manage API page. For added security, we have provided email verification for generating new APIs and for redisplay your API secret key. All public requests are GET requests and all responses come in a default JSON response object.


Getting Started

You can create new APIs on the manage API section. APIs come with three levels of permission: read info, trade and withdraw.

You can restrict the functionality of APIs. Before creating new APIs, you must choose what permissions you would like the key to have. The permissions are:

  • Read Info- You can only view your market trade history, account balances, cryptocurrency transaction history etc

  • Trade- You can place a buy/sell order in a specific trading market.Make sure you have the proper permissions set on your API keys for this call to work.

  • Withdraw- You can programmatically withdraw your cryptocurrency to any address you provide.


In order to make authenticated API calls, you have to provide an API signature to validate your identity. We use a standard HMAC-SHA512 signing. Calculate the HMAC hash using your API secret and URL and include it under an API sign header


$apikey="YOUR API KEY HERE";

$apisecret="YOUR API SECRET KEY HERE";

$market='btc-bch';

$service_url = 'http://inout-blockchain-altexchanger-addons.demo.inoutscripts.net/index.php/api/getmytradehistory';

$sign=hash_hmac('sha512',$service_url ,$apisecret);

$curl = curl_init($service_url);

$curl_post_data = array(

"apikey" => $apikey,

"market" => $market,

 );

curl_setopt($curl, CURLOPT_POST, success);

curl_setopt($curl, CURLOPT_HTTPHEADER, array('apisign:'.$sign));

curl_setopt($curl, CURLOPT_POSTFIELDS, $curl_post_data);

$curl_response = curl_exec($curl);

$obj = json_decode($curl_response);

API Reference


There are two categories of API service that we provide Public APIs that are used without user authentication and Authenticated API that is only accessible via authenticated API calls.

Public API's can directly be accessed by invoking  the URL directly but authenticated API's can only be accessed by providing the API key and secret which you can generate from new API section.



Public API


  • api/getasksofmarket


This particular API request is used to provide all the ask orders of a particular market.

Parameters : market

Request :http://inout-blockchain-altexchanger-addons.demo.inoutscripts.net/index.php/api/getasksofmarket?market=btc-bch

Response

{

"response": "success",

"message": "",

"result": [{

"Market": "BTC-BCH",

"BaseCurrency": "BCH",

"TradeCurrency": "BTC",

"Type": "Limit",

"Price": "0.09007180",

"Size": "5.28161490",

"Total": "0.47572456",

"Sum": "0.47572456"

}]

}


  • api/getbidsofmarket


This particular API request is used to provide all the  bid orders of a particular market.

Parameters : market

Request : http://inout-blockchain-altexchanger-addons.demo.inoutscripts.net/index.php/api/getbidsofmarket?market=btc-bch

Response

{

"response": "success",

"message": "",

"result": [{

"Market": "BTC-BCH",

"BaseCurrency": "BCH",

"TradeCurrency": "BTC",

"Type": "Limit",

"Price": "0.08806545",

"Size": "0.28154740",

"Total": "0.02479460",

"Sum": "0.02479460"

}]

}


  • api/getallmarkets


This particular API request is used to provide all active trading markets in the Inout Blockchain AltExchanger.

Parameters : None

Request : http://inout-blockchain-altexchanger-addons.demo.inoutscripts.net/index.php/api/getallmarkets

Response

{

"response": "success",

"message": "",

"result": [{

"Market": "BTC-BCH",

"BaseCurrency": "Bitcoin Cash",

"TradeCurrency": "Bitcoin",

"MinTradeSize": "0.00009",

"CreatedOn": "10\/30\/2018 16:04:13"

}, {

"Market": "BTC-ETH",

"BaseCurrency": "Ethereum",

"TradeCurrency": "Bitcoin",

"MinTradeSize": "0.00009",

"CreatedOn": "10\/30\/2018 16:21:03"

}]

}


  • api/getmarketsummary


This particular API request is used to provide market summary of a particular trading market in the last 24 hours.

Parameters : market

Request : http://inout-blockchain-altexchanger-addons.demo.inoutscripts.net/index.php/api/getmarketsummary?market=btc-bch

Response

{

"response": "success",

"message": "",

"result": [{

"MarketName": "BTC-BCH",

"High": "0.09113500",

"Low": "0.08804565",

"Volume": "548.006",

"Last": "0.08804565",

"Bid": "0.08804565",

"Ask": "0.09007180",

"ChangePecentage": "-3.00",

"OpenBuyOrders": "1069",

"OpenSellOrders": "1093",

"CreatedOn": "10\/30\/2018 16:04:13"

}]

}


  • api/getmarkettradehistory


This particular API request is used to provide old trade history of a particular market.

Parameters : market

Request : http://inout-blockchain-altexchanger-addons.demo.inoutscripts.net/index.php/api/getmarkettradehistory?market=btc-bch

Response

{

"response": "success",

"message": "",

"result": [{

"Id": "60429",

"ClosedDate": "11\/10\/2018 14:05:04",

"Type": "Sell",

"Amount": "0.08804565",

"TotalUnits": "1.00934550",

"TotalCost": "0.08886848"

}]

}


  • api/getticker


This particular API request is used to get current tick values for a particular market.

Parameters : market

Request : http://inout-blockchain-altexchanger-addons.demo.inoutscripts.net/index.php/api/getticker?market=btc-bch

Response

{

"response": "success",

"message": "",

"result": [{

"MarketName": "BTC-BCH",

"BaseCurrency": "Bitcoin Cash",

"TradeCurrency": "Bitcoin",

"Bid": "0.08804565",

"Ask": "0.09007180",

"Last": "0.08804565"

}]

}

  • api/getallmarketsummaries


This particular API request is used to provide market summaries of all active market.

Parameters :None

Request : http://inout-blockchain-altexchanger-addons.demo.inoutscripts.net/index.php/api/getallmarketsummaries

Response

{

"response": "success",

"message": "",

"result": [{

"MarketName": "BTC-BCH",

"High": "0.09113500",

"Low": "0.08804565",

"Volume": "548.006",

"Last": "0.08804565",

"Bid": "0.08804565",

"Ask": "0.09007180",

"ChangePecentage": "-3.00",

"OpenBuyOrders": "1069",

"OpenSellOrders": "1093",

"CreatedOn": "10\/30\/2018 16:04:13"

}]

}


  • api/getcurrencies


This particular API request is used to provide all active currencies of the system.

Parameters :None

Request : http://inout-blockchain-altexchanger-addons.demo.inoutscripts.net/index.php/api/getcurrencies

Response

{ "response": "success", "message": "", "result": [{ "Currency": "Bitcoin", "Symbol": "BTC", "IsActive": "true" }, { "Currency": "Bitcoin Cash", "Symbol": "BCH", "IsActive": "true" }] }


Authenticated APIs


  • api/getbalance


This particular API request is used to return authenticated users available balance for a specific currency.

Parameters :currency

Required Permission: Read info

Request : http://inout-blockchain-altexchanger-addons.demo.inoutscripts.net/index.php/api/getbalance

Response

{

"response": "success",

"message": "",

"result": [{

"Currency": "BTC",

"AvailableBalance": "992.77974100",

"PendingWithdrawals": "3.00000000",

"OnOrders": "14.10008600",

"DepositAddress": "3R2Fb7amicoe5m4V9Q1edCh47S4JLQ1BVx"

}]

}


  • api/getallbalances


This particular API request is used to provide the available user balance of the authenticated users in all currencies.

Parameters :None

Required Permission: Read info

Request : http://inout-blockchain-altexchanger-addons.demo.inoutscripts.net/index.php/api/getallbalances

Response

{

"response": "success",

"message": "",

"result": [{

"Currency": "BTC",

"AvailableBalance": "992.77974100",

"PendingWithdrawals": "3.00000000",

"OnOrders": "14.10008600",

"DepositAddress": "3R2Fb7amicoe5m4V9Q1edCh47S4JLQ1BVx"

}, {

"Currency": "BCH",

"AvailableBalance": "993.00010000",

"PendingWithdrawals": "0.00000000",

"OnOrders": "5.99990000",

"DepositAddress": "172nurPYSq97T6LzsBSfc3G9g4xiEDdgXz"

}]

}


  • api/getmytradehistory


This particular API request is used to provide trade history of  authenticated user.

Parameters :market

Required Permission: Read info

Request : http://inout-blockchain-altexchanger-addons.demo.inoutscripts.net/index.php/api/getmytradehistory

Response

{ "response": "success", "message": "", "result": [{ "Id": "1", "OpenedDate": "01\/01\/1970 05:30:00", "ClosedDate": "11\/01\/2018 13:25:19", "Type": "Limit-Buy", "Amount": "0.08600000", "UnitsFilled": "1.00000000", "UnitsTotal": "1.00000000", "ActualCost": "0.08600000", "TotalCost": "0.08600000" }] }


  • api/getmyopenorders


This particular API request is used to provide open orders of  authenticated user in a particular market.

Parameters :market

Required Permission: Read info

Request : http://inout-blockchain-altexchanger-addons.demo.inoutscripts.net/index.php/api/getmyopenorders

Response

{ "response": "success", "message": "", "result": [{ "Id": "60", "Market": "BTC-BCH", "Type": "Limit-Buy", "Amount": "0.08600000", "UnitsFilled": "0.00000000", "UnitsTotal": "1.00000000", "EstimatedTotal": "4400.00", "OrderDate": "10/16/2018 18:08:21" }] }


  • api/getdepositaddress


This particular API request is used to returns deposit address of a requested cryptocurrency.

Parameters :currency

Required Permission: Read info

Request : http://inout-blockchain-altexchanger-addons.demo.inoutscripts.net/index.php/api/getdepositaddress

Response

{ "response": "success", "message": "", "result": [{ "Currency": "BTC", "Address": "3R2Fb7amicoe5m4V9Q1edCh47S4JLQ1BVx" }] }


  • api/selllimit


This particular API request is used to programatically add limit sell order in  a particular market specified as parameter.

Parameters : market,units,price

Required Permission: Trade

Request : http://inout-blockchain-altexchanger-addons.demo.inoutscripts.net/index.php/api/selllimit


Response

{ "response": "success", "message": "YOUR SELL ORDER PLACED", "result": [{ "Id": "6112" }] }


  • api/buylimit


This particular API request is used to programatically add limit buy order in a particular market  specified as parameter.


Parameters : market,units,price

Required Permission: Trade

Request : http://inout-blockchain-altexchanger-addons.demo.inoutscripts.net/index.php/api/buylimit


Response

{ "response": "success", "message": "YOUR BUY ORDER PLACED", "result": [{ "Id": "6115" }] }


  • api/buyconditional


This particular API request is used to programatically add limit buy order in  a particular market specified as parameter.


Parameters : market,units,price, condition(1:Greater than or equal to, 2:Less than or equal to), conditionalprice

Required Permission: Trade

Request : http://inout-blockchain-altexchanger-addons.demo.inoutscripts.net/index.php/api/buyconditional



Response

{ "response": "success", "message": "YOUR BUY ORDER PLACED", "result": [{ "Id": "6162" }] }


  • api/sellconditional


This particular API request is used to programatically add limit buy orderin  a particular market specified as parameter.


Parameters : market,units,price, condition(1:Greater than or equal to, 2:Less than or equal to), conditionalprice

Required Permission: Trade

Request : http://inout-blockchain-altexchanger-addons.demo.inoutscripts.net/index.php/api/sellconditional



Response

{ "response": "success", "message": "YOUR SELL ORDER PLACED", "result": [{ "Id": "6712" }] }


  • api/cancelorder


This particular API request is used to cancel specific bid/ask.

Parameters :id

Required Permission: Trade

Request : http://inout-blockchain-altexchanger-addons.demo.inoutscripts.net/index.php/api/cancelorder

Response

{ "response": "success", "message": "CANCELLED", "result": null }


  • api/getdeposithistory


This particular API request is used to provide  deposit history of a particular currency of the authenticated user .

Parameters :currency

Required Permission: Read info

Request : http://inout-blockchain-altexchanger-addons.demo.inoutscripts.net/index.php/api/getdeposithistory

Response

{ "response": "success", "message": "", "result": [{ "Currency": "Bitcoin", "TransactionId": "fa09af05-e435-5dc5-b43f-9362e537e7e0", "AmountDeposited": "10.00000000 BTC", "RequestedDate": "08\/25\/2018 17:40:25", "ProcessedDate": "08\/25\/2018 17:40:25", "WalleteAddress": "3R2Fb7amicoe5m4V9Q1edCh47S4JLQ1BVx", "TotalBalance": "1009.87982700 BTC", "TransactionStatus": "Completed" }] }


  • api/getwithdrawalhistory


This particular API request is used to return authenticated users withdrawal history.

Parameters :currency

Required Permission: Read info

Request : http://inout-blockchain-altexchanger-addons.demo.inoutscripts.net/index.php/api/getwithdrawalhistory

Response

{ "response": "success", "message": "", "result": [{ "CryptoCurrency": "Bitcoin", "TransactionId": "fa09af05-e435-5dc5-b43f-9362e537e7e0", "AmountWithdrawn": "1.00000000 BTC", "WithdrawalTransactionFee": "0.00070000 BTC", "NetAmount": "0.99930000 BTC", "WithdrawalAddress": "3E5C8su1BYZsrwz6LsAW5udvSbcZvRqovD", "RequestedDate": "10\/17\/2018 09:23:01", "ProcessedDate": "10\/17\/2018 09:23:01", "BlockchainHash": "5f511f9f6ee23a6c94e8d28e0776a9dec50f984ff6d7c83953f465aed6de26ad", "WalleteAddress": "3R2Fb7amicoe5m4V9Q1edCh47S4JLQ1BVx", "TotalBalance": "1009.87982700 BTC", "TransactionStatus": "Completed" }] }


  • api/withdraw


This particular API request is used to withdraw specified units of specified  cryptocurrency to a specified address in the API request.

Parameters :currency,quantity,address

Required Permission: withdraw

Request : http://inout-blockchain-altexchanger-addons.demo.inoutscripts.net/index.php/api/withdraw

Response

{ "response": "success", "message": "YOUR WITHDRAWAL REQUEST HAS BEEN COMPLETED", "result": [{ "Id": "233132", }] }


Success

Success

Error