snb-exchange-rate 1.3.19 → 1.3.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +22 -15
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -7,7 +7,7 @@
7
7
  [![EUR/CHF today](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fallratestoday.com%2Fapi%2Fopen%2Fcentral-bank%2Fsnb%3Fsource%3DEUR%26target%3DCHF&query=%24.rate&label=EUR%2FCHF%20published%20by%20Swiss%20National%20Bank&color=0A7E8C&cacheSeconds=3600)](https://allratestoday.com/central-bank-rates-api/snb/)
8
8
  [![rate date](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fallratestoday.com%2Fapi%2Fopen%2Fcentral-bank%2Fsnb%3Fsource%3DEUR%26target%3DCHF&query=%24.rate_date&label=rate%20date&color=555&cacheSeconds=3600)](https://allratestoday.com/central-bank-rates-api/snb/)
9
9
 
10
- **Official Swiss National Bank (Switzerland) monthly exchange rates for Node.js and TypeScript. The published central bank rates behind tax filings, customs valuations, audits, and compliant invoicing — not market estimates, but the numbers Swiss National Bank itself prints, every month.**
10
+ **Official Swiss National Bank (Switzerland) daily exchange rates for Node.js and TypeScript. The published central bank rates behind tax filings, customs valuations, audits, and compliant invoicing — not market estimates, but the numbers Swiss National Bank itself prints, every business day.**
11
11
 
12
12
  ## 🚀 Why this client?
13
13
 
@@ -47,7 +47,7 @@ The image is rendered live from the keyless endpoint above, so it follows the ce
47
47
 
48
48
  <!-- daily-table:start -->
49
49
  <details>
50
- <summary>Table as text: published 2026-09-30 by Swiss National Bank — 26 rates. Updated 2026-10-27.</summary>
50
+ <summary>Table as text: published 2026-10-28 by Swiss National Bank — 30 rates. Updated 2026-10-29.</summary>
51
51
 
52
52
  | Base | Quote | Type | Rate |
53
53
  | --- | --- | --- | ---: |
@@ -59,10 +59,13 @@ The image is rendered live from the keyless endpoint above, so it follows the ce
59
59
  | CZK | CHF | monthly_average | 0.0388224 |
60
60
  | DKK | CHF | monthly_average | 0.1261671 |
61
61
  | EUR | CHF | monthly_average | 0.94312 |
62
+ | EUR | CHF | reference | 0.9239 |
62
63
  | GBP | CHF | monthly_average | 1.0993 |
64
+ | GBP | CHF | reference | 1.1032 |
63
65
  | HKD | CHF | monthly_average | 0.1044552 |
64
66
  | HUF | CHF | monthly_average | 0.0025839 |
65
67
  | JPY | CHF | monthly_average | 0.0052383 |
68
+ | JPY | CHF | reference | 0.005261 |
66
69
  | KRW | CHF | monthly_average | 0.0006029 |
67
70
  | MXN | CHF | monthly_average | 0.0475407 |
68
71
  | MYR | CHF | monthly_average | 0.2013008 |
@@ -75,6 +78,7 @@ The image is rendered live from the keyless endpoint above, so it follows the ce
75
78
  | THB | CHF | monthly_average | 0.0246599 |
76
79
  | TRY | CHF | monthly_average | 0.0168369 |
77
80
  | USD | CHF | monthly_average | 0.81926 |
81
+ | USD | CHF | reference | 0.8304 |
78
82
  | XDR | CHF | monthly_average | 1.11928 |
79
83
  | ZAR | CHF | monthly_average | 0.05052 |
80
84
 
@@ -131,11 +135,11 @@ const pair = await getRate('EUR', 'CHF', { apiKey: 'art_live_...' });
131
135
  {
132
136
  bank: 'snb',
133
137
  name: 'Swiss National Bank',
134
- rate_date: '2026-09-30', // Swiss National Bank's own publication date
138
+ rate_date: '2026-10-27', // Swiss National Bank's own publication date
135
139
  source: 'EUR',
136
140
  target: 'CHF',
137
- rate: 0.94312,
138
- rate_type: 'monthly_average',
141
+ rate: 0.9233,
142
+ rate_type: 'reference',
139
143
  derived: false,
140
144
  method: 'published',
141
145
  disclaimer: 'Official rates as published by the named central bank. On weekends/holidays the most recent published rate_date is returned.'
@@ -159,8 +163,10 @@ console.log(table.rate_date, table.rates.length);
159
163
  {
160
164
  bank: 'snb',
161
165
  name: 'Swiss National Bank',
162
- rate_date: '2026-09-30',
166
+ rate_date: '2026-10-27',
163
167
  rates: [
168
+ { "base": "EUR", "quote": "CHF", "type": "reference", "value": 0.9233 },
169
+ { "base": "USD", "quote": "CHF", "type": "reference", "value": 0.8285 },
164
170
  { "base": "EUR", "quote": "CHF", "type": "monthly_average", "value": 0.94312 },
165
171
  // … the rest of the published table (26 currencies vs CHF)
166
172
  ],
@@ -201,7 +207,7 @@ Paid plans. One resolved rate per publication date — ready for charting, reval
201
207
  import { getHistory } from 'snb-exchange-rate';
202
208
 
203
209
  const series = await getHistory(
204
- { source: 'EUR', target: 'CHF', from: '2026-01-01', to: '2026-09-30' },
210
+ { source: 'EUR', target: 'CHF', from: '2026-01-01', to: '2026-10-27' },
205
211
  { apiKey: 'art_live_...' }
206
212
  );
207
213
  ```
@@ -214,11 +220,11 @@ const series = await getHistory(
214
220
  source: 'EUR',
215
221
  target: 'CHF',
216
222
  from: '2026-01-01',
217
- to: '2026-09-30',
223
+ to: '2026-10-27',
218
224
  count: 152,
219
225
  rates: [
220
226
  // one entry per publication date
221
- { date: '2026-09-30', rate: 0.94312, rate_type: 'monthly_average', derived: false, method: 'published' },
227
+ { date: '2026-10-27', rate: 0.9233, rate_type: 'reference', derived: false, method: 'published' },
222
228
  // …
223
229
  ],
224
230
  disclaimer: '…'
@@ -237,18 +243,19 @@ Swiss National Bank currently publishes rates covering **26 currencies** against
237
243
 
238
244
  ## 🏛️ Source
239
245
 
240
- The Swiss National Bank publishes official franc exchange rates through its data portal. The SNB publishes monthly averages (no daily official series exists), with history reaching back to 1914 — one of the longest official exchange rate records anywhere.
246
+ The Swiss National Bank publishes 11am franc exchange rates every business day for the euro, US dollar, pound sterling and yen (SNB computed rates based on Bloomberg BFIX rates), and monthly averages for about 25 currencies through its data portal, with history reaching back to 1914 — one of the longest official exchange rate records anywhere.
241
247
 
242
- - Publisher's own page: [Exchange rates — SNB data portal](https://data.snb.ch/en/topics/ziredev/cube/devkum) · [www.snb.ch](https://www.snb.ch)
243
- - Publication: every month; the exact schedule, freshness status and any current delay are on the [Swiss National Bank rates page](https://allratestoday.com/central-bank-rates-api/snb/)
248
+ - Publisher's own page: [Current interest rates and exchange rates](https://www.snb.ch/en/the-snb/mandates-goals/statistics/statistics-pub/current_interest_exchange_rates) · [www.snb.ch](https://www.snb.ch)
249
+ - Publication: every business day; the exact schedule, freshness status and any current delay are on the [Swiss National Bank rates page](https://allratestoday.com/central-bank-rates-api/snb/)
250
+ - In the API: usually by **12:20 UTC** (measured over the last 10 publications). Schedule a sync at or after that time and retry hourly until `rate_date` moves; every response carries the same figure as `available_by_utc` — see [when to poll](https://allratestoday.com/docs/#when-to-poll)
244
251
  - Values are stored unmodified, with the publisher's own `rate_date` on every row — see the [methodology](https://allratestoday.com/official-rates-methodology/)
245
252
 
246
253
  ## 🧭 Reading the numbers
247
254
 
248
255
  - `value` is always **quote currency per 1 unit of base currency** (`base: "EUR", quote: "USD", value: 1.15` means 1 EUR = 1.15 USD).
249
- - Swiss National Bank quotes **CHF per 1 unit of foreign currency** (e.g. `base: "USD", quote: "CHF"` means CHF per one US dollar).
256
+ - The Swiss National Bank quotes **CHF per 1 unit of foreign currency** (`base: "EUR", quote: "CHF"`). Two series share the table: daily 11am rates for EUR, USD, GBP and JPY (`rate_type: "reference"`, every business day) and monthly averages for about 25 currencies (`rate_type: "monthly_average"`, dated the last day of the month). Check `rate_type` on every row.
250
257
  - Need the other way round? Ask `getRate(target, source)` and the API inverts or crosses for you, flagged `derived: true` — never divide a published rate yourself in a compliance workflow.
251
- - `rate_type` tells you which of the central bank's series a row belongs to (`monthly_average` here); some publishers print buy/sell or several fixings for the same pair.
258
+ - `rate_type` tells you which of the central bank's series a row belongs to (`reference` here); some publishers print buy/sell or several fixings for the same pair.
252
259
 
253
260
  ## 🧩 ERP & accounting systems
254
261
 
@@ -321,7 +328,7 @@ getRate('EUR', 'CHF', { apiKey: 'art_live_...' }).then((pair) => console.log(pai
321
328
 
322
329
  ## 💡 Quota tips
323
330
 
324
- - Rates change once a month — cache the published table locally and a small monthly quota goes a long way.
331
+ - Rates change once per business day — cache the published table locally and a small monthly quota goes a long way.
325
332
  - Every request counts toward your AllRatesToday quota, shared across all AllRatesToday endpoints on your key.
326
333
 
327
334
  ## 📖 Methods reference
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "snb-exchange-rate",
3
- "version": "1.3.19",
4
- "description": "Official Swiss National Bank (Switzerland) monthly exchange rates — 26 currencies vs CHF, history since 1914. Zero-dependency Node.js/TypeScript client.",
3
+ "version": "1.3.22",
4
+ "description": "Official Swiss National Bank (Switzerland) daily exchange rates — 26 currencies vs CHF, history since 1914. Zero-dependency Node.js/TypeScript client.",
5
5
  "keywords": [
6
6
  "snb",
7
7
  "swiss-national-bank",