Forex API: Real-Time & Historical FX Rates for Developers

A REST forex API with live rates for 170+ currencies, 27 years of historical data, and JSON, XML, or JSONP responses. Free tier with no credit card. Code samples in Python, Node.js, Go, PHP, and cURL below — grab them and ship.

200 requests/day free · No card required · Pro plan from $9/mo for 25k/day + historical data

Live major FX pairs

Live rates, refreshed every 60 seconds via the public /api/v1/convert endpoint. Your integration will typically call /api/rates instead (shown in the code samples below) for bulk fetches with an API key.

Loading…
EUR/USD
1.17621
·
GBP/USD
1.35059
·
USD/JPY
158.93081
·
AUD/USD
0.71565
·
USD/CAD
1.37009
·
USD/CHF
0.78225
·
USD/CNY
6.82233
·

60-second quickstart

Pick your language, copy the snippet, replace YOUR_API_KEY. Every example hits the same /api/rates endpoint and returns a live JSON payload like the one on the right. Forex API responses are identical in shape whether you call them from Python, a browser, or a Go service.

curl "https://api.unirateapi.com/api/rates?api_key=YOUR_API_KEY&from=USD&to=EUR"
Example JSON response
{
  "amount": 1,
  "base": "USD",
  "rates": {
    "AUD": 1.3973,
    "CAD": 1.3701,
    "CHF": 0.7822,
    "EUR": 0.8502,
    "GBP": 0.7404,
    "JPY": 158.9308
  }
}

Responses are gzip‑compressed JSON served over HTTPS from a global edge. A single request typically completes in under 100 ms from any major region. Add &format=xml for XML or &format=jsonp&callback=cb for JSONP.

Ready to go deeper? The Python tutorial covers caching, pandas integration, and error handling for production apps.

Endpoint reference

Five endpoints cover 95% of real forex integrations: current rates, single-pair conversion, historical rates, time series, and currency metadata. All require api_key either as a query param or Authorization: Bearer header. Full OpenAPI spec and try-it console are in the Swagger docs.

GET /api/rates Current rates

Returns live forex rates for every supported currency against a chosen base, or a single pair if to is specified. Refreshed every 15 minutes.

Parameters
  • api_key — required
  • from — base currency (default USD)
  • to — optional target currency
  • amount — optional multiplier
  • format — json (default), xml, jsonp
Example
GET /api/rates?from=EUR&to=GBP
→ { "base": "EUR", "to": "GBP",
    "rate": 0.8573, "result": 0.8573 }
GET /api/convert Convert amount

Simpler variant that always returns a converted amount, not rate metadata. Use this when you only need the target value — a price label, an invoice line, a balance display.

Parameters
  • amount — required, float
  • from, to — ISO 4217 codes
  • format — json / xml / jsonp
Example
{
  "amount": 1000,
  "from": "EUR",
  "result": 870.89,
  "to": "GBP"
}
GET /api/historical/rates Historical (single date) Pro

Exchange rates for any specific date from 4 January 1999 onward. Typical use: accounting, tax reporting, backtesting, or invoice reconciliation. 1,000 calls/day on the Pro plan.

Parameters
  • date — required, YYYY-MM-DD
  • from, to, amount — same as /rates
Example
GET /api/historical/rates
  ?date=2020-03-16&from=USD&to=EUR
→ { "date": "2020-03-16", "rate": 0.8965 }
GET /api/historical/timeseries Date range Pro

Range queries up to 5 years per call. Perfect for charts, trend analysis, or bulk loading a pair into a data warehouse. Include a comma-separated currencies list to cut payload size.

Parameters
  • start_date, end_date — required
  • base — default USD
  • currencies — comma-separated filter
Example
GET /api/historical/timeseries
  ?start_date=2024-01-01
  &end_date=2024-01-07
  &base=USD&currencies=EUR,GBP
GET /api/currencies Metadata

Lists every supported currency code. Useful for populating a dropdown in your UI, validating input, or detecting new symbols added to the feed. Returns 593 codes at last count.

Parameters
  • api_key — required
  • format — json / xml / jsonp
Example
{ "count": 593,
  "currencies": ["AED", "AFN", "ALL",
                 "AMD", ... ] }

What you get on each plan

Both tiers ship with the same forex API — the Pro tier unlocks the historical endpoints and higher limits. See the full pricing page for yearly billing.

Free
$0/mo
  • ✓ 200 requests/day (6,000/mo)
  • ✓ 170+ FIAT currencies
  • ✓ 420+ cryptocurrencies
  • ✓ Real-time forex rates
  • ✓ Currency conversion
  • ✓ EU VAT rates
  • × Historical forex data
Recommended
Pro
$9/mo
  • ✓ 25,000 requests/day (750,000/mo)
  • ✓ 1,000 historical requests/day
  • ✓ Historical data 1999—2026
  • ✓ Time-series endpoint
  • ✓ Precious metals (Gold, Silver, Pt, Pd)
  • ✓ Priority support
  • ✓ Cancel anytime
Reliability
99.9% uptime
  • ✓ <100 ms P95 response
  • ✓ HTTPS-only
  • ✓ Gzip / Brotli compressed
  • ✓ CORS enabled
  • ✓ Redis-cached edge reads
  • ✓ 15-minute refresh cadence
  • ✓ 429 rate-limit response includes reset

How the forex data is sourced

Rates come from a weighted aggregate of central banks and market feeds — not a single scraped price. Every source has a base weight and a recency score; stale feeds get downweighted automatically. This is the main reason a $9 plan here can match the accuracy of vendors charging 5–10× more.

ECB
European Central Bank

Daily reference rates against EUR for 30+ FIAT currencies. The closest thing to a “consensus” rate for European pairs.

Bank of England
BoE daily fixings

Sterling reference rates and historical daily series — the authoritative source for GBP pairs.

RBA
Reserve Bank of Australia

AUD reference rates and trade-weighted index data, updated on each Sydney close.

SNB
Swiss National Bank

Official CHF rates. Matters for anyone pricing Swiss payroll, insurance, or import/export flows.

BoC
Bank of Canada

CAD noon rates and indicative series. Used for North American cross-border commerce.

Coinbase
Crypto spot

420+ cryptocurrency spot prices against USD and EUR, updated on every tick.

LBMA
London Bullion Market

Twice-daily gold, silver, platinum, palladium fixings — the institutional benchmark, with history back to 1968.

TCMB, BNR, CBE, QCB
Regional central banks

Turkey, Romania, Egypt, Qatar — critical for exotic pair coverage where major aggregators lag.

Swissquote, FBIL
Market feeds

Supplementary FX tick data and RBI-sanctioned INR benchmarks, cross-checked against central-bank sources.

Rates are blended with a weighted-average algorithm that decays older observations and favours central-bank references. When a source returns an outlier price (e.g. a fat-finger tick), it is automatically excluded from the blend.

How UniRateAPI compares to other forex APIs

Pricing and feature data verified against each vendor’s public pricing page in 2026. OANDA’s forex data is tied to a brokerage account and is not a pure SaaS price. For deeper individual comparisons see Fixer.io alternative, ExchangeRate-API alternative, and OpenExchangeRates alternative.

Feature UniRateAPI Fixer.io ExchangeRate-API Open Exchange Rates OANDA
Entry price $9/mo $14.99/mo $10/mo $12/mo Broker account required
Requests / month (entry) 750,000 10,000 30,000 10,000 Tied to trading tier
Currencies covered 593 170 161 200+ 68 FX pairs
Historical data 1999–2026, included Available (paid) Back to 1990 Available Varies
Time-series endpoint Included at $9 $59.99/mo $10/mo $47/mo Yes (trading API)
Crypto support 420+ coins Limited Bitcoin only No cryptocurrency support Bitcoin only No
Precious metals 4 (Au, Ag, Pt, Pd) 2 (Gold, Silver) None 4 (Gold, Silver, Platinum, Palladium) Limited
Free tier 6,000/month, no card 100 calls/month 1,500 calls/month 1,000 calls/month Demo account only

What developers build with the forex API

Five real use cases — each one maps to a tested integration pattern and, where we have one, a full walkthrough in the articles section.

📈

FX monitoring & alerting

Poll major pairs on a schedule, detect threshold breaches, and push to Slack, PagerDuty, or your own dashboards. Low-volume; fits comfortably in the free tier.

REST vs WebSocket guide →
💰

SaaS multi-currency billing

Show prices and invoices in the customer’s local currency using live forex rates, cache per hour, and reconcile against historical rates at month-end close.

Multi-currency SaaS guide →
📊

Trading bot analytics

Feed an ML model or signal engine with historical time series, then use the live endpoint for paper-trading simulations. Note: use a broker API for order execution.

Trading-bot integration guide →

Travel & booking pricing

Convert hotel, flight, or rental totals into the viewer’s home currency at checkout. A single /api/convert call per page is typically enough; cache for 5–15 minutes.

JavaScript converter tutorial →
📋

Accounting & audit

Pull month-end rates for multi-entity consolidation and reconciliation. ASC 830 and IAS 21 both require a dated rate — /api/historical/rates returns it in one call.

Multi-currency accounting guide →
🚀

International payments

Pre-quote forex-adjusted amounts before passing a transaction to Stripe, PayPal, or Wise — giving customers certainty on total charge and reducing downstream support tickets.

International payments guide →

Forex API FAQ

Straight answers to what developers ask most about the forex API. Pulled from the People Also Ask data on “forex api”, “free forex api”, and “forex data api” SERPs.

Is the UniRateAPI forex API free? +
Yes. The free tier gives you 200 requests per day (6,000 per month) with no credit card, no trial expiry, and access to 170+ FIAT pairs plus 420+ cryptocurrencies. You only upgrade if you need historical data, higher limits, or precious metals. Most side projects never leave the free tier.
What is an API in forex? +
A forex API is an HTTP endpoint that returns machine-readable currency exchange rates — typically JSON — so your application can price products, convert balances, or chart pairs without scraping a broker website. UniRateAPI is a market-data forex API: we deliver rates and historical series, we do not execute trades or open brokerage positions.
How do I get real-time forex data from the API? +
Call GET /api/rates?from=USD with your API key. The response returns live rates for every currency against USD, sourced from ECB, central banks, and market feeds, refreshed every 15 minutes. For a single pair, add &to=EUR. For historical data, use /api/historical/rates?date=YYYY-MM-DD or /api/historical/timeseries for ranges.
Which forex pairs does the API support? +
All 170+ FIAT currencies cross against every other FIAT currency in the dataset — that is roughly 28,000 possible pairs including all seven majors (EUR/USD, GBP/USD, USD/JPY, AUD/USD, USD/CAD, USD/CHF, NZD/USD), every minor and cross, and exotics like USD/TRY, USD/ZAR, USD/THB. We also handle 420+ cryptocurrencies against any FIAT base.
How far back does the historical forex data go? +
Daily close rates go back to 4 January 1999 for major FIAT currencies — 27 years of data — sourced from ECB reference rates and central-bank feeds. Cryptocurrency history goes back to Bitcoin's inception. Precious metals (Gold, Silver, Platinum, Palladium) extend to 1968 from LBMA fixing data.
Can I use the forex API in Python? +
Yes — it is a standard REST API, so requests or httpx work with no SDK required. Our Python tutorial walks through pandas integration, caching, and error handling. There are also docs for Node.js, PHP, Ruby, Java, Go, C#, Perl, and Objective-C linked in the sidebar.
What are the API rate limits? +
Free: 200 requests/day (roughly 6,000/month). Pro ($9/month): 25,000 requests/day for current rates plus 1,000/day for historical endpoints — 750,000/month total. Limits reset at 00:00 UTC. Hit a limit and you get a 429 response with a reset timestamp; there are no surprise overage charges.
How is the forex data sourced? +
We aggregate from central banks (ECB, Bank of England, Reserve Bank of Australia, Swiss National Bank, Bank of Canada, Central Bank of Egypt, Banco de México, Bank Negara Malaysia, Banco Nacional de Rumania, Norges Bank, Qatar Central Bank, TCMB) and market data (Coinbase for crypto, LBMA and Goldprice.org for metals, Swissquote and FBIL for supplementary FX). Rates are weighted by source reliability and recency.
Do you support JSON, XML, and JSONP response formats? +
Yes. Append &format=json (default), &format=xml, or &format=jsonp&callback=myFn to any endpoint. JSON is the recommended default. XML is available for legacy ERP and finance systems. JSONP exists for browser-only integrations where CORS is blocked, though modern apps should use JSON over fetch with an API key header.
How accurate is the forex data vs. broker feeds? +
For FIAT pairs against major references (EUR, USD, GBP, JPY) our rates track ECB close to within a few basis points. Broker feeds show executable spreads that differ from reference rates by a few pips depending on liquidity — if you need executable prices for order routing, use a brokerage API. For analytics, accounting, billing, and historical reporting, reference rates are the correct signal.
Also covered on one API key

Precious metals: gold, silver, platinum, palladium

LBMA spot prices, 36–58 years of history, multi-currency conversion. See the dedicated precious metals API page — or jump straight to gold, silver, platinum or palladium.

Open metals API page

Start shipping with the forex API in under five minutes

Register for a free API key, paste the snippet of your choice, and you’re live. 6,000 requests/month on the free tier — no credit card, no trial clock, no call with sales.