financialmodelingprep
Version:
This module is a node wrapper for the free [Financial Modeling Prep API](https://financialmodelingprep.com/developer/docs). This node application implements almost all aspects of the FMP API.
12 lines (8 loc) • 445 B
JavaScript
const { makeRequest, generateJson } = require('./utilities');
module.exports = (from_curr, to_curr) => {
return {
rate: () => makeRequest('quote', generateJson(from_curr + to_curr)),
history: ({ start_date, end_date, data_type, limit } = {}) => makeRequest('historical-price-full/forex', generateJson(from_curr + to_curr, { from: start_date, to: end_date, serietype: data_type, timeseries: limit }))
}
};