Forex API for Developers

Build trading dashboards, portfolio trackers, and alerting systems with real-time and historical exchange rate data. Simple auth, official SDKs, 160+ currencies.

What Developers Build with Forex Data

Exchange rate data powers a wide range of developer projects -- from personal side projects to production financial tools. Here are the most common use cases we see from developers using Exchange Rate API.

📊

Trading Dashboards

Build real-time dashboards that display live currency pairs, rate movements, and trend indicators. Use 60-second updates for near-real-time data without WebSocket complexity.

💼

Portfolio Trackers

Track multi-currency investment portfolios. Convert holdings to a single reporting currency and calculate gains/losses using historical rates for accurate performance metrics.

🔔

Alerting Systems

Set up rate-change alerts that notify users when a currency pair crosses a threshold. Poll every 60 seconds and trigger webhooks, emails, or push notifications on breakout moves.

Why Developers Choose Exchange Rate API

Developer experience matters. Exchange Rate API is built by developers, for developers. No bloated enterprise sales process, no opaque pricing, no XML responses from 2008. Just clean JSON, simple auth, and official SDKs.

Key API Endpoints for Forex Development

Latest Rates

GET /v1/latest?base=USD

Returns the most recent exchange rates for all 160+ currencies relative to your chosen base currency. Updated every 60 seconds.

Single Pair Rate

GET /v1/latest?base=EUR&target=JPY

Get the exchange rate for a specific currency pair. Ideal for conversion calculations and single-pair dashboards.

Historical Rates

GET /v1/historical?base=GBP&target=USD&period=30D

Retrieve historical exchange rates for charting and trend analysis. Supports 1D, 7D, 30D, and 1Y periods.

Code Example: Historical Rate Chart Data

This example fetches 30 days of EUR/USD historical data and formats it for a chart library like Chart.js or D3.

JavaScript (Node.js)
import ExchangeRateAPI from 'exchange-rateapi';

const client = new ExchangeRateAPI('YOUR_API_KEY');

async function getChartData(base, target, period) {
  // Fetch historical rates for the given period
  const history = await client.getHistorical({
    base,
    target,
    period  // '1D', '7D', '30D', or '1Y'
  });

  // Format for chart libraries (array of { date, rate } objects)
  const chartData = history.rates.map(point => ({
    date: point.date,
    rate: point.rate,
    label: `${base}/${target}`
  }));

  return chartData;
}

// Get 30 days of EUR/USD data for a line chart
const data = await getChartData('EUR', 'USD', '30D');
console.log(`Fetched ${data.length} data points`);
console.log(data[0]);
// { date: '2026-04-12', rate: 1.0842, label: 'EUR/USD' }

// Build an alert: notify when rate crosses a threshold
async function checkRateAlert(base, target, threshold) {
  const current = await client.getRate(base, target);

  if (current.rate >= threshold) {
    console.log(
      `ALERT: ${base}/${target} is now ${current.rate} (threshold: ${threshold})`
    );
    // Trigger notification (webhook, email, Slack, etc.)
  }
}

// Alert when GBP/JPY crosses 195.00
await checkRateAlert('GBP', 'JPY', 195.00);

Combine real-time polling with historical data to build powerful forex tools. Use the latest endpoint for live dashboards and the historical endpoint for trend charts, backtesting, and analytics.

Start Building with Forex Data

Get your free API key in seconds. 300 requests/month, real-time updates, historical data, and official SDKs.

Get Free API Key →