Skip to content
Discussion options

You must be logged in to vote

Exchange Rate API supports both single-date historical lookups and date range time series.

JavaScript:

import { ExchangeRateAPI } from '@exchangerateapi/sdk';
const client = new ExchangeRateAPI({ apiKey: 'era_live_YOUR_KEY' });

// Single date
const data = await client.forDate('2026-01-15', { base: 'USD', symbols: ['EUR', 'GBP'] });
console.log(data.rates); // { EUR: 0.92, GBP: 0.78 }

// Time series (date range)
const series = await client.timeSeries('2026-01-01', '2026-03-31', {
  base: 'USD',
  symbols: ['EUR'],
});

// Preset periods: 1d, 7d, 30d, 1y
const history = await client.getHistoricalRates('USD', 'EUR', '30d');

Python:

from exchangerateapi import ExchangeRateAPI
client = Excha…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by cahthuranag
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant