BTClevels | API description
Public
http://btclevels.com/api/public
Parameters: "key": name of the key(optional), "secret": secret code(optional).
"period": expiration period in minutes (60, 240, 480, 1440)
Will return:
{
"timestamp":"1407173334",
"info":
{
   "expiration":1407168740,
   "stock_price":"591.300000",
   "stopinvest":1407166740,
   "prev_expiration":
   {
      "date":"1407087540"
      "value":"588.29"
   },
   "settings":
   {
      "minamount":"0.01"
      "maxamount":"100"
      "projectfee":"2"
   },
   "data":
   {
      "xi":"0"
      "r1":"1"
      "rsun":"1"
   },
   "bets":
   {
      "higher_count":"3"
      "higher_amount":"0.17427"
      "higher_percent":"77.71"
      "lower_count":"1"
      "lower_amount":"0.05"
      "lower_percent":"22.29"
      "total_count":"4"
      "total_amount":"0.22427"
   }
}
}
Where:
"timestamp" - current server time (UTC);
"expiration" - time of next expiration (UTC);
"stock_price" - Stock last price;
"stopinvest" - time of last bets accepted;
"prev_expiration" - previous expidation data;
"minamount" - min bet amount (BTC);
"maxamount" - max bet amount (BTC);
"projectfee" - btclevels service fee percent;
"xi" - sum of user bets for timezone;
"r1" - current timezone multiplier;
"rsum" - sum of multipliers;
"higher_count" - count of bets with "higher" prediction;
"higher_amount" - amount of bets with "higher" prediction;
"higher_percent" - percent of bets with "higher" prediction;
"lower_count" - count of bets with "lower" prediction;
"lower_amount" - amount of bets with "lower" prediction;
"lower_percent" - percent of bets with "lower" prediction;
"total_count" - total bets count;
"total_amount" - total bets amount.
Info
http://btclevels.com/api/info
Parameters: "key": name of the key, "secret": secret code.
Will return:
{
"result":"success",
"info":
{
   "balance":"0.000500",
   "actualbalance":0.000500,
   "deposit_addr":"1Fg7hFkEeeT4vavpXAaLiaTcwHcWvNThfL"
},
"timestamp":1381264988
}
Where:
"result" - a result of the operation (a success or error with the error description);
"balance" - account balance;
"actualbalance" - balance with more than 6 confirmations;
"deposit_addr" - bitcoin address for deposits;
"timestamp" - current server time (UTC).
Trade
http://btclevels.com/api/trade
Parameters: "key": name of the key, "secret": secret code, "amount": transaction amount, "prediction": prediction if the price would decrease or increase, "period": expiration period in minutes (60, 240, 480, 1440)
Will return:
{
"result":"success",
"trade":
{
   "order_id":3103,
   "amount":0.0005,
   "prediction":"higher",
   "multiplier":1.2689285714286,
   "winamount":"0.00063",
   "expiration":1381268400,
   "stock_price":"137"
   "xi":"0"
   "r1":"1"
   "rsum":"1"
},
"timestamp":1381265469
}
Where:
"result" - a result of the operation (a success or error with the error description);
"order_id" - ID of the bet;
"amount " - bet amount;
"prediction" - bet prediction;
"multiplier" - multiplier for calculation of the winnings;
"winamount" - the amount you win (in case of winning);
"expiration" - time of the expiration;
"stock_price" - Stock last price;
"timestamp" - current server time (UTC); "xi" - sum of user bets for timezone;
"r1" - current timezone multiplier;
"rsum" - sum of multipliers.
Result
http://btclevels.com/api/result
Parameters: "key": name of the key, "secret": secret code, "order_id": ID of the bet
Will return:
{
"result":"success",
"order_info":
{
   "order_id":3103,
   "pair":BTCUSD,
   "amount":"0.0005",
   "prediction":"higher",
   "expiration":1381268400,
   "stock_price":"137",
   "xi":0,
   "r1":1,
   "rsum":1,
   "status":"lost",
   "expiration_price":"137"
},
"timestamp":1381325926
}
Where:
"result" - result of the operation (success or error with the error description);
"order_id" - ID of the bet;
"pair" - currency pair;
"amount " - bet amount;
"prediction" - bet prediction;
"winamount" - the amount you win (in case of winning);
"expiration" - time of the expiration;
"stock_price" - Stock price for the time when the bet was made;
"xi" - sum of user bets for timezone;
"r1" - current timezone multiplier;
"rsum" - sum of multipliers;
"status" - status description;
"expiration_price" - Stock price for the expiration time;
"timestamp" - current server time (UTC).
Bets
http://btclevels.com/api/bets
Parameters: "key": name of the key, "secret": secret code, "from": date in unix-format, "to": date in unix-format.
Will return:
{
"result":"success",
"bets":
{
   "id":"3680",
   "date":"1407261217",
   "pair":"BTCUSD",
   "prediction":"higher",
   "level":"580",
   "expiration":"1407281217",
   "amount":"1",
   "income":"1.05",
   "status":"waiting expiration",
   "xi":"0",
   "r1":"1",
   "rsum":"1",
},
"timestamp":"1407173334"
}
Where:
"id" - order ID;
"date" - date of order;
"pair" - currency pair;
"prediction" - bet prediction;
"level" - stock price on moment when bet was made;
"amount" - bet amount (BTC);
"income" - win amount (BTC);
"status" - status of order;
"xi" - sum of user bets for timezone;
"r1" - current timezone multiplier;
"rsum" - sum of multipliers;
"timestamp" - current server time (UTC).