API Documentation


Public API

Public methods do not require the use of an api key and can be accessed via the GET method.

General Market Data

Single market

Full URL: https://lionbit.exchange/page/api?method=singlemarket&marketid={MARKET_ID}

HTTP Request:

GET /page/api?method=singlemarket&marketid={MARKET_ID} Host: lionbit.exchange

All markets

Full URL: https://lionbit.exchange/page/api?method=allmarket

HTTP Request:

GET /page/api?method=allmarket Host: lionbit.exchange

General Orderbook Data

Single market

Full URL: https://lionbit.exchange/page/api?method=singlemarket&marketid={MARKET_ID}

HTTP Request:

GET /page/api?method=singlemarket&marketid={MARKET_ID} Host: lionbit.exchange

All markets

Full URL: https://lionbit.exchange/page/api?method=allorder

HTTP Request:

GET /page/api?method=allorder Host: lionbit.exchange

Authenticated API

Common authentication parameters

Authenticated methods require the use of an api key and can only be accessed via the POST method.

URL: https://lionbit.exchange/page/api?method=METHOD&key=KEY&sign=SIGN

  • SIGN: Your username.
  • KEY: Your password.
  • METHOD: The method from the list below which you are accessing.

General Return Values:

  • success: Either 1 or 0. 1 represents a sucessful call, 0 represents unsuccessful.
  • error: If unsuccessful, this will be the error message.
  • return: If successful, this will be the data returned.

getmarkets

Inputs: n/a

Outputs: Array of active markets

  • marketid: Integer value representing a market
  • label: Name for this market, for example: XP/BTC
  • primary_currency_code: Primary currency code, for example: XP
  • primary_currency_name: Primary currency name, for example: Experience Points
  • secondary_currency_code: Secondary currency code, for example: BTC
  • secondary_currency_name: Secondary currency name, for example: BitCoin
  • last_trade: Last trade price for this market
  • high_trade: 24 hour highest trade price in this market
  • low_trade: 24 hour lowest trade price in this market
  • created: Datetime (EST) the market was created

getwallets

Input: n/a

Outputs: Array of active wallets

  • currencyid: Integer value representing a wallet
  • name: Name for this wallet, for example: Bitcoin
  • code: Currency code, for example: BTC
  • withdrawfee: Fee charged for withdrawals of this currency

mydeposits

Input: n/a

Outputs: Array of deposits on your account

  • currencyid: Integer value representing a wallet
  • created: The time the activity posted
  • updated: The time the activity updated
  • address: Address to which the deposit posted was sent
  • amount: Amount of transaction (Not including any fees)
  • transactionid: Network Transaction ID (If available)

mywithdrawals

Input: n/a

Outputs: Array of withdrawals on your account

  • currencyid: Integer value representing a wallet
  • created: The time the activity posted
  • toaddress: Address to which the withdraws posted was received
  • amount: Amount of transaction (Not including any fees)
  • feeamount: Fee (If any) Charged for this Transaction (Generally only on Withdrawals)
  • receiveamount: Amount of transaction was received
  • transactionid: Network Transaction ID (If available)

mytransfers

Input: n/a

Outputs: Array of transfer on your account

  • currency: Name representing a wallet
  • time: The time the activity created
  • sender: Username sending transfer
  • receiver: Username receiving transfer
  • amount: Amount of transaction

getmydepositaddresses

Input: n/a

Outputs: Array of deposit addresses for each wallet.

  • coincode: Type of wallet
  • despositaddress: Your deposit address

allmyorders

Input: n/a

Outputs: Array of open orders for your account.

  • orderid: Order ID for this order
  • marketid: The Market ID this order was created for
  • created: Datetime the order was created
  • ordertype: Type of order (Buy/Sell)
  • price: The price per unit for this order
  • fromvalue: Amount from sender
  • tovalue: Amount which receiver was received

myorders

Input:

  • marketid: Market ID for which you are querying

Outputs: Array of your orders for this market listing your current open sell and buy orders.

  • orderid: Order ID for this order
  • created: Datetime the order was created
  • ordertype: Type of order (Buy/Sell)
  • price: The price per unit for this order
  • fromvalue: Amount from sender
  • tovalue: Amount which receiver was received

Example: PHP Code
function api($method, array $req = array()) { $req['key'] = ''; // your password account $req['sign'] = ''; // your username account $req['method'] = $method; // generate the POST data string $post_data = http_build_query($req, '', '&'); $re = file_get_contents('https://lionbit.exchange/page/api?'. $post_data, true); $dec = json_decode($re, true); return $dec; } $result = api("getmarkets"); //$result = api("getwallets"); //$result = api("mydeposits"); //$result = api("mywithdraws"); //$result = api("mytransfers"); //$result = api("getmydepositaddresses"); //$result = api("allmyorders"); //$result = api("myorders"); //print_r($result, true);

Push API

Using our Push API service you can get information on trades and market data in real time. Using a client to connect to the service, you can subscribe to channels you wish to receive data on. You can subscribe to as many channels as you wish.

Channels
trade.X

X is the Market ID for which you would like to subscribe. For example "trade.3" would be the XP/BTC market.

Data format (event "message"):

{ "channel": "trade.53", "trade": { "timestamp": 1535555346, "datetime": 2018-08-29 15:09:06 UTC, "marketid": "53", "marketname": "XP/BTC", "amount": "0.02523500", "price": "0.00000001", "total": "0.00000027", "type": "Sell" } }

ticker.X

(X is the Market ID for which you would like to subscribe. For example "ticker.3" would be the XP/BTC market)

Data format (event "message"):

{ "channel": "ticker.160", "trade": { "timestamp": 1535555346, "datetime": 2018-08-29 15:09:06 UTC, "marketid": "160", "topsell": { "price": "0.00451039", "amount": "12.31881709" }, "topbuy": { "price": "0.00450001", "amount": "49.28204222" } } }

Client Libraries

You can find client libraries in several programming languages here: http://pusher.com/docs/client_libraries

API Keys

When connecting to our service you will need to use the following API Key:

APP_KEY = 'f17deaed88fc4c8d8d88'

Example: Sample Client

<html> <head> <title>Pusher Test</title> <script src="https://lionbit.exchange/assets/js/pusher.min.js"></script> <!-- http://js.pusher.com/2.2/pusher.min.js --> <script type="text/javascript"> // Enable pusher logging - don't include this in production Pusher.log = function(message) { if (window.console && window.console.log) { window.console.log(message); } }; var pusher = new Pusher("f17deaed88fc4c8d8d88"); var channel = pusher.subscribe("trade.33"); channel.bind("message", function(data) { console.log("trade.33",data); }); var channel2 = pusher.subscribe("ticker.33"); channel2.bind("message", function(data) { console.log("ticker.33",data); }); </script> </head> <body> <h2>Test Pusher Client</h2> <p>Please press F12 and click tab "Console" to view result</p> </body> </html>