Crypto-Convert
Convert crypto to fiat and vice-versa instantly.
- Top 100 Cryptocurrencies Supported
- 20+ fiats Supported
- Instantly convert, no slow promises.
- Cross-compatible on Node.js & Browser
- Price & Ticker information updated on a configurable interval from multiple secure sources (Binance, Bitfinex, Coinbase)
- Any pair can be converted, be it Crypto -> Crypto or Fiat -> Crypto.
Installation
npm i crypto-convert
Import
import convert from 'crypto-convert';
Or with require
, import it like this to get TypeScript:
const convert = require("crypto-convert").default;
Usage
(async function(){
await convert.ready();
convert.BTC.USD(1);
convert.ETH.JPY(255);
convert.LINK.LTC(5);
convert.USD.CRO(100);
new convert.from("BTC").to("USD").amount(1);
})();
Configuration
convert.setOptions({
crypto_interval: 5000,
fiat_interval: (60 * 1e3 * 60),
calculateAverage: true,
binance: true,
bitfinex: true,
coinbase: true,
onUpdate: (tickers, isFiat?)=> any
});
CDN
<script src='https://coinconvert.net/assets/js/crypto-convert.min.js'></script>
API
Free public API
https://api.coinconvert.net/convert/btc/usd?amount=1