Giter Club home page Giter Club logo

crypto-price's Introduction

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.)

API (with Example)

getCryptoPrice

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

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.

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, Licensed Under MIT 2017.

crypto-price's People

Contributors

0xdaksh avatar aryaskov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

crypto-price's Issues

FetchError

Hey! This API was working perfectly for me till yesterday where I keep getting this error:

"Sorry, We couldn't get the Price. Error: FetchError: invalid json response body at https://thae3.variti.de/share/qMW1XZLxOa61?sid=1185&scheme=https&host=api.cryptonator.com&uri=%2fapi%2fticker%2fBTC-USD&t=1538432572964&sad=v%2f2R2OxQ%3d%3d&uid=vMwJRsnhUUX09Abd&uct=1538432572964&kct=0&m=2&ver=7&flags=2176&ua=15413514424748970322&v=NMuLfHEhdInUvdpAAmgtFQ reason: Unexpected token < in JSON at position 0"

Funny how the link in the error message works but my code doesnt. I'd appreciate a fix please

couldn't get the Price

Hey! API was working perfectly and now getting me this error:

1- Sorry, We couldn't get the Price. Error: TypeError: Failed to fetch
2- Access to fetch at 'https://api.cryptonator.com/api/ticker/USD-MATIC' from origin 'http://site.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

can some one help !

INR as base

Am i making any mistake or INR (Indian rupee) as a base isnt supported?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.