openexchangerates / npm-exchange-rates Goto Github PK
View Code? Open in Web Editor NEWnodeJS / npm module to load real-time exchange rates from the Open Exchange Rates API
Home Page: https://openexchangerates.org
nodeJS / npm module to load real-time exchange rates from the Open Exchange Rates API
Home Page: https://openexchangerates.org
Hi there, on your supported currencies API doc I read that as of November 1st you will be moving Ethereum and LiteCoin to from the alternative to the primary currencies but for until then I was wondering how I could include the show_alternatives
parameter in the API call using this package?
any planned date for supporting HTTPS connections?
An API key is needed to invoke http://openexchangerates.org/api/latest.json now. Please help to support passing API key.
Hi, I'm trying to do a currency converter (I already have added the option to set the base currency), but I think it lacks a method that helps getting the currencies.json data.
I've thought of loading it locally (downloading the file) but it'd be better if a method like oxr.currencylist
or something like that could be done. I could also load them in a database like CouchDB (I don't see why should I use a relational DB here).
oxr.timestamp undefined
oxr.base USD
oxr.rates {}
const oxr = require('open-exchange-rates');
oxr.set({ app_id: OXR_APP_ID })
await oxr.latest();
// You can now use `oxr.rates`, `oxr.base` and `oxr.timestamp`
console.log('oxr.rates', oxr.rates);
console.log('oxr.base', oxr.base);
console.log('oxr.timestamp', oxr.timestamp);
Using version 0.3.0
My app id works fine using:
https://openexchangerates.org/api/latest.json?app_id=
UPDATE:
It appears it doesn't work with "await".
The following works but I am not sure how to use it like that for my use case as I need to wait for the results and then do something else.
oxr.latest(function() {
// You can now use `oxr.rates`, `oxr.base` and `oxr.timestamp`
console.log('oxr', oxr);
console.log('oxr.rates', oxr.rates);
console.log('oxr.base', oxr.base);
console.log('oxr.timestamp', oxr.timestamp);
});
This library is weird. Why do you store the rates in a kinda global variable? What happens if I query multiple times for multiple dates. One has to implement a kind of global queue just because this library is poorly implemented. oxr.historical
should not store the rates to the oxr
object but pass it into the callback as an argument. Also what about error handling?
Hi
I've implemented the code successfully, just to find there are codes not supported. Is there a list of exchange rates supported? Can more be added?
Best regards
Andre
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.