Public API

Public API BitBay 2.0

Placing requests:


https://bitbay.net/API/Public/[Currency 1][Currency 2]/[Category].json
  • Currency 1 - necessary, shortcut of cryptocurrency (BTC or LTC)
  • Currency 2 - optional, if not specified default currency is USD
  • Category - type of request, available types:
    • trades - last transactions
    • orderbook - orders from stock market
    • market - orders from stock market and last transactions
    • ticker - basic statistics
    • all - all above informations combined in one object

Details

trades - last transactions

Zwraca Returns an array of JSON objects, ordered from oldest to newest, maximum is 50, that means default request returns 50 oldest transactions in specified currency


[{"date":1396340859,"price":1524.50,"amount":0.08000000,"tid":"44"},{"date":1396340875,"price":1525.00,"amount":0.13000000,"tid":"45"}]

Available fields in each JSON object:

  • date - date of transaction in unix timestamp
  • price - rate
  • amount - amount of cryptocurrency in that transaction
  • tid - unique transaction id

It is possible to get the transactions starting from specified id, by sending parameter "since" using GET method. As value of since parameter you have to insert proper tid of transaction which you want to start from (excluding that transaction), e.g.: https://bitbay.net/API/Public/BTCPLN/trades.json?since=43 get all transactions from 44 (43 is not included).

In this way you can get all transactions by calling this method several times and passing as "since" tid of last transaction of previous request.

Optionally, you can use the parameter "sort", which takes two values "desc" - returns the transactions in the order of newest to oldest, and "asc" for the return transaction in reverse order.

orderbook - orders from the stock market

Returns an object which consists of 2 keys: bids and asks, which are sequentially arrays of purchase and sell orders.
Units of this arrays are also arrays and consist of 2 elements. The first one is rate, and second is an amount of cryptocurrency in that order.


{"bids":[[1519.00,0.07],[1513.00,0.13]],"asks":[[1529.00,0.09],[1531.00,0.12]]}

market - orders from stock market and last transactions Request which combines two above listed methods. Returns an object, which contains keys bids, asks and transactions. This method works as in above examples.
This request can also have "since" parameter, which affect to transactions array, and works as in trades method.

ticker - basic statistics Returns JSON object, which looks as follows:


{"max":4500,"min":1465,"last":1533,"bid":1513,"ask":1542,"vwap":1524.42,"average":1545.67,"volume":4.54042857}

where: max is the rate of transaction, which had highest value min is the rate of transaction, which had lowest value bid is the most profitable rate of active purchase orders
ask is the most profitable rate of active sell orders vwap is the weighted average from last 24 hours average is the average rate of 3 best sell orders

all - all above informations combined Returns JSON object, which looks like:


{"max":4500,"min":1465,"last":1533,"bid":1513,"ask":1542,"vwap":1524.42,"average":1545.67,"volume":4.54042857, "bids" {...}, "asks": {...}, "transactions": {...}}