1.0.0 • Published 12 months ago
@everapi/fxapi-js v1.0.0
fxapi-js: JS Currency Converter
Fxapi.com is a foreign exchange rates API that provides historic & realtime data. This package is a JavaScript wrapper for fxapi.com that aims to make the usage of the API as easy as possible in your project.
Installation
npm
npm install --save @everapi/fxapi-js
yarn
yarn add @everapi/fxapi-js
Import
import FxAPI from '@everapi/fxapi-js';
or use it directly in a Browser:
<script src="path/to/fxapi-js/index.js"></script>
Usage
Initialize the API with your API Key (get one for free at fxapi.com):
const fxApi = new FxAPI('YOUR-API-KEY');
Afterwards you can make calls to the API like this:
fxApi.latest({
base_currency: 'USD',
currencies: 'EUR'
}).then(response => {
console.log(response);
});
Endpoints accessible with a free account:
status
currencies
latest
historical
These advanced endpoints currently require a paid subscription:
convert
range
Find out more about our endpoints, parameters and response data structure in the docs
License
The MIT License (MIT). Please see License File for more information.
1.0.0
12 months ago