Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/0xdaksh/crypto-price

A JavaScript Module that allows you to get Crypto Currency price to Local Currency.
https://github.com/0xdaksh/crypto-price

btc crypto currency eth ltc module nodejs npm

Last synced: 2 months ago
JSON representation

A JavaScript Module that allows you to get Crypto Currency price to Local Currency.

Awesome Lists containing this project

README

        

# Crypto-Price

Crypto Price is a Node.js Module that provides an Easy API which allows users to easily get crypto currency price in their Local / Base Currency and returns a Promise that gives you the price.

## Supported Crypto Currencies

- Ethereum (ETH)
- Bitcoin (BTC)
- Litecoin (LTC)
- Monero (XMR)
- Ripple (XRP)
- ZCash (ZEC)
- Many More ([Here's a list of them.](https://www.cryptonator.com/api/currencies))

## API (with Example)

### getCryptoPrice

The getCryptoPrice allows you to get the price of crypto currency from your base currency.

```javascript

let price = require('crypto-price')
price.getCryptoPrice(base, crypto).then(obj => { // Base for ex - USD, Crypto for ex - ETH
console.log(obj.price)
}).catch(err => {
console.log(err)
})

```

### getBasePrice

The getBasePrice allows you to get the price of base currency from your crypto currency.

```javascript

let price = require('crypto-price')
price.getBasePrice(base, crypto).then(obj => { // Base for ex - USD, Crypto for ex - ETH
console.log(obj.price)
}).catch(err => {
console.log(err)
})

```

## License
Copyright [Daksh Miglani](https://dak.sh), Licensed Under MIT 2017.