You check the rate on Google, then see a different number at your bank, your card issuer and your payment app. The number on Google is usually the mid-market exchange rate, and the gap between it and what you are actually charged is where most of the cost of currency conversion hides. If you build anything that touches money in more than one currency, understanding this gap is not optional.
This guide explains what the mid-market rate is, how it relates to the bid, ask and spread, why consumers rarely get it, and how to work with it in code using the Finexly API documentation endpoints.
What Is the Mid-Market Exchange Rate?
The mid-market exchange rate (also called the mid rate, interbank rate or spot mid) is the midpoint between the price at which buyers are willing to buy a currency and the price at which sellers are willing to sell it. It is the closest thing the market has to a "fair" price for a currency pair at a given moment, with no fee or markup included.
Every currency pair is quoted with two prices:
- Bid: the price at which a dealer will buy the base currency from you.
- Ask (or offer): the price at which a dealer will sell the base currency to you.
The ask is always higher than the bid. The mid-market rate sits exactly halfway between them.
mid = (bid + ask) / 2
spread = ask - bidFor example, if EUR/USD is quoted at a bid of 1.0840 and an ask of 1.0842, the mid-market rate is 1.0841 and the spread is 0.0002, or 2 pips. These numbers are purely illustrative. If pips are new to you, read our guide to what a pip is in forex.
Bid, Ask and Spread: The Three Numbers Behind Every Quote
The spread is the price of immediacy. A dealer who stands ready to both buy and sell takes on inventory risk, so they charge a small difference between their buy and sell prices. In the deep interbank market for major pairs, spreads can be a fraction of a pip. For exotic pairs or in thin markets, they widen considerably.
Three things typically drive the size of a spread:
- Liquidity: heavily traded pairs such as EUR/USD or USD/JPY have tight spreads. Exotic pairs have wide ones. See major, minor and exotic currency pairs.
- Volatility: around central bank decisions or major data releases, dealers widen spreads to protect themselves.
- Trade size and timing: spreads are generally wider outside the main trading sessions and on weekends.
Mid-Market Rate vs the Rate You Actually Get
Here is the uncomfortable part. The mid-market rate is a reference point, not a price you can usually trade at. Retail customers rarely get it, because providers need to earn money somewhere. A typical retail rate is built like this:
customer_rate = mid_rate × (1 - markup) # when the customer sells the base currency
customer_rate = mid_rate × (1 + markup) # when the customer buys the base currencyThe markup is on top of any visible fee. That is why a provider advertising "no fees" can still be expensive: the cost is embedded in the exchange rate. The honest way to compare providers is to measure the total cost against the mid-market rate:
cost_pct = (mid_rate - customer_rate) / mid_rate × 100Note that some providers do convert at the mid-market rate and charge a separate, transparent fee instead. Either model can be fair; what matters is that you can see and compare the total. The same logic applies to card payments abroad, where dynamic currency conversion (DCC) often adds a large hidden markup.
Where Does the Mid-Market Rate Come From?
There is no single official mid-market rate. Foreign exchange is a decentralised, over-the-counter market. Banks, dealers and trading venues each publish their own quotes, and data vendors aggregate them. The "mid-market rate" you see online is typically a blend of several liquidity sources, refreshed continuously during trading hours, and two providers can show slightly different values at the same instant.
Benchmarks also exist for fixed moments in the day, such as the 4pm London Fix, which is used for portfolio valuation. For a deeper look at how data providers assemble their numbers, read where exchange rate APIs get their data.
Why Developers Should Care About the Mid-Market Rate
If you are building a product that handles multiple currencies, the mid-market rate is your reference rate. Common uses include:
- Displaying prices: show customers an indicative converted price on a product page.
- Transparent fees: show users the mid rate next to the rate you charge so the markup is visible.
- Accounting and reporting: revalue balances and record gains and losses against a consistent benchmark.
- Margin control: calculate how much markup you actually earn on each conversion.
- Auditing providers: detect when a payment partner's rate drifts from the market.
One practical rule: store the mid rate and the applied rate separately. If you only keep the rate charged, you cannot later prove what your markup was.
Getting the Mid-Market Rate with Finexly
Fetch a live rate with a single request:
curl "https://api.finexly.com/v1/latest?base=EUR&symbols=USD&apikey=YOUR_API_KEY"Python: Calculate Your Markup and Customer Rate
import requests
API_KEY = "YOUR_API_KEY"
def get_mid_rate(base: str, quote: str) -> float:
r = requests.get(
"https://api.finexly.com/v1/latest",
params={"base": base, "symbols": quote, "apikey": API_KEY},
timeout=10,
)
r.raise_for_status()
return r.json()["rates"][quote]
def customer_quote(amount: float, base: str, quote: str, markup_pct: float):
mid = get_mid_rate(base, quote)
applied = mid * (1 - markup_pct / 100)
return {
"mid_rate": mid,
"applied_rate": applied,
"customer_receives": round(amount * applied, 2),
"markup_cost": round(amount * (mid - applied), 2),
}
print(customer_quote(1000, "EUR", "USD", markup_pct=1.5))Treat the rate returned by the API as your reference mid rate and apply your own, explicit markup on top. Keep decimals under control by following our currency rounding guide.
JavaScript: Show the Rate Comparison to Users
const API_KEY = "YOUR_API_KEY";
async function compareRates(base, quote, providerRate) {
const res = await fetch(
`https://api.finexly.com/v1/latest?base=${base}&symbols=${quote}&apikey=${API_KEY}`
);
const { rates } = await res.json();
const mid = rates[quote];
const hiddenCostPct = ((mid - providerRate) / mid) * 100;
return { mid, providerRate, hiddenCostPct: hiddenCostPct.toFixed(2) };
}
compareRates("EUR", "USD", 1.0680).then(console.log);How to Compare Providers Against the Mid-Market Rate
A simple, repeatable method works for any conversion:
- Get the mid-market rate for the pair at the same moment as the provider's quote.
- Calculate the amount you would receive at the mid rate.
- Calculate the amount the provider actually delivers after fees and markup.
- Divide the difference by the mid-rate amount to get the total cost percentage.
Do this at a few different times, because spreads widen and narrow. Historical data helps you build a fair picture over weeks rather than a single snapshot; see our historical exchange rates API guide.
Common Mistakes to Avoid
- Treating the mid rate as tradeable. It is a reference. Real trades happen at the bid or the ask.
- Mixing up inverse rates. The mid of EUR/USD is not exactly the inverse of the mid of USD/EUR once spreads are involved in your own pricing. Decide on one direction and stick to it.
- Caching too long. Rates change constantly. Cache for seconds or minutes depending on your use case, not hours.
- Hiding the markup in the rate. Regulators in many markets increasingly expect clear disclosure of costs. Showing the mid rate is a trust signal.
- Rounding too early. Round only the final amount, not intermediate rates.
Frequently Asked Questions
What is the mid-market exchange rate in simple terms?
It is the midpoint between the buy price and the sell price of a currency pair in the global market. It contains no fees or markup, which makes it a useful benchmark for fairness.
Is the mid-market rate the same as the interbank rate?
They are used almost interchangeably. Both describe the rate around which banks and dealers trade with each other, although exact values vary slightly between data sources.
Why don't banks give me the mid-market rate?
Banks and payment providers earn money from the spread and markup on each conversion. Some providers do use the mid rate and charge a visible fee instead, so always compare the total cost.
How do I find the real mid-market rate for a currency pair?
Use a reliable live source, such as a currency API, and compare it with the rate you are quoted. The percentage difference is your effective cost.
Can I get the mid-market rate through an API?
Yes. A currency API returns live reference rates you can use as your mid rate, then add your own markup or compare against third-party quotes, as shown in the code above.
Build Transparent Currency Pricing
Ready to integrate real-time exchange rates into your project? Get your free Finexly API key, no credit card required. Start with 1,000 free requests per month and upgrade via our pricing plans as you grow. You can also use the currency converter to check any rate before you code against it, or compare currency APIs to find the right fit.
Explore More
Vlado Grigirov
Senior Currency Markets Analyst & Financial Strategist
Vlado Grigirov is a senior currency markets analyst and financial strategist with over 14 years of experience in foreign exchange markets, cross-border finance, and currency risk management. He has wo...
View full profile →