Swiss Customs Exchange Rate API: The Daily BAZG Rate as JSON
Switzerland has an unusual gap: the Swiss National Bank publishes no daily official exchange rate. Its published series are monthly averages. So when a Swiss customs declaration or an import-VAT calculation needs "the official rate for this date", it does not come from the central bank at all — it comes from the Federal Office for Customs and Border Security (BAZG), which publishes a daily rate for exactly that purpose.
This guide covers how that rate works, the timing rule that catches people out, and how to pull it as JSON — 72 currencies against the franc, with history back to 2000.
/api/v1/central-bank/bazg/history?source=EUR&target=CHF).What BAZG publishes
- 72 currencies against the Swiss franc, published every working morning.
- Valid from the following day — see the timing rule below, which is the part worth reading twice.
- History to January 2000 — over half a million rates, including currencies retired since, such as the pre-euro national currencies.
- The legal basis for customs valuation and import VAT, not an indicative or informational figure.
The timing rule: today's publication is tomorrow's rate
BAZG publishes in the morning, and the rate it publishes applies to the next day. A Friday publication carries Saturday, Sunday and Monday. This is the single most common way to get Swiss customs conversion wrong: if you take the rate published on the day of your declaration, you are one publication ahead of the rate that legally applies.
Our API stores these rates by the date they are valid for, not the date they were published. So a request for a given date returns the rate that was in force on that date, with no arithmetic of your own — and because weekend days are covered explicitly, a Saturday request returns a real answer rather than a fallback.
Get the rates (REST)
curl "https://allratestoday.com/api/v1/central-bank/bazg/latest?source=EUR&target=CHF" \
-H "Authorization: Bearer YOUR_API_KEY" The latest table is available on every plan, including the free tier (300 requests/month, no credit card). Add &format=xlsx or &format=csv if the destination is a spreadsheet rather than code.
The npm SDK
npm install bazg-exchange-rate import { getRate, getRatesForDate } from 'bazg-exchange-rate';
// The official customs rate in force right now
const pair = await getRate('EUR', 'CHF', { apiKey: 'art_live_...' });
console.log(pair.rate, pair.rate_date);
// The rate that applied on a past declaration date
const day = await getRatesForDate('2026-03-20', { apiKey: 'art_live_...' }); Zero dependencies, TypeScript types included, and it runs anywhere fetch exists — Node 18+, Bun, Deno, and edge runtimes.
BAZG or the SNB — which do you need?
Both are official, and they answer different questions. Use BAZG when a Swiss customs declaration, an import-VAT calculation, or any rule that names the customs rate is involved: it is daily and it is the legally applicable number. Use the Swiss National Bank series when you need a monthly average — for period reporting, or for the long historical record, which reaches back to 1914.
They are served by the same API and the same key, so switching is a change of source code in the URL.
Two decades of Swiss history
The series starts in January 2000 and runs unbroken through the euro's introduction, the 2008 crisis, the 2011 franc cap and its removal in 2015 — the day the franc jumped roughly 20% against the euro in minutes. For restating old declarations or auditing historical import valuations, it is the official record for the period rather than a market approximation of it.
FAQ
Which exchange rate applies to Swiss customs declarations?
The rate published by BAZG that is valid for the day of the declaration. BAZG publishes each working morning a rate that takes effect the following day, so a Friday publication covers Saturday, Sunday and Monday.
Is the BAZG rate the same as the Swiss National Bank rate?
No. The SNB publishes monthly average exchange rates and no daily official fixing. BAZG publishes a daily rate, and it is the one Swiss customs declarations and import VAT are calculated with.
How far back do Swiss customs exchange rates go?
The API serves the BAZG series from January 2000 onward — over half a million rates across 72 currencies today, and 83 including currencies retired since 2000.
Official Swiss customs rates, as JSON
The latest table is free — 300 requests/month, no credit card.
Get your free API key