
Research
/Security News
737 Chrome VPN Extensions Linked to Brand Impersonation and Browser Traffic Redirection
The campaign amassed more than 75,000 installs by targeting Russian-speaking users seeking access to blocked services.
@exchangerateapi/sdk
Advanced tools
Exchange Rate API — Real-time mid-market currency exchange rates for Node.js and browsers. 160+ currencies from Reuters/Refinitiv, zero dependencies, free tier.
Official JavaScript/TypeScript SDK for Exchange Rate API. Access real-time and historical mid-market exchange rates for 160+ currencies. Zero dependencies.
npm install @exchangerateapi/sdk
import { ExchangeRateAPI } from '@exchangerateapi/sdk';
const client = new ExchangeRateAPI({ apiKey: 'era_live_...' });
// Get latest rates
const { rates } = await client.latest({ base: 'USD', symbols: ['EUR', 'GBP', 'JPY'] });
console.log(rates); // { EUR: 0.92, GBP: 0.78, JPY: 149.5 }
// Convert currencies
const result = await client.convert('USD', 'EUR', 1000);
console.log(`$1,000 = EUR ${result.result}`);
All API requests require a Bearer token. Get your free API key at exchange-rateapi.com/register.
const client = new ExchangeRateAPI({ apiKey: 'era_live_your_key_here' });
The SDK sends the key as a Bearer token in the Authorization header automatically.
You can also override the API key on a per-request basis:
const data = await client.latest({ apiKey: 'era_live_other_key' });
const client = new ExchangeRateAPI({
apiKey: 'era_live_...', // Required. Your API key.
baseUrl: 'https://exchange-rateapi.com', // Optional. Default shown.
timeout: 10000, // Optional. Request timeout in ms. Default: 10000.
});
latest(options?)Get the latest exchange rates.
// All rates from USD
const data = await client.latest();
// Specific symbols with EUR base
const data = await client.latest({ base: 'EUR', symbols: ['USD', 'GBP', 'JPY'] });
console.log(data.base); // 'EUR'
console.log(data.date); // '2026-05-10T12:00:00Z'
console.log(data.rates); // { USD: 1.08, GBP: 0.85, JPY: 162.3 }
forDate(date, options?)Get exchange rates for a specific historical date.
// Using a string
const data = await client.forDate('2026-01-15');
// Using a Date object
const data = await client.forDate(new Date('2026-01-15'));
// With options
const data = await client.forDate('2026-01-15', {
base: 'EUR',
symbols: ['USD', 'GBP'],
});
timeSeries(startDate, endDate, options?)Get exchange rate time series between two dates.
const data = await client.timeSeries('2026-01-01', '2026-03-31', {
base: 'USD',
symbols: ['EUR', 'GBP'],
});
// Access rates by date
console.log(data.rates['2026-01-15']); // { EUR: 0.92, GBP: 0.78 }
convert(from, to, amount, options?)Convert an amount between two currencies.
// Current rate
const result = await client.convert('USD', 'EUR', 1000);
console.log(`$1,000 = EUR ${result.result}`);
// Historical conversion
const result = await client.convert('USD', 'EUR', 1000, {
date: '2026-01-15',
});
console.log(`Rate on Jan 15: ${result.rate}`);
getRate(from, to, amount?)Get exchange rate between two currencies.
const rate = await client.getRate('USD', 'EUR');
console.log(`1 USD = ${rate.rate} EUR`);
// With amount
const rate = await client.getRate('USD', 'EUR', 1000);
console.log(`$1,000 = EUR ${rate.to.amount}`);
getRates(source, target)Get authenticated exchange rates with metadata.
const rates = await client.getRates('USD', 'EUR');
rates.forEach(r => console.log(`${r.source}/${r.target}: ${r.rate} at ${r.time}`));
getHistoricalRates(source, target, period?)Get historical rates by period. Supported periods: 1d, 7d, 30d, 1y.
const history = await client.getHistoricalRates('USD', 'EUR', '30d');
history.rates.forEach(point => {
console.log(`${point.time}: ${point.rate}`);
});
symbols()Get all supported currency symbols.
const { symbols } = await client.symbols();
console.log(symbols);
// { USD: 'United States Dollar', EUR: 'Euro', GBP: 'British Pound', ... }
// Build a currency dropdown
const options = Object.entries(symbols).map(([code, name]) => ({ code, name }));
import { ExchangeRateAPI, ExchangeRateAPIError } from '@exchangerateapi/sdk';
const client = new ExchangeRateAPI({ apiKey: 'era_live_...' });
try {
const data = await client.latest();
} catch (err) {
if (err instanceof ExchangeRateAPIError) {
console.error(`API error: ${err.message} (status: ${err.status})`);
}
}
const { ExchangeRateAPI } = require('@exchangerateapi/sdk');
const client = new ExchangeRateAPI({ apiKey: 'era_live_...' });
MIT - see LICENSE for details.
FAQs
Exchange Rate API — Real-time mid-market currency exchange rates for Node.js and browsers. 160+ currencies from Reuters/Refinitiv, zero dependencies, free tier.
We found that @exchangerateapi/sdk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
/Security News
The campaign amassed more than 75,000 installs by targeting Russian-speaking users seeking access to blocked services.

Company News
Open source maintainers are under more pressure than ever. We're raising our open source program from the Team plan to the Business plan, free.

Security News
The supply chain control that delays freshly published gems now covers lockfile generation and gem vendoring in Ruby projects.