Developer's Guide - Api

Overview

BitSails provides a simple and powerful REST API to allow you to programatically perform nearly all actions you can from our web interface.

All requests use the application/json content type and go over https. The base url is https://api.bitsails.com/[groupname]/[method].

We actually do not provide public unauthenticated APIs at this time. You MUST create an account and generate a personal API KEY to use such features of BitSails.com.

We reserve the right to change these settings & its usage as we tune the system during the post launch phase. If you are affected by these limits as an active trader, please email [email protected]

If you have any questions, feedback or recommendation for API support you can post a question in our support center.


Getting Started

  • General
  • Authentication
  • API Reference
  • Client Libraries



General

We provide a simple yet complete RESTful API. All calls are GETs and should be called via https.  Our current stable API is v1. The endpoints have a standard format as follows:

https://api.bitsails.com/{groupname}/{method}?param=value



Authentication

To use BitSails Exchange API you'll be required to have your own private API key, this means that you must have an account to perform API calls. You can have multiple API keys, each with their own level of rights. To manage your API keys please go to your Settings->Manage API Keys page. Note, you MUST have 2FA enabled to create an API key for your own safety.

Our API has many different levels of rights. Always set them safe accordingly to the usage you are going to make with it. Never provide a private API key with trade or withdrawal rights to unknown entities, this can result in total damage or loss of your funds.

  • Read Info - You can only view the balances, orders, and other details of the account
  • Withdraw - We allow you to programatically withdraw any currency to an address you provide. This can be used to quick arbitrage exchanges or move money into cold storage after thresholds.
  • Trade - This allows the API key to place LIMIT buy and sell orders. This allows the API key to place MARKET buy and sell orders. - WARNING: Do no enable this unless you know what you're doing. Market buy/sells are extremely dangerous.

API KEY MUST BE PASSED IN HEADER WITH "token-authorization-x" PARAMETER.

Example:

         curl -i -H "token-authorization-x: YOUR_API_KEY_HERE" https://api.bitsails.com/markets/GetMarketsData/



API Reference

Our APIs are broken into many different groups, related to the type of operations performed through BitSails API.

  • Markets - For programmatic trading of crypto currencies.
  • News - To retrieve the dynamic News and alerts sections content.
  • StaticPages - To retrieve content for static pages of BitSails.com.
  • Orders - Manage orders for your account.
  • User - Check your coins balances.
  • UserPanel - Manage everything related to user's activity and personal data.
  • Wallets - Manage and control your wallets activity, including generating new addresses and more.



API Details


IMPORTANT: EVERY API REQUEST MUST BE AUTHENTICATED WITH YOUR OWN API KEY. 

Make sure you have the proper permissions set on your API keys for calls to work.


Markets


/markets/GetCoinInfo/

Used to retrieve Coin's informations based on the INFO page for each cryptocurrency listed on our website. 

Parameters
 
MarketName 
 (REQUIRED) a string literal for the market (ex: BTC-LTC)

Request:

https://api.bitsails.com/markets/GetCoinInfo/?MarketName=BTC-LTC

Response - Returns you the full Coin's description retrieved from CoinGecko.
        {
   "name":"Litecoin",
   "code":"LTC",
   "algo":"Scrypt",
   "blocktime":2,
   "genesis":"2011-10-08",
   "genesisyo":3227,
   "image":"https:\/\/assets.coingecko.com\/coins\/images\/2\/large\/litecoin.png?1547033580",
   "desc":"Litecoin is a peer-to-peer cryptocurrency created by Charlie Lee. It was created based on the <a href=\"https:\/\/www.coingecko.com\/en\/coins\/bitcoin\">Bitcoin<\/a> protocol but differs in terms of the hashing algorithm used. Litecoin uses the memory intensive <a href=\"https:\/\/www.coingecko.com\/en?hashing_algorithm=Scrypt\">Scrypt proof of work<\/a> mining algorithm. Scrypt allows consumer-grade hardware such as GPU to mine those coins.<br \/>\r\n<br \/>\r\nWhy Litecoin?<br \/>\r\nLitecoin is a cryptocurrency that has evolved from Bitcoin after its own popularity in the industry, this alternative, or \u2018altcoin\u2019 has emerged to allow investors to diversify their digital currency package, according to Investopedia. Litecoin is one of the most prominent altcoins and was created by former Google employee and Director of Engineering at <a href=\"https:\/\/www.coingecko.com\/en\/exchanges\/coinbase_pro\">Coinbase<\/a>, Charlie Lee. Litecoin was the first to alter Bitcoin and the most significant difference is that it takes 2.5 minutes for Litecoin to generate a block, or transaction, in comparison to Bitcoin's 10 minutes.<br \/>\r\n<br \/>\r\n\u2018While this matters little to traders, miners who use hardware to run Bitcoin's network cannot switch over to Litecoin. This keeps bigger mining conglomerates away from Litecoin because they cannot easily optimize their profits by swapping to another coin, contributing to a more decentralized experience. Litecoin also has bigger blocks, and more coins in circulation, making it more affordable and swift when transacting,\u2019 Investopedia explained.<br \/>\r\n<br \/>\r\nAs explained above, Litecoin can transact a lot faster than Bitcoin, but there are also a number of other characteristics that investors need to know before trading. Litecoin can handle higher volumes of transactions because of the capability of transacting faster and if Bitcoin attempted to transact on the scale of its altcoin, a code update would be needed. However, Litecoin\u2019s blocks would be larger, but with more \u2018orphaned blocks'. The faster block time of litecoin reduces the risk of double spending attacks - this is theoretical in the case of both networks having the same hashing power.<br \/>\r\n<br \/>\r\nLitecoin Technical Details:<br \/>\r\nThe transaction confirmation time taken for Litecoin is about 2.5 minutes on average (as compared to Bitcoin's 10 minutes). The Litecoin network is scheduled to cap at 84 million currency units. <br \/>\r\n<br \/>\r\nLitecoin has inspired many other popular alternative currencies (eg. <a href=\"https:\/\/www.coingecko.com\/en\/coins\/dogecoin\">Dogecoin<\/a>) because of its Scrypt hashing algorithm in order to prevent ASIC miners from mining those coins. However it is said that by the end of this year, Scrypt ASIC will enter the mass market.",
   "links":{
      "homepage":[
         "http:\/\/litecoin.org",
         "",
         ""
      ],
      "blockchain_site":[
         "https:\/\/blockchair.com\/litecoin",
         "https:\/\/chainz.cryptoid.info\/ltc\/",
         "https:\/\/bitupper.com\/en\/explorer\/litecoin",
         "https:\/\/litecoinblockexplorer.net\/",
         "https:\/\/ltc.tokenview.com\/"
      ],
      "official_forum_url":[
         "https:\/\/litecointalk.org\/",
         "",
         ""
      ],
      "chat_url":[
         "",
         "",
         ""
      ],
      "announcement_url":[
         "",
         ""
      ],
      "twitter_screen_name":"LTCFoundation",
      "facebook_username":"",
      "bitcointalk_thread_identifier":47417,
      "telegram_channel_identifier":"",
      "subreddit_url":"https:\/\/www.reddit.com\/r\/litecoin\/",
      "repos_url":{
         "github":[
            "https:\/\/github.com\/litecoin-project\/litecoin"
         ],
         "bitbucket":[
         ]
      }
   },
   "marketcap":8,
   "coingeko":7,
   "last":"2020-08-07T12:40:23.409Z"
}
        


/markets/GetFeatureMarkets/

Used to retrieve Featured Markets . Featured markets are special advertised markets with a priority space on the BitSails homepage. Make sure you have the proper permissions set on your API keys for this call to work
Parameters
 
No parameters are required.

Request:
        https://api.bitsails.com/markets/GetFeatureMarkets/
        

Response - Returns you the list of Featured Markets
       [
   {
      "coinname":"Litecoin",
      "marketname":"BTC-LTC",
      "logo":"https:\/\/ltc.133.io\/images\/logosizes\/ltc400.png"
   },
   {
      "coinname":"BitcoinCash",
      "marketname":"BTC-BCH",
      "logo":"https:\/\/bitcoincashers.org\/visual-assets\/bch_b_large.png"
   },
   {
      "coinname":"Dash",
      "marketname":"BTC-DASH",
      "logo":"https:\/\/i.pinimg.com\/originals\/b0\/f5\/ff\/b0f5ff13b6449d68d7038bee35a1c6eb.png"
   },
   {
      "coinname":"Dogecoin",
      "marketname":"BTC-DOGE",
      "logo":"https:\/\/i.imgur.com\/e1RS4Hn.png"
   },
   {
      "coinname":"ZCash",
      "marketname":"BTC-ZEC",
      "logo":"https:\/\/globalcoinresearch.com\/wp-content\/uploads\/2019\/03\/zcash-icon-fullcolor.png"
   },
   {
      "coinname":"MonetaryUnit",
      "marketname":"BTC-MUE",
      "logo":"https:\/\/seeklogo.com\/images\/M\/monetaryunit-mue-logo-506BE3768A-seeklogo.com.png"
   },
   {
      "coinname":"BitcoinCZ",
      "marketname":"BTC-BCZ",
      "logo":"https:\/\/chainz.cryptoid.info\/logo\/bcz.png"
   },
   {
      "coinname":"Titcoin",
      "marketname":"BTC-TIT",
      "logo":"https:\/\/s2.coinmarketcap.com\/static\/img\/coins\/200x200\/513.png"
   },
   {
      "coinname":"Vertcoin",
      "marketname":"BTC-VTC",
      "logo":"https:\/\/upload.wikimedia.org\/wikipedia\/commons\/b\/bd\/Vertcoin.svg"
   },
   {
      "coinname":"BitcoinGold",
      "marketname":"BTC-BTG",
      "logo":"https:\/\/cdn.worldvectorlogo.com\/logos\/bitcoin-gold.svg"
   },
   {
      "coinname":"BitcoinSV",
      "marketname":"BTC-BSV",
      "logo":"https:\/\/static.coinpaper.io\/images\/coins\/bsv-bitcoin-sv.png"
   },
   {
      "coinname":"Mooncoin",
      "marketname":"BTC-MOON",
      "logo":"https:\/\/chainz.cryptoid.info\/logo\/moon.png"
   }
]
        


/markets/GetMarketInfo

Used to retrieve general information about specified market pair.
Parameters

MarketName
 a string literal for the market (ex: BTC-LTC)

Request:
        https://api.bitsails.com/markets/GetMarketInfo/?MarketName=BTC-LTC  
        

Response - Returns you the market pair details.
       
   {
      "id":1,
      "base":"BTC",
      "basename":"Bitcoin",
      "coin":"LTC",
      "coinname":"Litecoin",
      "marketname":"BTC-LTC",
      "tradefee":0,
      "minsize":100,
      "sponsored":"YES",
      "notice":null,
      "logo":"https:\/\/ltc.133.io\/images\/logosizes\/ltc400.png",
      "active":1,
      "deleted":0,
      "baseid":1,
      "coinid":2,
      "txfee":10000
   }
        



/markets/GetMarketsData/

Get all orders that you currently have opened. A specific market can be requested
Parameters




MarketName  (optional)    a string literal for the market (ie. BTC-LTC)

Request:
        https://api.bitsails.com/markets/GetMarketsData/?MarketName=BTC-LTC    
        

Response
            {
   "sEcho":null,
   "iTotalRecords":1,
   "iTotalDisplayRecords":1,
   "aaData":[
      {
         "Market":{
            "MarketCurrency":"LTC",
            "BaseCurrency":"BTC",
            "MarketCurrencyLong":"Litecoin",
            "BaseCurrencyLong":"Bitcoin",
            "MinTradeSize":1.0e-6,
            "MarketName":"BTC-LTC",
            "IsActive":true,
            "Created":1590373847000,
            "Notice":null,
            "IsSponsored":"YES",
            "IsVirtual":false,
            "LogoUrl":"https:\/\/ltc.133.io\/images\/logosizes\/ltc400.png"
         },
         "Summary":{
            "MarketName":"BTC-LTC",
            "High":0.00471058,
            "Low":0.00471058,
            "Volume":124.5374,
            "Last":0.0046106,
            "BaseVolume":0.58378092,
            "TimeStamp":1595118328000,
            "Bid":0.00450424,
            "Ask":0.0047,
            "OpenBuyOrders":5,
            "OpenSellOrders":4,
            "PrevDay":0.00453,
            "Created":1590373847000
         }
      }
   ]
}
        



/markets/GetStats/

Used to retrieve Exchange's general stats

Parameters

No parameters required

Request:
        https://api.bitsails.com/markets/GetStats/
        

Response
            {
   "Users":1258,
   "OpenOrders":7095,
   "BTCVolumeDay":2.58681092,
   "BTCVolumeWeek":15.9652,
   "BTCVolumeMonth":152.84852,
   "BTCOrdersDay":0,
   "BTCOrdersWeek":null,
   "BTCOrdersMonth":null,
   "DepositsDay":null,
   "DepositsWeek":null,
   "DepositsMonth":null,
   "WithdrawalsDay":null,
   "WithdrawalsWeek":null,
   "WithdrawalsMonth":null
}
        


/markets/GetMarketData/

Get all trading history data for a specified market.
Parameters




MarketName (required)   a string literal for the market (ie. BTC-LTC)

Request:
        https://api.bitsails.com/markets/GetMarketData/?MarketName=BTC-LTC    
        

Response
            {
   "ticker":{
      "Last":0.0046106
   },
   "summary":{
      "MarketName":"BTC-LTC",
      "High":0.00471058,
      "Low":0.00471058,
      "Volume":124.5374,
      "Last":0.0046106,
      "BaseVolume":0.58378092,
      "TimeStamp":1595118328000,
      "Bid":0.00450424,
      "Ask":0.0047,
      "OpenBuyOrders":5,
      "OpenSellOrders":4,
      "PrevDay":0.00453,
      "Created":1590373847000
   },
   "buys":[
      {
         "Rate":0.00450424,
         "Quantity":100
      },
      {
         "Rate":0.0045,
         "Quantity":1.66666
      },
      {
         "Rate":0.004445,
         "Quantity":7
      },
      {
         "Rate":0.004444,
         "Quantity":1
      },
      {
         "Rate":0.0044347,
         "Quantity":12.4
      }
   ],
   "sells":[
      {
         "Rate":0.0047,
         "Quantity":1
      },
      {
         "Rate":0.0047155,
         "Quantity":23
      },
      {
         "Rate":0.00475,
         "Quantity":5
      },
      {
         "Rate":0.00479029,
         "Quantity":1.32487
      }
   ],
   "history":[
      {
         "TimeStamp":1594984467000,
         "Price":0.0046106,
         "Quantity":0.02055712,
         "Total":9.501e-5,
         "OrderType":"SELL"
      },
      {
         "TimeStamp":1594117729000,
         "Price":0.00471058,
         "Quantity":5.4521355,
         "Total":0.02574708,
         "OrderType":"BUY"
      },
      {
         "TimeStamp":1594117723000,
         "Price":0.004626,
         "Quantity":1.46034,
         "Total":0.00677246,
         "OrderType":"BUY"
      },
      {
         "TimeStamp":1594117714000,
         "Price":0.004615,
         "Quantity":0.9975,
         "Total":0.004615,
         "OrderType":"BUY"
      },
      {
         "TimeStamp":1594117697000,
         "Price":0.0046106,
         "Quantity":1.995,
         "Total":0.0092212,
         "OrderType":"BUY"
      },
      {
         "TimeStamp":1594117686000,
         "Price":0.0047001,
         "Quantity":114.321081,
         "Total":0.53866718,
         "OrderType":"BUY"
      },
      {
         "TimeStamp":1593525574000,
         "Price":0.00465,
         "Quantity":0.0185535,
         "Total":8.649e-5,
         "OrderType":"SELL"
      },
      {
         "TimeStamp":1593525521000,
         "Price":0.00453,
         "Quantity":0.06502868,
         "Total":0.00029531,
         "OrderType":"SELL"
      }[...]
   ],
   "ticks":[
      {
         "O":0.00465201,
         "H":0.00465201,
         "L":0.00465201,
         "C":0.00465201,
         "V":10,
         "T":1592260200000
      },
      {
         "O":0.004602,
         "H":0.004602,
         "L":0.004602,
         "C":0.004602,
         "V":10,
         "T":1592307000000
      },
      {
         "O":0.0047,
         "H":0.0047,
         "L":0.004605,
         "C":0.00461,
         "V":111.4786,
         "T":1592308800000
      },
      {
         "O":0.004675,
         "H":0.004675,
         "L":0.004675,
         "C":0.004675,
         "V":5,
         "T":1592323200000
      },
      {
         "O":0.00469652,
         "H":0.00469652,
         "L":0.00469652,
         "C":0.00469652,
         "V":15.4654,
         "T":1592388000000
      },
      {
         "O":0.00462,
         "H":0.00463433,
         "L":0.00453,
         "C":0.00460199,
         "V":84.74736,
         "T":1593525600000
      },
      {
         "O":0.00462,
         "H":0.00463433,
         "L":0.00453,
         "C":0.004602,
         "V":84.74736,
         "T":1593525600000
      }
   ],
   "tickInterval":"tenmin",
   "lastFill":964295,
   "lastBuyActivity":964346,
   "lastSellActivity":730381,
   "firstLoad":false,
   "showColumns":true,
   "isUpdating":true,
   "userbuyorders":[
      {
         "OrderId":xx,
         "OrderType":"BUY",
         "Price":xxxx,
         "Quantity":xxx,
         "TimeStamp":1593525564000,
         "Total":xxxx
      },
      {
         "OrderId":xx,
         "OrderType":"BUY",
         "Price":xx,
         "Quantity":xxx,
         "TimeStamp":1593525554000,
         "Total":xxxx
      }
   ],
   "userhistory":[
      {
         "OrderType":"SELL",
         "Price":xxx,
         "Quantity":xxxx,
         "TimeStamp":1594984467000,
         "Total":xxxx
      },
      {
         "OrderType":"BUY",
         "Price":xxxx,
         "Quantity":xxxx,
         "TimeStamp":1594117729000,
         "Total":xxxx
      }
   ]
}


/markets/GetMarketTickData/

Get all tickers & candles data (OHLC) from specified market.
Parameters




MarketName (required)   a string literal for the market (ie. BTC-LTC)

Request:
        https://api.bitsails.com/markets/GetMarketTickData/?MarketName=BTC-LTC    
        

Response
            {
   "sEcho":null,
   "iTotalRecords":1,
   "iTotalDisplayRecords":1,
   "aaData":[
      {
         "Market":{
            "MarketCurrency":"LTC",
            "BaseCurrency":"BTC",
            "MarketCurrencyLong":"Litecoin",
            "BaseCurrencyLong":"Bitcoin",
            "MinTradeSize":1.0e-6,
            "MarketName":"BTC-LTC",
            "IsActive":true,
            "Created":1590373847000,
            "Notice":null,
            "IsSponsored":"YES",
            "IsVirtual":false,
            "LogoUrl":"https:\/\/ltc.133.io\/images\/logosizes\/ltc400.png"
         },
         "Summary":{
            "MarketName":"BTC-LTC",
            "High":0.00471058,
            "Low":0.00471058,
            "Volume":124.5374,
            "Last":0.0046106,
            "BaseVolume":0.58378092,
            "TimeStamp":1595118328000,
            "Bid":0.00450424,
            "Ask":0.0047,
            "OpenBuyOrders":5,
            "OpenSellOrders":4,
            "PrevDay":0.00453,
            "Created":1590373847000
         }
      }
   ]
}
        


/markets/GetMarketSummaries/

Get a summary of all the available markets data. Can be called for a specified market only.

Parameters




MarketName (optional)   a string literal for the market (ie. BTC-LTC)


Request:
        https://api.bitsails.com/markets/GetMarketSummaries/  
        

Response
          [
   {
      "Market":{
         "MarketCurrency":"BCH",
         "BaseCurrency":"BTC",
         "MarketCurrencyLong":"BitcoinCash",
         "BaseCurrencyLong":"Bitcoin",
         "MinTradeSize":1.0e-6,
         "MarketName":"BTC-BCH",
         "IsActive":true,
         "Created":1590373847000,
         "Notice":null,
         "IsSponsored":"YES",
         "IsVirtual":false,
         "LogoUrl":"https:\/\/bitcoincashers.org\/visual-assets\/bch_b_large.png"
      },
      "Summary":{
         "MarketName":"BTC-BCH",
         "High":0,
         "Low":0,
         "Volume":0,
         "Last":0,
         "BaseVolume":0,
         "TimeStamp":0,
         "Bid":0,
         "Ask":0,
         "OpenBuyOrders":0,
         "OpenSellOrders":0,
         "PrevDay":0,
         "Created":1590373847000
      }
   },
   {
      "Market":{
         "MarketCurrency":"BCZ",
         "BaseCurrency":"BTC",
         "MarketCurrencyLong":"BitcoinCZ",
         "BaseCurrencyLong":"Bitcoin",
         "MinTradeSize":1.0e-6,
         "MarketName":"BTC-BCZ",
         "IsActive":true,
         "Created":1593682971000,
         "Notice":null,
         "IsSponsored":"YES",
         "IsVirtual":false,
         "LogoUrl":"https:\/\/chainz.cryptoid.info\/logo\/bcz.png"
      },
      "Summary":{
         "MarketName":"BTC-BCZ",
         "High":5.05e-6,
         "Low":5.05e-6,
         "Volume":600,
         "Last":5.05e-6,
         "BaseVolume":0.00303,
         "TimeStamp":1596011741000,
         "Bid":4.6e-6,
         "Ask":4.0e-6,
         "OpenBuyOrders":18,
         "OpenSellOrders":8,
         "PrevDay":5.0e-6,
         "Created":1593682971000
      }
   },
   {
      "Market":{
         "MarketCurrency":"BSV",
         "BaseCurrency":"BTC",
         "MarketCurrencyLong":"BitcoinSV",
         "BaseCurrencyLong":"Bitcoin",
         "MinTradeSize":0.001,
         "MarketName":"BTC-BSV",
         "IsActive":true,
         "Created":1595334838000,
         "Notice":null,
         "IsSponsored":"YES",
         "IsVirtual":false,
         "LogoUrl":"https:\/\/static.coinpaper.io\/images\/coins\/bsv-bitcoin-sv.png"
      },
      "Summary":{
         "MarketName":"BTC-BSV",
         "High":0,
         "Low":0,
         "Volume":0,
         "Last":0,
         "BaseVolume":0,
         "TimeStamp":0,
         "Bid":0,
         "Ask":0,
         "OpenBuyOrders":0,
         "OpenSellOrders":0,
         "PrevDay":0,
         "Created":1595334838000
      }
   },
   {
      "Market":{
         "MarketCurrency":"BTG",
         "BaseCurrency":"BTC",
         "MarketCurrencyLong":"BitcoinGold",
         "BaseCurrencyLong":"Bitcoin",
         "MinTradeSize":0.001,
         "MarketName":"BTC-BTG",
         "IsActive":true,
         "Created":1595252328000,
         "Notice":null,
         "IsSponsored":"YES",
         "IsVirtual":false,
         "LogoUrl":"https:\/\/cdn.worldvectorlogo.com\/logos\/bitcoin-gold.svg"
      },
      "Summary":{
         "MarketName":"BTC-BTG",
         "High":0,
         "Low":0,
         "Volume":0,
         "Last":0,
         "BaseVolume":0,
         "TimeStamp":0,
         "Bid":0,
         "Ask":0,
         "OpenBuyOrders":0,
         "OpenSellOrders":0,
         "PrevDay":0,
         "Created":1595252328000
      }
   },
   {
      "Market":{
         "MarketCurrency":"DASH",
         "BaseCurrency":"BTC",
         "MarketCurrencyLong":"Dash",
         "BaseCurrencyLong":"Bitcoin",
         "MinTradeSize":1.0e-6,
         "MarketName":"BTC-DASH",
         "IsActive":true,
         "Created":1590373847000,
         "Notice":null,
         "IsSponsored":"YES",
         "IsVirtual":false,
         "LogoUrl":"https:\/\/i.pinimg.com\/originals\/b0\/f5\/ff\/b0f5ff13b6449d68d7038bee35a1c6eb.png"
      },
      "Summary":{
         "MarketName":"BTC-DASH",
         "High":0,
         "Low":0,
         "Volume":0,
         "Last":0,
         "BaseVolume":0,
         "TimeStamp":0,
         "Bid":0,
         "Ask":0,
         "OpenBuyOrders":0,
         "OpenSellOrders":0,
         "PrevDay":0,
         "Created":1590373847000
      }
   }[...]
]


NEWS API


/news/GetLatestAlert/

Used to get all the latest Alerts from BitSails. Returns a Base64 encoded title and message.

Request:

        https://api.bitsails.com/news/GetLatestAlert/
        

Response - Returns you Base64 encoded title and message.
       
  [
   {
      "id":1,
      "Author":"XXXXXXXXX",
      "Title":"Qml0U2FpbHMgTGF1bmNoIGZyZWUgdHJhZGluZyBwcm9tbyE=",
      "Message":"VW50aWwgN3RoIG9mIEF1Z3VzdCAyMDIwIEJpdFNhaWxzIGlzIGdpdmluZyBhY2Nlc3MgdG8gPGI+MCUgdHJhZGluZyBmZWVzPC9iPiBvbiBldmVyeSBtYXJrZXQgcGFpci4gRW5qb3kgZnJlZSB0cmFkaW5nIQ==",
      "TimeStamp":"1596067200000",
      "hasAlert":1,
      "Status":1
   }
]



/news/GetLatestNews/

Used to get all the latest News from BitSails. Returns a Base64 encoded title and message.

Request:

        https://api.bitsails.com/news/GetLatestNews/
        

Response - Returns you Base64 encoded title and message.
       
  [
   {
      "id":1,
      "Author":"XXXXXXXXX",
      "Title":"Qml0U2FpbHMgTGF1bmNoIGZyZWUgdHJhZGluZyBwcm9tbyE=",
      "Message":"VW50aWwgN3RoIG9mIEF1Z3VzdCAyMDIwIEJpdFNhaWxzIGlzIGdpdmluZyBhY2Nlc3MgdG8gPGI+MCUgdHJhZGluZyBmZWVzPC9iPiBvbiBldmVyeSBtYXJrZXQgcGFpci4gRW5qb3kgZnJlZSB0cmFkaW5nIQ==",
      "TimeStamp":"1596067200000",
      "hasAlert":0,
      "Status":1
   }
]



STATIC PAGES API


/static/page/{ about | privacy | cookies | terms | api | fees | contact }

Used to get Base64 encoded HTML content of a specified static page.

Request:

        https://api.bitsails.com/static/page/about
        

Response - Returns you Base64 encoded HTML content of a specified static page.
       
  {
   "id":1,
   "title":"about",
   "code":"ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA[...]",
   "enable":1
}



ORDERS API


/orders/GetOrderBookData/

Used to retrieve order book data for a specified market.

Parameters




MarketName (required)   a string literal for the market (ie. BTC-LTC)

Request:

        https://api.bitsails.com/orders/GetOrderBookData/?MarketName=BTC-LTC
        

Response
       
{
   "Market":{
      "marketName":"BTC-LTC",
      "baseCurrencyName":"BTC",
      "baseCurrencyLong":"Bitcoin",
      "marketCurrencyName":"LTC",
      "marketCurrencyLong":"Litecoin",
      "minTradeSize":100,
      "notice":null,
      "active":1
   },
   "ticker":{
      "Last":0.0046106
   },
   "Buys":[
      {
         "Rate":0.0044347,
         "Quantity":12.4
      },
      {
         "Rate":0.004444,
         "Quantity":1
      },
      {
         "Rate":0.004445,
         "Quantity":7
      },
      {
         "Rate":0.0045,
         "Quantity":1.66666
      },
      {
         "Rate":0.00450424,
         "Quantity":100
      }
   ],
   "Sells":[
      {
         "Rate":0.0047,
         "Quantity":1
      },
      {
         "Rate":0.0047155,
         "Quantity":23
      },
      {
         "Rate":0.00475,
         "Quantity":5
      },
      {
         "Rate":0.00479029,
         "Quantity":1.32487
      }
   ],
   "History":[
      {
         "OrderType":0,
         "TimeStamp":0,
         "Price":0,
         "Quantity":0,
         "Total":0
      }
   ]
}



/orders/GetUserOrders/

Used to retrieve user's orders data for a specified market.

Parameters




MarketName (required)   a string literal for the market (ie. BTC-LTC)

Request:

        https://api.bitsails.com/orders/GetUserOrders/?MarketName=BTC-LTC
        

Response
       
{
   "buys":[
      {
         "ID":45,
         "Date":1593525564,
         "Price":0.0044347,
         "Amount":12.4,
         "Matched":0,
         "Status":"Open",
         "Queue":false,
         "Published":true
      },
      {
         "ID":44,
         "Date":1593525554,
         "Price":0.004444,
         "Amount":1,
         "Matched":0,
         "Status":"Open",
         "Queue":false,
         "Published":true
      }
   ],
   "sells":[
      {
         "ID":58,
         "Date":1594117747,
         "Price":0.00479029,
         "Amount":1.32487,
         "Matched":0,
         "Status":"Open",
         "Queue":false,
         "Published":true
      },
      {
         "ID":57,
         "Date":1594117736,
         "Price":0.00475,
         "Amount":5,
         "Matched":0,
         "Status":"Open",
         "Queue":false,
         "Published":true
      }
   ]
}



/orders/GetUserBook/

Used to retrieve all user's orders data.

Parameters




open (required)  Get all open orders for your account
recent (required)  Get all recent orders for your account
history (required)  Get full orders history for your account
 


Request:

        https://api.bitsails.com/orders/GetuserBook/{open | recent | history}
        

Response
       
{
   "markets":[
      "BTC-BCZ",
      "BTC-LTC"
   ],
   "orders":[
      {
         "id":101,
         "date":"07\/29\/2020 08:36:01 AM",
         "type":"SELL",
         "market":"BTC-BCZ",
         "bcoin":"BTC",
         "scoin":"BCZ",
         "price":"0.00000505",
         "amount":"100.00000000",
         "total":"0.00050500",
         "filled":"100.00000000",
         "status":3,
         "queue":false,
         "published":true
      }[...] 



/orders/deleteOrder/

Used to cancel an open order.

Parameters




id (required)  Order's ID to be deleted. (You can retrieve order's ID with /orders/GetUserBook/ endpoint) 

 


Request:

        https://api.bitsails.com/orders/deleteOrder/{id}
        

Response
       
{
   "status":"OK",
   "message":"ORDER_DELETED",
   "userbalance":{
      "BTC":"xxxxxx",
      "BCZ":"xxxxxx"
   }
}



/orders/insertOrder/

Used to place a new order.

Parameters




MarketName (required - GET )  Market name literal for the market where you would like to place an order. (ie. ?MarketName=BTC-LTC)



Type (required - POST)  Specify the order type: 1 for Market order, 2 for Limit orders (recommended).



Action (required - POST)  Specify the order side: 1 is for BUY, 2 is for SELL.

Amount (required - POST)  Specify the order amount in unit with 8 decimals (ie. 1 coin order = 100000000).

Price (required - POST)  Specify the order price in satoshis (ie. 1 BTC = 100000000)




Request:

        https://api.bitsails.com/orders/insertOrder/{MarketName}
Example:
         curl -d "Type=2&Action=1&Amount=100000000&Price=40" -i -X POST -H "token-authorization-x: YOUR_API_KEY_HERE" https://api.bitsails.com/orders/insertOrder/?MarketName=BTC-LTC       

Response
{
   "status":"OK",
   "message":"ORDER_INSERTED",
   "userbalance":{
      "BTC":"xxxx",
      "LTC":"xxxx"
   }
}



USER API


/user/getBalance/

Used to retrieve order book data for a specified market.

Parameters




Coin ticker (required)   a string literal for the coin to get info about. (ie. BTC)

Request:

        https://api.bitsails.com/user/getBalance/BTC       

Response
       
{"balance":"xxx.xxxxx"}




USER PANEL API


/userpanel/activity/

Used to retrieve the activity logs for your account.

Request:

        https://api.bitsails.com/userpanel/activity/       

Response
       
[
   {
      "id":119,
      "user_id":232,
"ip":"14354312313",
"created_at":"2020-08-08 15:24:38", "updated_at":"2020-08-08 15:24:38", "activity":"BTC WITHDRAW REQUEST" }, { "id":118, "user_id":232,
"ip":"14354312313",
"created_at":"2020-08-08 15:23:25", "updated_at":"2020-08-08 15:23:25", "activity":"LOGIN" }, { "id":110, "user_id":232, "ip":"14354312313", "created_at":"2020-08-07 11:45:07", "updated_at":"2020-08-07 11:45:07", "activity":"ACTIVATE 2FA" }[...] ]



/userpanel/getusernotifications/

Used to retrieve the current notifications settings for your account.

Request:

        https://api.bitsails.com/userpanel/getusernotifications/       

Response
       
{"status":"OK","result":[{"trans":1,"auth":1,"coin":1,"news":1}]}



/userpanel/getapikeys/

Used to retrieve the active API keys for your account and shows the rights settings attached to each of them.

Request:

        https://api.bitsails.com/userpanel/getapikeys/       

Response
       {
   "status":"OK",
   "result":[
      {
         "id":1523,
         "uid":31,
         "name":"aVeryNiceName",
         "token":"YOUR_API_KEY_HERE",
         "info":1,
         "trade":1,
         "withdraw":0,
         "status":1,
         "updated_at":"2020-08-07 00:00:00",
         "last_used":"2020-08-10 13:04:15"
      }
   ]
} 



WALLETS API


/wallets/validateAddress/

Used to check if a coin's address is valid. Returns OK if valid. Includes more details about the specified address.

Parameters




Coin ticker (required)   a string literal for the coin. (ie. BTC)
Address (required)   a string literal for the address to validate. (ie. BTC)

Request:

        https://api.bitsails.com/wallets/validateAddress/{coin ticker}/{address}
Example:
        https://api.bitsails.com/wallets/validateAddress/BTC/1maw7jyfRZFmvCaSjenMdhJ974YoRUTc1

Response
       
{
   "status":"OK",
   "message":{
      "isvalid":true,
      "address":"1maw7jyfRZFmvCaSjenMdhJ974YoRUTc1",
      "scriptPubKey":"76a914086ea0d13bdae54c459bc41031cc73a25b38c6b288ac",
      "isscript":false,
      "iswitness":false
   }
}



/wallets/genUserCoinWallet/

Used to generate a brand new wallet address for a specified coin. If an address already exists it returns "NOK" status.

Parameters




Coin ticker (required)   a string literal for the coin to get info about. (ie. BTC)

Request:

        https://api.bitsails.com/wallets/genUserCoinWallet/{coin ticker}
Example:
        https://api.bitsails.com/wallets/genUserCoinWallet/BTC
Response
       
{
   "status":"OK",
   "address": "1maw7jyfRZFmvCaSjenMdhJ974YoRUTc1"
} 



/wallets/getUserDeposits/

Used to check user's deposits. You can specify a coin to retrieve only the deposits for that ticker.

Parameters




Coin ticker (optional)   a string literal for the coin. (ie. BTC)

Request:

        https://api.bitsails.com/wallets/getUserDeposits/?=BTC

Response
       
{
   "transactions":[
      {
         "code":"BTC",
         "name":"Bitcoin",
         "address":"1maw7jyfRZFmvCaSjenMdhJ974YoRUTc1",
         "amount":"1000.00000000",
         "fee":"0.00000000",
         "txid":"cad6bc9247a35ee278b9faeaa8355be412ec0c64a89cd0dfcea8ae930e19af3e",
         "conf":14298,
         "loaded":1,
         "date":"07\/17\/2020 08:48:00 AM"
      },
      {
         "code":"BCH",
         "name":"BitcoinCash",
         "address":"1maw7jyfRZFmvCaSjenMdhJ974YoRUTc1",
         "amount":"100.00000000",
         "fee":"0.00000000",
         "txid":"x0e94f64e4643b745e054ff94a516070a6adefe197796e727f999eb6f3d93f61",
         "conf":24119,
         "loaded":1,
         "date":"06\/29\/2020 11:18:48 AM"
      }
   ],
   "coins":[
      "BTC",
      "BCH"
   ]
} 




/wallets/getUserWithdraws/

Used to check user's withdrawals.

Request:

        https://api.bitsails.com/wallets/getUserWithdraws/


Response
       {
   "transactions":[
      {
         "id":1034,
         "code":"BTC",
         "name":"Bitcoin",
         "address":"1maw7jyfRZFmvCaSjenMdhJ974YoRUTc1",
         "amount":"9.99950000",
         "fee":"0.00050000",
         "txid":"1423adbe11502019397f9cfccac08c15d2cd172a1f75da5224a8edd550fa9098",
         "status":2,
         "date":"07\/17\/2020 10:59:26 AM"
      }
   ],
   "coins":[
      "BTC"
   ]
}  




/wallets/getUserWallets/

Used to retrieve user's generated wallet addresses. It returns all the information attached with each address.

Request:

        https://api.bitsails.com/wallets/getUserWallets/


Response
       {
   "status":"OK",
   "wallets":{
      "fullbalance":[
         {
            "wid":8,
            "cid":11,
            "txfee":100000,
            "code":"BTC",
            "name":"Bitcoin",
            "address":"1maw7jyfRZFmvCaSjenMdhJ974YoRUTc1",
            "balance":"1896.56368750",
            "hold":"261.00000000",
            "pending":"0.00000000",
            "satbal":189656368750
         }
      ],
      "zerobalance":[
         {
            "wid":8,
            "cid":11,
            "txfee":100000,
            "code":"BTC",
            "name":"Bitcoin",
            "address":"1maw7jyfRZFmvCaSjenMdhJ974YoRUTc1",
            "balance":"1896.56368750",
            "hold":"261.00000000",
            "pending":"0.00000000",
            "satbal":189656368750
         }
      ],
      "noaddress":[
         {
            "code":"BCH",
            "name":"BitcoinCash"
         },
         {
            "code":"BSV",
            "name":"BitcoinSV"
         },
         {
            "code":"BTG",
            "name":"BitcoinGold"
         },
         {
            "code":"POT",
            "name":"PotCoin"
         },
         {
            "code":"VTC",
            "name":"Vertcoin"
         },
         {
            "code":"ZEC",
            "name":"ZCash"
         }
      ]
   }
} 



/wallets/getWalletsHealth/

Used to retrieve wallets status & health. It returns all the information relative to the specified wallet, if any parameter is attached.

Parameters




Coin ticker (optional)   a string literal for the coin. (ie. BTC)

Request:

        https://api.bitsails.com/wallets/getWalletsHealth/{coin ticker}


Response
     [
   {
      "Health":{
         "Currency":"BTC",
         "DepositQueueDepth":0,
         "WithdrawQueueDepth":0,
         "BlockHeight":643357,
         "WalletConnections":31,
         "MinutesSinceBHUpdated":21,
         "LastChecked":"Date(1597230002000)",
         "IsActive":1
      },
      "Currency":{
         "Currency":"BTC",
         "CurrencyLong":"Bitcoin",
         "MinConfirmation":2,
         "TxFee":0.0003,
         "IsActive":1,
         "CoinType":"BITCOIN",
         "BaseAddress":"",
         "Notice":null
      }
   }
]  



/wallets/deleteWithdrawRequest/

Used to delete a pending withdraw request.

Parameters




id (required)   an integer indicating the ID of the withdraw you want to delete. (This works with pending withdrawals only.)

Request:

        https://api.bitsails.com/wallets/deleteWithdrawRequest/{id}


Response
  



/wallets/withdrawRequest/

Used to make a withdraw request.

Parameters




Coin (required - POST)  Specify the order type: 1 for Market order, 2 for Limit orders (recommended).



Amount (required - POST)  Specify the order side: 1 is for BUY, 2 is for SELL.

Address (required - POST)  Specify the order amount in satoshis (ie. 1 BTC = 100000000).

Twofa (required - POST)  Specify the order price in satoshis (ie. 1 BTC = 100000000)

Request:

        https://api.bitsails.com/wallets/withdrawRequest/
Example:
         curl -d "Coin=BTC&Amount=1000000&Address=1maw7jyfRZFmvCaSjenMdhJ974YoRUTc1&Twofa=722253" -i -X POST -H "token-authorization-x: YOUR_API_KEY_HERE" https://api.bitsails.com/wallets/withdrawRequest/


Response