Comments (3)
If the https://ratesapi.io/ and https://exchangerate.host/ APIs are able to provide the exact same API responses, perhaps @over-engineer might consider making a one line fix to switch to one of these?
from exchange-rates.
Hey @mickyjohnstonmonotype, thanks for bringing this to my attention! It's unfortunate that exchangeratesapi.io (afaict) changed without any prior notice.
Likely, this wrapper works with pretty much any Fixer.io-compatible API. That means, switching to ratesapi.io was a drop-in replacement, like @kwerty suggested.
I just pushed an update to npm, so it now uses ratesapi.io by default. 😄
You just have to update to the latest version (1.1.0) and everything will be back to normal. No breaking changes.
I've also added a new setApiBaseUrl()
function, which allows you to use a different API (any Fixer.io-compatible API will probably work).
For example, you can switch to exchangerate.host like this:
const { exchangeRates } = require('exchange-rates-api');
(async () => {
await exchangeRates()
.setApiBaseUrl('https://api.exchangerate.host')
.latest()
.fetch(); // {THB: 34.978, PHP: 58.159, …, HUF: 323.58}
})();
from exchange-rates.
The alternative API is now blocking CORS also.
Good thinking ahead @over-engineer ! Switched to another API with ease
await exchangeRates().setApiBaseUrl('https://api.exchangerate.host').
from exchange-rates.
Related Issues (12)
- .avg() in convert
- ratesapi.io is dead HOT 10
- Automatically try alternative APIs when an API goes down HOT 1
- Add ExchangeRate-API.com
- Convert with different API
- Add more unit tests
- @types package not up to date
- api.exchangerate.host down?
- Custom API in Convert()
- (node:46208) UnhandledPromiseRejectionWarning: ExchangeRatesError: Couldn't fetch the exchange rate, API returned a bad response (HTTP 400) HOT 1
- Dates missing with historical data?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from exchange-rates.