Methodology
Frankfurter collects reference exchange rates from central banks and official institutions, serving them per provider and as a daily blended rate. This page explains how v2 builds a blended rate from raw provider data.
Every step is open source under the MIT License in lineofflight/frankfurter.
Sources and Eligibility
Frankfurter tracks 112 providers, each publishing one or more datasets. Daily reference datasets enter the default v2 blend. NBP.B, NBP's weekly table of less-traded currencies, is included as an exception.
These stay out of the blend, but you can query them with providers or /v2/providers/{key}/rates:
- Non-daily series: weekly, monthly, and quarterly publications such as BIS, HMRC, InforEuro, Japan Customs, India CBIC, and U.S. Treasury. Their rates cover longer periods and don't mix cleanly with daily fixings.
- Cash, banknote, and bureau series: retail tables published alongside transfer rates, such as
TCMB.BANKNOTE,DAB.CASH, andBCT.BUREAU. - Retired currencies past their statutory changeover date, such as
BGNfrom 2026-01-01 when Bulgaria adopted the euro. History before the changeover stays intact.
When a provider publishes bid and ask quotes instead of a single reference rate, Frankfurter uses the midpoint, (bid + ask) / 2
(rate_components.rb).
Frankfurter never edits or deletes raw provider observations when a number looks unusual. Provider endpoints return what the institution published. Screening happens only in the blend.
Daily Blend Pipeline
For any target date d, a blended rate passes through seven stages.
1. Spike Screening
Before blending, Frankfurter checks each provider's series for one-day typos
(rate_spike.rb).
An observation is dropped from the blend if it is at least 3x off both its previous and next observations in the same direction, provided both neighbors fall within 14 days and agree within 3x. Persistent moves such as devaluations or redenominations stay in the blend.
2. Carry-Forward Snapshot
Each eligible provider contributes its latest observation within a 14-day lookback window, from d - 14 through d
(carry_forward.rb).
Providers with no observation in that window don't contribute.
3. Pivot Rebasing
Frankfurter converts each contributing provider's quotes to a common USD pivot
(base_conversion.rb):
- Rows with USD as the base stay as published. Rows with USD as the quote are inverted.
- Non-USD pairs cross through the provider's own USD quote when available.
- When none of a provider's rates can be crossed through USD, they bridge through the cross-provider median for a shared currency.
4. Outlier Screening
For any currency quoted by at least 4 providers, Frankfurter computes the median and median absolute deviation (MAD) of the rebased values
(consensus.rb).
Any provider more than max(10 × MAD, 5% of median) from the median is left out of the average. It still appears in expand=providers with "excluded": true.
5. Recency-Weighted Average
Frankfurter combines the remaining contributors in a recency-weighted mean
(weighted_average.rb).
Age is measured from the snapshot's reference date: the newest observation date in the batch, capped at today.
- Observations 0 to 3 days old get full weight (
1.0). - Older observations decay exponentially:
weight = exp(-0.5 × (days_old - 3)).
Fresh daily rates dominate, while slightly lagging sources fade out instead of dropping off at day 4.
6. Currency Peg Anchoring
For currencies with a hard official or currency-board peg, such as AED, SAR, BHD, QAR, OMR, JOD, XOF, and XAF, the official peg rate overrides the blend from the peg's effective date
(peg_anchor.rb, pegs in
db/seeds/pegs).
Overridden providers still appear in expand=providers with "excluded": true. If no provider quotes a pegged currency, the rate comes from the peg alone and providers is omitted.
Pegs apply only to default blended queries. Scoping with providers bypasses them: one provider returns its own published rates, while multiple providers are blended among themselves.
7. Base Derivation and Rounding
Frankfurter converts the USD-pivot blend to the requested base (quote_rate / base_rate) and rounds by magnitude
(roundable.rb):
- Up to 1: 5 significant figures
- Above 1, up to 20: 4 decimal places
- Above 20, up to 80: 3 decimal places
- Above 80, up to 5,000: 2 decimal places
- Above 5,000: whole numbers
Single-provider daily queries return the provider's published digits unchanged when the requested pair matches the stored pair.
Weekly and Monthly Grouping
On a range query with group=week or group=month, Frankfurter averages each provider's eligible daily observations (excluding spikes and retired currencies) per week or calendar month. Monthly buckets are dated the first of the month. The bucket averages then pass through the same rebasing, outlier screening, averaging, and peg anchoring.
Dates, Weekends, and Revisions
Calendar Value Dates
A v2 date is a calendar value date, not a single global cut-off time. Each central bank fixes its rate at its own local time (BOJ in the Tokyo morning, ECB around 16:00 CET, the Fed's H.10 around noon in New York) and assigns a publication date. Frankfurter stores each observation under that date. Latest queries roll over at midnight UTC.
Weekends and Holidays
Unlike v1, which carries ECB rates Monday through Friday, v2 blended series can include Saturdays and Sundays. Central banks on Sunday-to-Thursday calendars (in the Middle East, North Africa, and South Asia, for example) publish on weekends. Friday observations from Monday-to-Friday banks also carry forward within the 14-day window, at full weight for the first 3 days.
- Single-date queries (
date=YYYY-MM-DD): if no provider published for a currency on that date, Frankfurter returns the latest blended rate within 14 days and reports that observation's date. - Range queries (
fromandto): if the start date has no new data, the response starts with the latest prior rate. Later dates without new data are omitted.
When a Blended Rate Can Change
Recent blended rates can shift slightly as new data arrives:
- Providers publish throughout the day, and spike screening needs the next observation to flag a one-day typo. Major currencies usually settle within 1 to 2 business days.
- A few daily series in the blend publish in weekly (
FRED) or monthly (BOA,BOM,CBC,HKMA,SBP) batches, updating blends up to about a month later. - Adding a provider with historical backfill, fixing a mislabeled upstream series, or changing blend or peg rules rebuilds historical blends.
If you need an immutable figure for audit or accounting records, store the rate, date, and expand=providers output when you record the transaction, or query a single official provider.
Traceability and Compliance
Add expand=providers to any /v2/rates or /v2/rate/{base}/{quote} query to inspect the inputs behind each rate. Daily queries list every provider in the 14-day window, while grouped queries list the bucket's contributors. Each entry includes the provider's observation date, rebased rate, and "excluded": true for outliers and peg overrides only. A spike-screened observation doesn't appear; the provider's previous observation stands in.
Blended rates are Frankfurter's own calculation, not an official fixing from any institution. For tax, accounting, or legal filings that require an official source, query that institution with /v2/providers/{key}/rates and check its terms on the License page.