How to Cache Exchange Rates and Stay Under Forex API Rate Limits
Pick TTL by use case, coalesce cache misses, and budget a 400-requests-per-5-minutes forex API window without starving tickers or converters.
Forex markets are closed for the weekend. Crypto keeps streaming.
Stream 150+ currency pairs, metals, crypto and indices over REST or WebSocket, in JSON or XML. Free for up to 3 requests an hour, with no key and no signup.
$ curl https://live-rates.com/api/rates [ { "currency": "EUR/USD", "bid": 1.11387, "ask": 1.11404, "high": 1.12344, "low": 1.11306, "timestamp": 1794002280585 }, …149 more]
const res = await fetch('https://live-rates.com/api/rates?key=YOUR_KEY'); const rates = await res.json(); console.log(rates[0]); // { currency: 'EUR/USD', bid: 1.11387, … }
import requests rates = requests.get( "https://live-rates.com/api/rates", params={"key": "YOUR_KEY"}, ).json() print(rates[0]) # {'currency': 'EUR/USD', 'bid': 1.11387, …}
resp, _ := http.Get("https://live-rates.com/api/rates?key=YOUR_KEY") defer resp.Body.Close() var rates []Rate json.NewDecoder(resp.Body).Decode(&rates) fmt.Println(rates[0].Currency, rates[0].Bid)
const ws = new WebSocket('wss://live-rates.com/stream?key=YOUR_KEY'); ws.onmessage = (msg) => { const rate = JSON.parse(msg.data); }; // { currency: 'EUR/USD', bid: 1.11387, … }
Day lowDay high
GET /api/price?rate=EURUSD
A trial key arrives by email within a minute. Or skip it: 3 requests an hour need no key at all.
GET /api/rates?key=…
returns every rate in JSON, or XML if you ask for it.
99.9% uptime during market hours. Plans from €20/month + VAT, cancel anytime.
Bid, ask and the day’s open, high and low for every instrument, straight from the feed. No smoothing, no averaging, no SDK in the way.
rate_format=xml for XML, from any language or framework.Live quotes
Refreshes here every few seconds. The API and stream update about once a second.
| Instrument | Bid | Change |
|---|---|---|
| EUR/USD Euro vs US dollar | 1.11387 | -0.79% |
| GBP/USD British pound vs US dollar | 1.33497 | -0.78% |
| USD/JPY US dollar vs Japanese yen | 158.487 | +0.64% |
| USD/CHF US dollar vs Swiss franc | 0.82028 | +0.59% |
| AUD/USD Australian dollar vs US dollar | 0.68648 | -0.93% |
| USD/CAD US dollar vs Canadian dollar | 1.41289 | +0.80% |
| XAU/USD Gold vs US dollar | 4,069.83 | -0.39% |
| BTC/USD Bitcoin vs US dollar | 75,659.20 | -0.39% |
A plain HTTP API that returns JSON or XML. No SDK to install: if your language can make a request, it can read the feed.
Endpoints
rate_format=xml to any endpointNo key yet? Get a free trial key
https://www.live-rates.com/api/rates
Keyless: 3 requests/hour. With ?key=YOUR_KEY: unlimited.
[
{
"currency": "EURUSD",
"bid": "1.11387",
"ask": "1.11404",
"high": "1.12344",
"low": "1.11306",
"open": "1.12269",
"close": "1.11387",
"timestamp": "1794002280585"
},
{
"currency": "GBPUSD",
"bid": "1.33497",
"ask": "1.33524",
"high": "1.3463",
"low": "1.33386",
"open": "1.34548",
"close": "1.33497",
"timestamp": "1794002280076"
},
{
"currency": "GBPHUF",
"bid": "434.65",
"ask": "436.57",
"high": "437.32",
"low": "433.16",
"open": "435.73",
"close": "434.65",
"timestamp": "1794002279090"
}
]
https://www.live-rates.com/api/price?key=YOUR_KEY&rate=EURUSD
Pass the pair as rate=EURUSD, rate=USDJPY and so on.
[
{
"currency": "EUR/USD",
"rate": 1.08542,
"bid": 1.08542,
"ask": 1.08551,
"high": 1.08891,
"low": 1.08201,
"open": 1.08395,
"close": "n/a",
"timestamp": 1713045600000
}
]
REST and WebSocket examples, each under 40 lines. Take the one for your stack and adapt it.
Start with a free 7-day trial, no credit card required. Every plan includes unlimited requests, REST and WebSocket, JSON and XML, and commercial use.
For testing and small projects
€50 billed monthly
Choose MonthlyBest value for growing products
€360 billed yearly Save 40%
Choose YearlyFor established businesses
€720 billed every 3 years Save 60%
Choose 3-YearPrices are in euros and exclude VAT. VAT is added at checkout where it applies: for customers in Portugal and for private customers elsewhere in the EU. EU businesses with a valid VAT number are not charged VAT (reverse charge), and customers outside the EU pay no VAT.
or crypto
Convert any amount between 20+ currencies, precious metals and crypto at live mid-market rates, from the same data that powers the API.
Need these rates in your app? Get a free trial key
From e-commerce platforms to financial institutions, teams rely on Live-Rates for accurate market data.
Show prices in the shopper’s own currency at checkout. One request fetches every rate; cache it and convert client-side.
Power dashboards and quote screens with bid, ask, high and low pushed over WebSocket as prices move.
Add currency features to mobile and web apps with a plain JSON endpoint, with no SDK to install or maintain.
Latest news and insights from the forex market.
Pick TTL by use case, coalesce cache misses, and budget a 400-requests-per-5-minutes forex API window without starving tickers or converters.
Where store platforms get FX, why daily tables leak margin on volatile pairs, and how to refresh WooCommerce and Shopify rates hourly.
Compare OANDA Exchange Rates API pricing and onboarding with Live-Rates, a self-serve real-time FX API for small teams priced out of enterprise contracts.
Everything you need to know about the Live-Rates forex API.
Can’t find your answer? Send us a message.
No. The API is free to use without a key, up to 3 requests per hour. Request a free 7-day trial key to simulate unlimited access, or subscribe to a paid plan for production use.
Both JSON and XML. JSON is the default; add rate_format=xml to any endpoint to receive XML instead.
Over 150 instruments, including major and minor forex pairs, precious metals such as gold and silver, cryptocurrencies like Bitcoin and Ethereum, and major stock indices.
Rates are updated in real time, approximately every second, via both the REST API and the WebSocket streaming feed.
Yes. The paid Monthly, Yearly and 3-Year plans allow commercial use with unlimited requests and multiple whitelisted IP addresses.
Yes. Every paid plan lets you display the data to your end users, as received or derived from it, such as charts, OHLC candles, converters and widgets, with no extra licence or fee. The only restriction is that you may not resell or relay the raw feed to third parties as a data feed or API. Attribution is optional.
Yes. In addition to the REST API, a WebSocket streaming endpoint pushes live rate updates directly to your application as they happen.
Yes. All paid plans (Monthly, Yearly and 3-Year) include historical daily rates back to 1999 for currencies and precious metals, as single dates or time series of up to 31 days per request, in addition to the real-time feed.
Credit and debit cards, including Apple Pay and Google Pay, through Stripe; and Bitcoin and other cryptocurrencies through NOWPayments.
No. Prices are shown without VAT. VAT is added at checkout where it applies: for customers in Portugal and for private customers in other EU countries. EU businesses with a valid VAT number are not charged VAT (reverse charge), and customers outside the EU pay no VAT.
The API is free to use without a key, up to 3 requests an hour. A free trial key gives you unlimited access for 7 days, so you can test every endpoint and currency pair before you buy.
We’ll email it as soon as it’s ready.