---
title: "SNB Exchange Rate API: Official CHF Rates as JSON"
description: "Official Swiss National Bank monthly exchange rates as JSON — ~25 currencies against the CHF, monthly, history back to 1914. REST + npm SDK, free tier included."
canonical: https://allratestoday.com/blog/snb-exchange-rate-api/
source: AllRatesToday (https://allratestoday.com/) — Markdown mirror of the page above; index of all pages at https://allratestoday.com/llms.txt
generated: 2026-10-16T12:19:13.962Z
---

**Swiss National Bank** publishes official exchange rates — ~25 currencies against the CHF, monthly — and these are the *published official rates* used for tax filings, audits, and compliant invoicing in Switzerland, not moving market prices. This guide shows how to pull them as JSON: via a REST endpoint or the zero-dependency [`snb-exchange-rate`](https://www.npmjs.com/package/snb-exchange-rate) npm package, with history back to 1914.

  EUR → CHF — official Swiss National Bank monthly average rate Monthly observations, Jul '25 – Jul '26 · CHF per 1 EUR

*Source: Swiss National Bank published rates · chart data from the AllRatesToday API (`/api/v1/central-bank/snb/history?source=EUR&target=CHF`).*

## What the SNB publishes

- **~25 currencies against the CHF, monthly**.
- **History back to 1914** — queryable by exact date or as a time series.
- **The bank's own publication date** on every response, so a rate is always citable.
- **No gaps to trip over** — requests for non-publication days resolve to the most recent published rates and are flagged explicitly.

The SNB publishes monthly averages — no daily official series exists — but the record reaches back to 1914, one of the longest official exchange rate histories anywhere.

## Why official rates, not market rates

A live mid-market feed answers "what is EUR/CHF trading at right now?" — the right tool for checkouts and dashboards. But accountants, auditors, and tax authorities ask a different question: "which rate were you *required* to use for this date?" That answer comes from the central bank's published rates, and it never changes after publication.

## Get the latest rates (REST)

```
curl "https://allratestoday.com/api/v1/central-bank/snb/latest" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

The response is the bank’s most recent published table — one row per pair in its own quoting direction, the publication date (`rate_date`) and a freshness flag. Live example captured 2026-09-30:

```
{
  "bank": "snb",
  "name": "Swiss National Bank",
  "rate_date": "2026-09-30",
  "age_days": 10,
  "stale": false,
  "cadence": "monthly_average",
  "rates": [
    {"base": "ARS", "quote": "CHF", "type": "monthly_average", "value": 0.00054},
    {"base": "AUD", "quote": "CHF", "type": "monthly_average", "value": 0.58343},
    {"base": "BRL", "quote": "CHF", "type": "monthly_average", "value": 0.1593254},
    {"base": "CAD", "quote": "CHF", "type": "monthly_average", "value": 0.58688},
    … 22 more rows
  ],
  "disclaimer": "Official rates as published by the named central bank. On weekends/holidays the most recent published rate_date is returned."
}
```

Most integrations need one pair. Add `source` and `target` and the API returns a single resolved rate — `derived: false` when Swiss National Bank printed the pair itself:

```
curl "https://allratestoday.com/api/v1/central-bank/snb/latest?source=EUR&target=CHF" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

```
{
  "bank": "snb",
  "name": "Swiss National Bank",
  "rate_date": "2026-09-30",
  "source": "EUR",
  "target": "CHF",
  "rate": 0.94312,
  "rate_type": "monthly_average",
  "derived": false,
  "method": "published",
  "age_days": 10,
  "stale": false,
  "cadence": "monthly_average",
  "disclaimer": "Official rates as published by the named central bank. On weekends/holidays the most recent published rate_date is returned."
}
```

The response is the bank's most recent published data — every rate and the publication date. The latest rates are available on every plan, including the free tier (300 free requests, no credit card).

## The npm SDK

```
npm install snb-exchange-rate
```

```
import { getRate, getLatestRates } from 'snb-exchange-rate';

// One pair at the official Swiss National Bank rate
const pair = await getRate('EUR', 'CHF', { apiKey: 'art_live_...' });
console.log(pair.rate, pair.rate_date);

// The bank's full published table
const table = await getLatestRates({ apiKey: 'art_live_...' });
console.log(table.rate_date, table.rates.length);
```

Zero dependencies, TypeScript types included, and it runs anywhere `fetch` exists — Node 18+, Bun, Deno, and edge runtimes.

## Historical rates for an invoice date

```
import { getRatesForDate, getHistory } from 'snb-exchange-rate';

// The official rates for an invoice date — non-publication days return
// the most recent published date, flagged via published_on_requested_date.
const day = await getRatesForDate('2026-06-30', { apiKey: 'art_live_...' });

// Time series for one pair
const series = await getHistory(
  { source: 'EUR', target: 'CHF', from: '2026-01-01' },
  { apiKey: 'art_live_...' }
);
```

Historical dates and time series need a [paid plan](https://allratestoday.com/pricing/); the latest rates stay free.

## Published vs derived pairs

If the SNB does not print a pair directly, the API resolves it from the bank's published rates — an inverse, or a cross rate via CHF — and flags it `derived: true` with the method used. Official and computed values are never silently mixed, which is exactly the distinction an auditor will ask about.

## FAQ

### Does Swiss National Bank have an official exchange rate API?

Swiss National Bank publishes its official rates on its website, but not always in a developer-friendly form. AllRatesToday serves the bank's published rates as clean JSON — ~25 currencies against the CHF, monthly, with history back to 1914 — via REST or the snb-exchange-rate npm package. The latest table is free.

### How often do Swiss National Bank rates update?

Once per month — the SNB publishes monthly average rates; no daily official series exists.

### Can I get the Swiss National Bank rate for a past date, like an invoice date?

Yes. The /central-bank/snb/rates-for-date endpoint returns the official rates for any date back to 1914. Non-publication days resolve to the most recent published date and are flagged, so your audit trail stays honest. Historical dates require a paid plan; latest rates are free.

## Official Swiss National Bank rates, as JSON

The latest rates are free — 300 free requests, no credit card.

 [Get your free API key](https://allratestoday.com/register/)

## Related Articles

- [Swiss National Bank rates API — product page](https://allratestoday.com/central-bank-rates-api/snb/)
- [All covered central banks](https://allratestoday.com/central-bank-rates-api/)
- [South African Reserve Bank exchange rate API guide](https://allratestoday.com/blog/sarb-exchange-rate-api/)
- [Reserve Bank of New Zealand exchange rate API guide](https://allratestoday.com/blog/rbnz-exchange-rate-api/)
- [Central bank API documentation](https://allratestoday.com/docs/#central-bank)
- [Best exchange rate APIs in 2026 — how the official-rate and market-rate providers compare](https://allratestoday.com/best/best-exchange-rate-api/)
