cbo-exchange-rate 1.2.6 → 1.3.1
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 +67 -9
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Central Bank of Oman Exchange
|
|
1
|
+
# Central Bank of Oman Exchange Rates API — cbo-exchange-rate
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/cbo-exchange-rate)
|
|
4
4
|
[](https://github.com/AllRates-Today/cbo-exchange-rate/blob/main/LICENSE)
|
|
@@ -18,6 +18,21 @@
|
|
|
18
18
|
|
|
19
19
|
> **Official rate, not mid-market:** every value here is a number Central Bank of Oman itself published, fixed once printed and carrying the central bank's own `rate_date` — what filings and audits require. Need the live interbank midpoint for pricing or display instead? Use the [mid-market API](https://allratestoday.com/docs/) or [`@allratestoday/sdk`](https://www.npmjs.com/package/@allratestoday/sdk). The two can diverge by several percent.
|
|
20
20
|
|
|
21
|
+
## ⚡ Try it without a key
|
|
22
|
+
|
|
23
|
+
The latest Central Bank of Oman table is also served keyless, CORS-open and edge-cached, for evaluation, embeds and AI agents:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
curl "https://allratestoday.com/api/open/central-bank/cbo?source=USD&target=OMR"
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
```js
|
|
30
|
+
const r = await fetch('https://allratestoday.com/api/open/central-bank/cbo').then((x) => x.json());
|
|
31
|
+
console.log(r.rate_date, r.rates.length); // the central bank's latest published table, no key
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
The open endpoint serves the *latest* table only and asks for a visible attribution link. The client below uses the keyed API, which adds point-in-time tables, history, and CSV/XML/Excel output.
|
|
35
|
+
|
|
21
36
|
## 🔑 Get your API key
|
|
22
37
|
|
|
23
38
|
Get a free API key at [allratestoday.com/register](https://allratestoday.com/register) — no credit card required. Latest rates are on every plan, including free.
|
|
@@ -36,7 +51,7 @@ yarn add cbo-exchange-rate
|
|
|
36
51
|
pnpm add cbo-exchange-rate
|
|
37
52
|
```
|
|
38
53
|
|
|
39
|
-
Also published under the org scope as [`@allratestoday/cbo-exchange-rate`](https://www.npmjs.com/package/@allratestoday/cbo-exchange-rate) — same code, same versions.
|
|
54
|
+
Requires Node 18+ (global `fetch`); also runs on Bun, Deno and edge runtimes. Also published under the org scope as [`@allratestoday/cbo-exchange-rate`](https://www.npmjs.com/package/@allratestoday/cbo-exchange-rate) — same code, same versions.
|
|
40
55
|
|
|
41
56
|
## 🏁 Quick start
|
|
42
57
|
|
|
@@ -70,14 +85,14 @@ const pair = await getRate('USD', 'OMR', { apiKey: 'art_live_...' });
|
|
|
70
85
|
{
|
|
71
86
|
bank: 'cbo',
|
|
72
87
|
name: 'Central Bank of Oman',
|
|
73
|
-
rate_date: '2026-
|
|
88
|
+
rate_date: '2026-09-09', // Central Bank of Oman's own publication date
|
|
74
89
|
source: 'USD',
|
|
75
90
|
target: 'OMR',
|
|
76
91
|
rate: 0.385,
|
|
77
92
|
rate_type: 'sell',
|
|
78
93
|
derived: false,
|
|
79
94
|
method: 'published',
|
|
80
|
-
disclaimer: '
|
|
95
|
+
disclaimer: 'Official rates as published by the named central bank. On weekends/holidays the most recent published rate_date is returned.'
|
|
81
96
|
}
|
|
82
97
|
```
|
|
83
98
|
|
|
@@ -98,7 +113,7 @@ console.log(table.rate_date, table.rates.length);
|
|
|
98
113
|
{
|
|
99
114
|
bank: 'cbo',
|
|
100
115
|
name: 'Central Bank of Oman',
|
|
101
|
-
rate_date: '2026-
|
|
116
|
+
rate_date: '2026-09-09',
|
|
102
117
|
rates: [
|
|
103
118
|
{ "base": "USD", "quote": "OMR", "type": "sell", "value": 0.385 },
|
|
104
119
|
{ "base": "USD", "quote": "OMR", "type": "buy", "value": 0.384 },
|
|
@@ -141,7 +156,7 @@ Paid plans. One resolved rate per publication date — ready for charting, reval
|
|
|
141
156
|
import { getHistory } from 'cbo-exchange-rate';
|
|
142
157
|
|
|
143
158
|
const series = await getHistory(
|
|
144
|
-
{ source: 'USD', target: 'OMR', from: '2026-01-01', to: '2026-
|
|
159
|
+
{ source: 'USD', target: 'OMR', from: '2026-01-01', to: '2026-09-09' },
|
|
145
160
|
{ apiKey: 'art_live_...' }
|
|
146
161
|
);
|
|
147
162
|
```
|
|
@@ -154,11 +169,11 @@ const series = await getHistory(
|
|
|
154
169
|
source: 'USD',
|
|
155
170
|
target: 'OMR',
|
|
156
171
|
from: '2026-01-01',
|
|
157
|
-
to: '2026-
|
|
172
|
+
to: '2026-09-09',
|
|
158
173
|
count: 152,
|
|
159
174
|
rates: [
|
|
160
175
|
// one entry per publication date
|
|
161
|
-
{ date: '2026-
|
|
176
|
+
{ date: '2026-09-09', rate: 0.385, rate_type: 'sell', derived: false, method: 'published' },
|
|
162
177
|
// …
|
|
163
178
|
],
|
|
164
179
|
disclaimer: '…'
|
|
@@ -175,6 +190,40 @@ Central Bank of Oman currently publishes rates covering **48 currencies** agains
|
|
|
175
190
|
|
|
176
191
|
🇦🇪 `AED` · 🇦🇺 `AUD` · 🇧🇩 `BDT` · 🇧🇭 `BHD` · 🇧🇷 `BRL` · 🇨🇦 `CAD` · 🇨🇭 `CHF` · 🇨🇳 `CNY` · 🇨🇿 `CZK` · 🇩🇰 `DKK` · 🇪🇬 `EGP` · 🇪🇹 `ETB` · 🇪🇺 `EUR` · 🇬🇧 `GBP` · 🇭🇰 `HKD` · 🇮🇩 `IDR` · 🇮🇳 `INR` · 🇯🇴 `JOD` · 🇯🇵 `JPY` · 🇰🇪 `KES` · 🇰🇷 `KRW` · 🇰🇼 `KWD` · 🇱🇧 `LBP` · 🇱🇰 `LKR` · 🇲🇦 `MAD` · 🇲🇾 `MYR` · 🇳🇴 `NOK` · 🇳🇿 `NZD` · 🇵🇭 `PHP` · 🇵🇰 `PKR` · 🇶🇦 `QAR` · 🇷🇺 `RUB` · 🇸🇦 `SAR` · 🇸🇪 `SEK` · 🇸🇬 `SGD` · 🇸🇾 `SYP` · 🇹🇭 `THB` · 🇹🇳 `TND` · 🇹🇷 `TRY` · 🇹🇼 `TWD` · 🇹🇿 `TZS` · 🇺🇸 `USD` · `XAG` · `XAU` · `XDR` · `XPT` · 🇾🇪 `YER` · 🇿🇦 `ZAR`
|
|
177
192
|
|
|
193
|
+
## 🏛️ Source
|
|
194
|
+
|
|
195
|
+
The Central Bank of Oman posts indicative buying and selling rates each business morning for 48 currencies, plus gold, silver, platinum and the SDR. The rial has been pegged to the US dollar since 1986, so the interest of this table is its breadth: it quotes the taka, rupee, peso and other remittance-corridor currencies that Omani banks, importers and customs convert at, which few Gulf publishers cover.
|
|
196
|
+
|
|
197
|
+
- Publisher's own page: [Foreign Exchange Rates (Indications)](https://cbo.gov.om/Pages/DFESearch.aspx) · [cbo.gov.om](https://cbo.gov.om)
|
|
198
|
+
- Publication: every business day; the exact schedule, freshness status and any current delay are on the [Central Bank of Oman rates page](https://allratestoday.com/central-bank-rates-api/cbo/)
|
|
199
|
+
- Values are stored unmodified, with the publisher's own `rate_date` on every row — see the [methodology](https://allratestoday.com/official-rates-methodology/)
|
|
200
|
+
|
|
201
|
+
## 🧭 Reading the numbers
|
|
202
|
+
|
|
203
|
+
- `value` is always **quote currency per 1 unit of base currency** (`base: "EUR", quote: "USD", value: 1.15` means 1 EUR = 1.15 USD).
|
|
204
|
+
- Central Bank of Oman quotes **OMR per 1 unit of foreign currency** (e.g. `base: "USD", quote: "OMR"` means OMR per one US dollar).
|
|
205
|
+
- 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.
|
|
206
|
+
- Precious-metal codes (`XAU`, `XAG`, `XPT`, `XPD`) are quoted **per troy ounce**.
|
|
207
|
+
- `rate_type` tells you which of the central bank's series a row belongs to (`sell` here); some publishers print buy/sell or several fixings for the same pair.
|
|
208
|
+
|
|
209
|
+
## 🧩 ERP & accounting systems
|
|
210
|
+
|
|
211
|
+
Loading the official Central Bank of Oman rate into an accounting system is a supported workflow, not a hack. Step-by-step guides with the direction each system expects:
|
|
212
|
+
|
|
213
|
+
- [Dynamics 365 Business Central](https://allratestoday.com/docs/integrations/business-central/) — built-in Currency Exchange Rate Service, no code
|
|
214
|
+
- [Xero](https://allratestoday.com/docs/integrations/xero/) · [QuickBooks Online](https://allratestoday.com/docs/integrations/quickbooks/) · [SAP S/4HANA and ECC](https://allratestoday.com/docs/integrations/sap/) · [Odoo](https://allratestoday.com/docs/integrations/odoo/)
|
|
215
|
+
|
|
216
|
+
The same keyed endpoints return `?format=csv`, `?format=xml` and `?format=xlsx`, and accept the key as `?api_key=` on the URL for importers that cannot send headers:
|
|
217
|
+
|
|
218
|
+
```bash
|
|
219
|
+
curl "https://allratestoday.com/api/v1/central-bank/cbo/latest?format=xml&api_key=art_live_..."
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
## 🤖 AI agents
|
|
223
|
+
|
|
224
|
+
- MCP server: `npx -y @allratestoday/central-bank-mcp` (stdio) or the hosted endpoint `https://allratestoday.com/api/mcp` — tools for official rates, history, cross-bank comparison and publication calendars
|
|
225
|
+
- Machine-readable site guide: [llms.txt](https://allratestoday.com/llms.txt) · [for-ai-agents](https://allratestoday.com/for-ai-agents/)
|
|
226
|
+
|
|
178
227
|
## ⚖️ Published vs derived rates
|
|
179
228
|
|
|
180
229
|
If Central Bank of Oman does not print a pair directly, the API resolves it from the central bank's own table and says so — official and computed values are never confused:
|
|
@@ -237,11 +286,20 @@ getRate('USD', 'OMR', { apiKey: 'art_live_...' }).then((pair) => console.log(pai
|
|
|
237
286
|
| `getRatesForDate(date, { apiKey, source?, target? })` | Paid | The official table (or one pair) for a YYYY-MM-DD date |
|
|
238
287
|
| `getHistory({ symbol \| source+target, from?, to? }, { apiKey })` | Paid | Daily series since 2022 |
|
|
239
288
|
|
|
289
|
+
## 📥 Bulk data (no key)
|
|
290
|
+
|
|
291
|
+
Need the whole archive rather than an API call? The same published tables are mirrored daily as open data:
|
|
292
|
+
|
|
293
|
+
- Hugging Face: [AllRates/central-bank-exchange-rates](https://huggingface.co/datasets/AllRates/central-bank-exchange-rates) — one CSV per institution (`rates/cbo.csv`)
|
|
294
|
+
- Kaggle: [allratestoday/central-bank-exchange-rates](https://www.kaggle.com/datasets/allratestoday/central-bank-exchange-rates)
|
|
295
|
+
- CDN JSON: `https://cdn.jsdelivr.net/gh/AllRates-Today/central-bank-exchange-rates@main/data/cbo/latest.json`
|
|
296
|
+
|
|
240
297
|
## 🔗 Links
|
|
241
298
|
|
|
242
299
|
- [Central Bank of Oman rates page](https://allratestoday.com/central-bank-rates-api/cbo/) — live table, publication cadence, FAQ
|
|
243
300
|
- [All central bank sources](https://allratestoday.com/central-bank-rates-api/)
|
|
244
|
-
- [
|
|
301
|
+
- [Package docs on the site](https://allratestoday.com/docs/sdk/cbo-exchange-rate/) · [ERP integration guides](https://allratestoday.com/docs/integrations/)
|
|
302
|
+
- [API documentation](https://allratestoday.com/docs/#central-bank) · [Interactive reference](https://allratestoday.com/api-reference/) · [Methodology](https://allratestoday.com/official-rates-methodology/)
|
|
245
303
|
- [Register (free)](https://allratestoday.com/register) · [Pricing](https://allratestoday.com/pricing/)
|
|
246
304
|
- [GitHub](https://github.com/AllRates-Today/cbo-exchange-rate)
|
|
247
305
|
|
package/package.json
CHANGED