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, Kraken)
- 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.1256);
})();
Configuration
convert.setOptions({
crypto_interval: 5000,
fiat_interval: (60 * 1e3 * 60),
calculateAverage: true,
binance: true,
bitfinex: true,
coinbase: true,
kraken: true,
onUpdate: (tickers, isFiatUpdate?)=> any
});
HTTP API
Free public API
https://api.coinconvert.net/convert/btc/usd?amount=1
CDN
<script src='https://coinconvert.net/assets/js/crypto-convert.min.js'></script>
Other parameters
Get crypto prices last updated timestamp (ms)
console.log(convert.lastUpdated)
Get the list supported currencies
console.log(convert.list);
Get cryptocurrencies metadata (title/symbol/logo/rank)
console.log(convert.cryptoInfo);