Difference between revisions of "Do you have an API?"

From Bittylicious
Jump to navigation Jump to search
 
(8 intermediate revisions by the same user not shown)
Line 21: Line 21:
* '''coin''': The cryptocurrency type
* '''coin''': The cryptocurrency type
* '''fixedPortion''': The amount of the fiat paid which is fixed (i.e. added to all sales via this offer). totalPrice already includes this portion.
* '''fixedPortion''': The amount of the fiat paid which is fixed (i.e. added to all sales via this offer). totalPrice already includes this portion.
* '''minAmount''': The minimum amount of coins that can be bought/sold
* '''maxAmount''': The maximum amount of coins that can be bought/sold


==Quote (amount of fiat)==
==Quote (amount of fiat)==
Line 40: Line 42:
* '''coin''': The cryptocurrency type
* '''coin''': The cryptocurrency type
* '''fixedPortion''': The amount of the fiat paid which is fixed (i.e. added to all sales via this offer). totalPrice already includes this portion.
* '''fixedPortion''': The amount of the fiat paid which is fixed (i.e. added to all sales via this offer). totalPrice already includes this portion.
* '''minAmount''': The minimum amount of fiat that can be bought/sold
* '''maxAmount''': The maximum amount of fiat that can be bought/sold


==Ticker for all currency pairs==
==Ticker for all currency pairs==
Line 55: Line 59:
** volume_24h: Volume over the last twenty four hours
** volume_24h: Volume over the last twenty four hours
** rates:
** rates:
*** last: Last price a sale was made at
*** last: Last price a sale was made at (assuming the trade was done in the last month, ''null'' if the last trade was more than one month ago)


Example:
Example:
Line 64: Line 68:
   "ZARBTC":"avg_1h":null,"avg_3h":null,"avg_6h":null,"avg_12h":null,
   "ZARBTC":"avg_1h":null,"avg_3h":null,"avg_6h":null,"avg_12h":null,
   "avg_24h":null,"volume_24h":"0.00000000","rates":{"last":null}}}
   "avg_24h":null,"volume_24h":"0.00000000","rates":{"last":null}}}
The ticker is updated every 60 seconds so please do not call this more often than once every 60 seconds. Trying to get around this with a nonce parameter will not work.


=Trade list for the last day=
=Trade list for the last day=
'''Note: Using ''COIN/CURRENCY'' pairs instead of ''ALL/ALL'' is now deprecated and will be removed in a future Bittylicious release.'''


''https://bittylicious.com/api/v1/trades/COIN/CURRENCY''
''https://bittylicious.com/api/v1/trades/COIN/CURRENCY''


* '''COIN''': The virtual currency, e.g. BTC
or
* '''CURRENCY''': The currency, e.g. GBP
 
''https://bittylicious.com/api/v1/trades/COIN/CURRENCY?fromTID=tradeID''
 
* '''COIN''': The virtual currency or ALL for all virtual currencies, e.g. BTC
* '''CURRENCY''': The fiat currency or ALL for all fiat currencies, e.g. GBP
* '''tradeID''': Optionally, the start '''tid''' (trade ID) you want to get in the response - useful for filtering out data you've already calculated


The returned list is an array with each entry containing the following values:
The returned list is an array with each entry containing the following values:


* timestamp: Unix timestamp corresponding to the time the trade ended
* timestamp: Unix timestamp corresponding to the time the trade ended.
* tid: The unique trade identifier
* tid: The unique trade identifier.
* fiat: The amount of fiat that was exchanged
* fiat: The amount of fiat that was exchanged.
* amount: The amount of virtual currency that was exchanged
* amount: The amount of virtual currency that was exchanged. This is negative if Bittylicious is buying coins from a user.
* currency: The fiat currency.
* coin: The virtual currency.
 
If you are a site that needs up to date trade information, please use ''api/v1/trades/ALL/ALL?fromTID=tradeID''. In other words, do not scan through each fiat/coin combination otherwise you will be blocked.
 
The trade kust is updated every 600 seconds if you are specifying specific coins/currency, or 120 seconds for the ''ALL/ALL'' pair. This is to encourage people to use ALL/ALL with a ''fromTID'' argument instead of enumerating all coin/currency pairs.


=User Interface=
=User Interface=

Latest revision as of 12:07, 1 July 2021

We have a simple API where you can get the current price offered by Bittylicious.

Prices

Quote (number of coins)

https://bittylicious.com/api/v1/quote/COIN/COUNTRY/CURRENCY/PAYMETHOD/AMOUNT/DIRECTION

  • COIN: The virtual currency, e.g. BTC
  • COUNTRY: The ISO country code, e.g. GB
  • CURRENCY: The currency, e.g. GBP
  • PAYMETHOD: The payment method, e.g. BANK, PINGIT or CASH
  • AMOUNT: The amount of virtual currency, e.g. 1
  • DIRECTION: The direction of the purchase, either BUY or SELL

For example, to return the current price of 1 BTC in the UK using GBP via bank transfer, call https://bittylicious.com/api/v1/quote/BTC/GB/GBP/BANK/1

Returns the following:

  • totalPrice: The amount of COIN
  • coin: The cryptocurrency type
  • fixedPortion: The amount of the fiat paid which is fixed (i.e. added to all sales via this offer). totalPrice already includes this portion.
  • minAmount: The minimum amount of coins that can be bought/sold
  • maxAmount: The maximum amount of coins that can be bought/sold

Quote (amount of fiat)

https://bittylicious.com/api/v1/quoteFiat/COIN/COUNTRY/CURRENCY/PAYMETHOD/AMOUNT/DIRECTION

  • COIN: The virtual currency, e.g. BTC
  • COUNTRY: The ISO country code, e.g. GB
  • CURRENCY: The currency, e.g. GBP
  • PAYMETHOD: The payment method, e.g. BANK, PINGIT or CASH
  • AMOUNT: The amount of fiat, e.g. 100
  • DIRECTION: The direction of the purchase, either BUY or SELL

For example, to return the number of BTC that 100 GBP can buy in the UK via bank transfer, call https://bittylicious.com/api/v1/quoteFiat/BTC/GB/GBP/BANK/100

Returns the following:

  • totalPrice: The amount of COIN
  • coin: The cryptocurrency type
  • fixedPortion: The amount of the fiat paid which is fixed (i.e. added to all sales via this offer). totalPrice already includes this portion.
  • minAmount: The minimum amount of fiat that can be bought/sold
  • maxAmount: The maximum amount of fiat that can be bought/sold

Ticker for all currency pairs

https://bittylicious.com/api/v1/ticker

This returns an array of currency pairs, e.g. GBPBTC, which in turn provides an array of pricing information. The structure is:

  • CurrencyPair, e.g. GBPBTC
    • avg_1h: Average price over the last hour
    • avg_3h: Average price over the three hours
    • avg_6h: Average price over the six hours
    • avg_12h: Average price over the twelve hours
    • avg_24h: Average price over the twenty four hours
    • volume_24h: Volume over the last twenty four hours
    • rates:
      • last: Last price a sale was made at (assuming the trade was done in the last month, null if the last trade was more than one month ago)

Example:

{"GBPBTC":{"avg_1h":"396.999997","avg_3h":"397.001120","avg_6h":"397.003127",
  "avg_12h":"397.036739","avg_24h":"397.535174","volume_24h":"40.19171396",
  "rates":{"last":"397.000000"}},
 "ZARBTC":"avg_1h":null,"avg_3h":null,"avg_6h":null,"avg_12h":null,
  "avg_24h":null,"volume_24h":"0.00000000","rates":{"last":null}}}

The ticker is updated every 60 seconds so please do not call this more often than once every 60 seconds. Trying to get around this with a nonce parameter will not work.

Trade list for the last day

Note: Using COIN/CURRENCY pairs instead of ALL/ALL is now deprecated and will be removed in a future Bittylicious release.

https://bittylicious.com/api/v1/trades/COIN/CURRENCY

or

https://bittylicious.com/api/v1/trades/COIN/CURRENCY?fromTID=tradeID

  • COIN: The virtual currency or ALL for all virtual currencies, e.g. BTC
  • CURRENCY: The fiat currency or ALL for all fiat currencies, e.g. GBP
  • tradeID: Optionally, the start tid (trade ID) you want to get in the response - useful for filtering out data you've already calculated

The returned list is an array with each entry containing the following values:

  • timestamp: Unix timestamp corresponding to the time the trade ended.
  • tid: The unique trade identifier.
  • fiat: The amount of fiat that was exchanged.
  • amount: The amount of virtual currency that was exchanged. This is negative if Bittylicious is buying coins from a user.
  • currency: The fiat currency.
  • coin: The virtual currency.

If you are a site that needs up to date trade information, please use api/v1/trades/ALL/ALL?fromTID=tradeID. In other words, do not scan through each fiat/coin combination otherwise you will be blocked.

The trade kust is updated every 600 seconds if you are specifying specific coins/currency, or 120 seconds for the ALL/ALL pair. This is to encourage people to use ALL/ALL with a fromTID argument instead of enumerating all coin/currency pairs.

User Interface

https://bittylicious.com/coin/COIN

https://bittylicious.com/coin/COIN/PAYMETHOD

  • COIN: Default to use this virtual currency, e.g. BTC
  • PAYMETHOD: Default to use this payment method, e.g. BANK, CASH, PINGIT