@allratestoday/sama-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.
- package/README.md +80 -44
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
[&color=0A7E8C&cacheSeconds=3600)](https://allratestoday.com/central-bank-rates-api/sama/)
|
|
8
8
|
[](https://allratestoday.com/central-bank-rates-api/sama/)
|
|
9
9
|
|
|
10
|
-
**Official Saudi Central Bank (SAMA) (Saudi Arabia)
|
|
10
|
+
**Official Saudi Central Bank (SAMA) (Saudi Arabia) 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 Saudi Central Bank (SAMA) itself prints, every business day.**
|
|
11
11
|
|
|
12
12
|
## 🚀 Why this client?
|
|
13
13
|
|
|
@@ -47,38 +47,74 @@ 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-
|
|
50
|
+
<summary>Table as text: published 2026-10-28 by Saudi Central Bank (SAMA) — 66 rates, first 60 shown. Updated 2026-10-29.</summary>
|
|
51
51
|
|
|
52
52
|
| Base | Quote | Type | Rate |
|
|
53
53
|
| --- | --- | --- | ---: |
|
|
54
|
-
|
|
|
55
|
-
|
|
|
56
|
-
|
|
|
57
|
-
|
|
|
58
|
-
|
|
|
59
|
-
|
|
|
60
|
-
|
|
|
61
|
-
|
|
|
62
|
-
|
|
|
63
|
-
|
|
|
64
|
-
|
|
|
65
|
-
|
|
|
66
|
-
|
|
|
67
|
-
|
|
|
68
|
-
|
|
|
69
|
-
|
|
|
70
|
-
|
|
|
71
|
-
|
|
|
72
|
-
|
|
|
73
|
-
|
|
|
74
|
-
|
|
|
75
|
-
|
|
|
76
|
-
|
|
|
77
|
-
|
|
|
54
|
+
| AED | SAR | reference | 1.02094 |
|
|
55
|
+
| AFN | SAR | reference | 0.05771 |
|
|
56
|
+
| ALL | SAR | reference | 0.04603 |
|
|
57
|
+
| ARS | SAR | reference | 0.00243 |
|
|
58
|
+
| AUD | SAR | reference | 2.63812 |
|
|
59
|
+
| BAM | SAR | reference | 2.13681 |
|
|
60
|
+
| BDT | SAR | reference | 0.03022 |
|
|
61
|
+
| BGN | SAR | reference | 2.13681 |
|
|
62
|
+
| BHD | SAR | reference | 9.9364 |
|
|
63
|
+
| BND | SAR | reference | 2.92762 |
|
|
64
|
+
| BRL | SAR | reference | 0.70221 |
|
|
65
|
+
| CAD | SAR | reference | 2.67141 |
|
|
66
|
+
| CHF | SAR | reference | 4.52515 |
|
|
67
|
+
| CLP | SAR | reference | 0.00382 |
|
|
68
|
+
| CNY | SAR | reference | 0.56239 |
|
|
69
|
+
| COP | SAR | reference | 0.00118 |
|
|
70
|
+
| CUP | SAR | reference | 0.15625 |
|
|
71
|
+
| CZK | SAR | reference | 0.17182 |
|
|
72
|
+
| DJF | SAR | reference | 0.02109 |
|
|
73
|
+
| DKK | SAR | reference | 0.55915 |
|
|
74
|
+
| DZD | SAR | reference | 0.02772 |
|
|
75
|
+
| EGP | SAR | reference | 0.06684 |
|
|
76
|
+
| ETB | SAR | reference | 0.02305 |
|
|
77
|
+
| EUR | SAR | reference | 4.17918 |
|
|
78
|
+
| GBP | SAR | reference | 4.99237 |
|
|
79
|
+
| HKD | SAR | reference | 0.47801 |
|
|
80
|
+
| HUF | SAR | reference | 0.0114 |
|
|
81
|
+
| INR | SAR | reference | 0.03942 |
|
|
82
|
+
| ISK | SAR | reference | 0.03063 |
|
|
83
|
+
| JOD | SAR | reference | 5.28913 |
|
|
84
|
+
| JPY | SAR | reference | 0.02375 |
|
|
85
|
+
| KES | SAR | reference | 0.02886 |
|
|
86
|
+
| KRW | SAR | reference | 0.00283 |
|
|
87
|
+
| KWD | SAR | reference | 12.04625 |
|
|
88
|
+
| LKR | SAR | reference | 0.01127 |
|
|
89
|
+
| LYD | SAR | reference | 0.58387 |
|
|
90
|
+
| MAD | SAR | reference | 0.38059 |
|
|
91
|
+
| MMK | SAR | reference | 0.00178 |
|
|
92
|
+
| MUR | SAR | reference | 0.07919 |
|
|
93
|
+
| MXN | SAR | reference | 0.20119 |
|
|
94
|
+
| MYR | SAR | reference | 0.91709 |
|
|
95
|
+
| NGN | SAR | reference | 0.00275 |
|
|
96
|
+
| NOK | SAR | reference | 0.40185 |
|
|
97
|
+
| NZD | SAR | reference | 2.13487 |
|
|
98
|
+
| OMR | SAR | reference | 9.74025 |
|
|
99
|
+
| PHP | SAR | reference | 0.05842 |
|
|
100
|
+
| PKR | SAR | reference | 0.01355 |
|
|
101
|
+
| PLN | SAR | reference | 0.95057 |
|
|
102
|
+
| QAR | SAR | reference | 1.02993 |
|
|
103
|
+
| RON | SAR | reference | 0.78111 |
|
|
104
|
+
| RUB | SAR | reference | 0.04655 |
|
|
105
|
+
| SEK | SAR | reference | 0.37751 |
|
|
106
|
+
| SGD | SAR | reference | 2.92808 |
|
|
107
|
+
| SOS | SAR | reference | 0.00659 |
|
|
108
|
+
| THB | SAR | reference | 0.11107 |
|
|
109
|
+
| TJS | SAR | reference | 0.40725 |
|
|
110
|
+
| TND | SAR | reference | 1.24642 |
|
|
111
|
+
| TRY | SAR | reference | 0.07532 |
|
|
112
|
+
| TWD | SAR | reference | 0.11546 |
|
|
113
|
+
| TZS | SAR | reference | 0.00141 |
|
|
78
114
|
|
|
79
115
|
</details>
|
|
80
116
|
|
|
81
|
-
Source: [Official rates published by SAMA, served by AllRatesToday](https://allratestoday.com/central-bank-rates-api/sama/). Rates are as printed by the central bank; AllRatesToday is not affiliated with it.
|
|
117
|
+
[Full table on the Saudi Central Bank (SAMA) rates page](https://allratestoday.com/central-bank-rates-api/sama/) · Source: [Official rates published by SAMA, served by AllRatesToday](https://allratestoday.com/central-bank-rates-api/sama/). Rates are as printed by the central bank; AllRatesToday is not affiliated with it.
|
|
82
118
|
<!-- daily-table:end -->
|
|
83
119
|
|
|
84
120
|
## 📦 Installation
|
|
@@ -129,11 +165,11 @@ const pair = await getRate('EUR', 'SAR', { apiKey: 'art_live_...' });
|
|
|
129
165
|
{
|
|
130
166
|
bank: 'sama',
|
|
131
167
|
name: 'Saudi Central Bank (SAMA)',
|
|
132
|
-
rate_date: '2026-
|
|
168
|
+
rate_date: '2026-10-27', // Saudi Central Bank (SAMA)'s own publication date
|
|
133
169
|
source: 'EUR',
|
|
134
170
|
target: 'SAR',
|
|
135
|
-
rate: 4.
|
|
136
|
-
rate_type: '
|
|
171
|
+
rate: 4.2015,
|
|
172
|
+
rate_type: 'reference',
|
|
137
173
|
derived: false,
|
|
138
174
|
method: 'published',
|
|
139
175
|
disclaimer: 'Official rates as published by the named central bank. On weekends/holidays the most recent published rate_date is returned.'
|
|
@@ -157,11 +193,10 @@ console.log(table.rate_date, table.rates.length);
|
|
|
157
193
|
{
|
|
158
194
|
bank: 'sama',
|
|
159
195
|
name: 'Saudi Central Bank (SAMA)',
|
|
160
|
-
rate_date: '2026-
|
|
196
|
+
rate_date: '2026-10-27',
|
|
161
197
|
rates: [
|
|
162
|
-
{ "base": "EUR", "quote": "SAR", "type": "
|
|
163
|
-
|
|
164
|
-
// … the rest of the published table (12 currencies vs SAR)
|
|
198
|
+
{ "base": "EUR", "quote": "SAR", "type": "reference", "value": 4.2015 },
|
|
199
|
+
// … the rest of the published table (66 currencies vs SAR)
|
|
165
200
|
],
|
|
166
201
|
disclaimer: '…'
|
|
167
202
|
}
|
|
@@ -200,7 +235,7 @@ Paid plans. One resolved rate per publication date — ready for charting, reval
|
|
|
200
235
|
import { getHistory } from '@allratestoday/sama-exchange-rate';
|
|
201
236
|
|
|
202
237
|
const series = await getHistory(
|
|
203
|
-
{ source: 'EUR', target: 'SAR', from: '2026-01-01', to: '2026-
|
|
238
|
+
{ source: 'EUR', target: 'SAR', from: '2026-01-01', to: '2026-10-27' },
|
|
204
239
|
{ apiKey: 'art_live_...' }
|
|
205
240
|
);
|
|
206
241
|
```
|
|
@@ -213,11 +248,11 @@ const series = await getHistory(
|
|
|
213
248
|
source: 'EUR',
|
|
214
249
|
target: 'SAR',
|
|
215
250
|
from: '2026-01-01',
|
|
216
|
-
to: '2026-
|
|
251
|
+
to: '2026-10-27',
|
|
217
252
|
count: 152,
|
|
218
253
|
rates: [
|
|
219
254
|
// one entry per publication date
|
|
220
|
-
{ date: '2026-
|
|
255
|
+
{ date: '2026-10-27', rate: 4.2015, rate_type: 'reference', derived: false, method: 'published' },
|
|
221
256
|
// …
|
|
222
257
|
],
|
|
223
258
|
disclaimer: '…'
|
|
@@ -230,16 +265,17 @@ Pass `{ symbol: 'EUR' }` instead of `source`/`target` to get the raw published r
|
|
|
230
265
|
|
|
231
266
|
## 🗺️ Currencies covered
|
|
232
267
|
|
|
233
|
-
Saudi Central Bank (SAMA) currently publishes rates covering **
|
|
268
|
+
Saudi Central Bank (SAMA) currently publishes rates covering **66 currencies** against the SAR (as of the latest table):
|
|
234
269
|
|
|
235
|
-
🇦🇺 `AUD` · 🇧🇷 `BRL` · 🇨🇭 `CHF` · 🇨🇳 `CNY` · 🇪🇺 `EUR` · 🇬🇧 `GBP` · 🇮🇳 `INR` · 🇯🇵 `JPY` · 🇰🇷 `KRW` · 🇹🇭 `THB` · 🇹🇷 `TRY` · 🇺🇸 `USD`
|
|
270
|
+
🇦🇪 `AED` · 🇦🇫 `AFN` · 🇦🇱 `ALL` · 🇦🇷 `ARS` · 🇦🇺 `AUD` · 🇧🇦 `BAM` · 🇧🇩 `BDT` · 🇧🇬 `BGN` · 🇧🇭 `BHD` · 🇧🇳 `BND` · 🇧🇷 `BRL` · 🇨🇦 `CAD` · 🇨🇭 `CHF` · 🇨🇱 `CLP` · 🇨🇳 `CNY` · 🇨🇴 `COP` · 🇨🇺 `CUP` · 🇨🇿 `CZK` · 🇩🇯 `DJF` · 🇩🇰 `DKK` · 🇩🇿 `DZD` · 🇪🇬 `EGP` · 🇪🇹 `ETB` · 🇪🇺 `EUR` · 🇬🇧 `GBP` · 🇭🇰 `HKD` · 🇭🇺 `HUF` · 🇮🇳 `INR` · 🇮🇸 `ISK` · 🇯🇴 `JOD` · 🇯🇵 `JPY` · 🇰🇪 `KES` · 🇰🇷 `KRW` · 🇰🇼 `KWD` · 🇱🇰 `LKR` · 🇱🇾 `LYD` · 🇲🇦 `MAD` · 🇲🇲 `MMK` · 🇲🇺 `MUR` · 🇲🇽 `MXN` · 🇲🇾 `MYR` · 🇳🇬 `NGN` · 🇳🇴 `NOK` · 🇳🇿 `NZD` · 🇴🇲 `OMR` · 🇵🇭 `PHP` · 🇵🇰 `PKR` · 🇵🇱 `PLN` · 🇶🇦 `QAR` · 🇷🇴 `RON` · 🇷🇺 `RUB` · 🇸🇪 `SEK` · 🇸🇬 `SGD` · 🇸🇴 `SOS` · 🇹🇭 `THB` · 🇹🇯 `TJS` · 🇹🇳 `TND` · 🇹🇷 `TRY` · 🇹🇼 `TWD` · 🇹🇿 `TZS` · 🇺🇸 `USD` · `XAF` · `XDR` · `XOF` · 🇾🇪 `YER` · 🇿🇦 `ZAR`
|
|
236
271
|
|
|
237
272
|
## 🏛️ Source
|
|
238
273
|
|
|
239
|
-
The Saudi Central Bank (SAMA) publishes riyal exchange
|
|
274
|
+
The Saudi Central Bank (SAMA) publishes a riyal exchange-rate table every day — 60+ currencies, seven days a week — with the riyal itself pegged to the US dollar at 3.75 since 1986. This series comes straight from SAMA’s own exchange-rate page, with daily history from April 2021 and SAMA’s monthly period averages for 12 currencies back to 2009.
|
|
240
275
|
|
|
241
|
-
- Publisher's own page: [Exchange rates —
|
|
242
|
-
- Publication: every
|
|
276
|
+
- Publisher's own page: [Exchange rates — sama.gov.sa](https://www.sama.gov.sa/en-US/Currency/FinExc/Pages/Currency.aspx) · [www.sama.gov.sa](https://www.sama.gov.sa)
|
|
277
|
+
- Publication: every business day; the exact schedule, freshness status and any current delay are on the [Saudi Central Bank (SAMA) rates page](https://allratestoday.com/central-bank-rates-api/sama/)
|
|
278
|
+
- In the API: usually by **17:15 UTC** (measured over the last 14 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)
|
|
243
279
|
- Values are stored unmodified, with the publisher's own `rate_date` on every row — see the [methodology](https://allratestoday.com/official-rates-methodology/)
|
|
244
280
|
|
|
245
281
|
## 🧭 Reading the numbers
|
|
@@ -247,7 +283,7 @@ The Saudi Central Bank (SAMA) publishes riyal exchange rates monthly — period
|
|
|
247
283
|
- `value` is always **quote currency per 1 unit of base currency** (`base: "EUR", quote: "USD", value: 1.15` means 1 EUR = 1.15 USD).
|
|
248
284
|
- Saudi Central Bank (SAMA) quotes **SAR per 1 unit of foreign currency** (e.g. `base: "USD", quote: "SAR"` means SAR per one US dollar).
|
|
249
285
|
- 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.
|
|
250
|
-
- `rate_type` tells you which of the central bank's series a row belongs to (`
|
|
286
|
+
- `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.
|
|
251
287
|
|
|
252
288
|
## 🧩 ERP & accounting systems
|
|
253
289
|
|
|
@@ -320,7 +356,7 @@ getRate('EUR', 'SAR', { apiKey: 'art_live_...' }).then((pair) => console.log(pai
|
|
|
320
356
|
|
|
321
357
|
## 💡 Quota tips
|
|
322
358
|
|
|
323
|
-
- Rates change once
|
|
359
|
+
- Rates change once per business day — cache the published table locally and a small monthly quota goes a long way.
|
|
324
360
|
- Every request counts toward your AllRatesToday quota, shared across all AllRatesToday endpoints on your key.
|
|
325
361
|
|
|
326
362
|
## 📖 Methods reference
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@allratestoday/sama-exchange-rate",
|
|
3
|
-
"version": "1.3.
|
|
4
|
-
"description": "Official Saudi Central Bank (SAMA) (Saudi Arabia)
|
|
3
|
+
"version": "1.3.22",
|
|
4
|
+
"description": "Official Saudi Central Bank (SAMA) (Saudi Arabia) daily exchange rates — 66 currencies vs SAR, history since 2009. Zero-dependency Node.js/TypeScript client.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"sama",
|
|
7
7
|
"saudi-central-bank-sama",
|