cbb-exchange-rate 1.3.6 โ 1.3.8
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 +54 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
[](https://github.com/AllRates-Today/cbb-exchange-rate/blob/main/LICENSE)
|
|
5
5
|
[](https://www.npmjs.com/package/cbb-exchange-rate)
|
|
6
6
|
[](https://www.typescriptlang.org/)
|
|
7
|
+
[](https://allratestoday.com/central-bank-rates-api/cbb/)
|
|
8
|
+
[](https://allratestoday.com/central-bank-rates-api/cbb/)
|
|
7
9
|
|
|
8
10
|
**Official Central Bank of Bahrain (Bahrain) 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 Central Bank of Bahrain itself prints, every business day.**
|
|
9
11
|
|
|
@@ -33,6 +35,52 @@ console.log(r.rate_date, r.rates.length); // the central bank's latest published
|
|
|
33
35
|
|
|
34
36
|
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
37
|
|
|
38
|
+
## ๐ Latest published table
|
|
39
|
+
|
|
40
|
+
Today's full Central Bank of Bahrain table, straight from the central bank's latest publication. On GitHub it is refreshed by [a daily Action](.github/workflows/daily-table.yml) that reads the keyless endpoint above and commits only when the central bank publishes a new table; the copy on npm is as of the package's publish date.
|
|
41
|
+
|
|
42
|
+
<!-- daily-table:start -->
|
|
43
|
+
Published **2026-10-12** by Central Bank of Bahrain โ 33 rates. Updated 2026-10-12.
|
|
44
|
+
|
|
45
|
+
| Base | Quote | Type | Rate |
|
|
46
|
+
| --- | --- | --- | ---: |
|
|
47
|
+
| AED | BHD | reference | 0.102391 |
|
|
48
|
+
| ANG | BHD | reference | 0.210101 |
|
|
49
|
+
| AUD | BHD | reference | 0.262674 |
|
|
50
|
+
| BDT | BHD | reference | 0.003065 |
|
|
51
|
+
| CAD | BHD | reference | 0.263769 |
|
|
52
|
+
| CHF | BHD | reference | 0.453137 |
|
|
53
|
+
| CNY | BHD | reference | 0.056193 |
|
|
54
|
+
| EGP | BHD | reference | 0.007182 |
|
|
55
|
+
| EUR | BHD | reference | 0.421399 |
|
|
56
|
+
| GBP | BHD | reference | 0.497913 |
|
|
57
|
+
| HKD | BHD | reference | 0.047924 |
|
|
58
|
+
| IDR | BHD | reference | 0.000021 |
|
|
59
|
+
| ILS | BHD | reference | 0.122786 |
|
|
60
|
+
| INR | BHD | reference | 0.003888 |
|
|
61
|
+
| JOD | BHD | reference | 0.531113 |
|
|
62
|
+
| JPY | BHD | reference | 0.002378 |
|
|
63
|
+
| KWD | BHD | reference | 1.209439 |
|
|
64
|
+
| LBP | BHD | reference | 0.000004 |
|
|
65
|
+
| LKR | BHD | reference | 0.001137 |
|
|
66
|
+
| MAD | BHD | reference | 0.038547 |
|
|
67
|
+
| NOK | BHD | reference | 0.039342 |
|
|
68
|
+
| NPR | BHD | reference | 0.00243 |
|
|
69
|
+
| NZD | BHD | reference | 0.211132 |
|
|
70
|
+
| OMR | BHD | reference | 0.976809 |
|
|
71
|
+
| PHP | BHD | reference | 0.005987 |
|
|
72
|
+
| PKR | BHD | reference | 0.001357 |
|
|
73
|
+
| QAR | BHD | reference | 0.103172 |
|
|
74
|
+
| SAR | BHD | reference | 0.10014 |
|
|
75
|
+
| SGD | BHD | reference | 0.293699 |
|
|
76
|
+
| THB | BHD | reference | 0.011217 |
|
|
77
|
+
| TND | BHD | reference | 0.125152 |
|
|
78
|
+
| TRY | BHD | reference | 0.007622 |
|
|
79
|
+
| USD | BHD | reference | 0.376081 |
|
|
80
|
+
|
|
81
|
+
Source: [Official rates published by CBB, served by AllRatesToday](https://allratestoday.com/central-bank-rates-api/cbb/). Rates are as printed by the central bank; AllRatesToday is not affiliated with it.
|
|
82
|
+
<!-- daily-table:end -->
|
|
83
|
+
|
|
36
84
|
## ๐ Get your API key
|
|
37
85
|
|
|
38
86
|
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.
|
|
@@ -85,7 +133,7 @@ const pair = await getRate('USD', 'BHD', { apiKey: 'art_live_...' });
|
|
|
85
133
|
{
|
|
86
134
|
bank: 'cbb',
|
|
87
135
|
name: 'Central Bank of Bahrain',
|
|
88
|
-
rate_date: '2026-10-
|
|
136
|
+
rate_date: '2026-10-12', // Central Bank of Bahrain's own publication date
|
|
89
137
|
source: 'USD',
|
|
90
138
|
target: 'BHD',
|
|
91
139
|
rate: 0.376081,
|
|
@@ -113,7 +161,7 @@ console.log(table.rate_date, table.rates.length);
|
|
|
113
161
|
{
|
|
114
162
|
bank: 'cbb',
|
|
115
163
|
name: 'Central Bank of Bahrain',
|
|
116
|
-
rate_date: '2026-10-
|
|
164
|
+
rate_date: '2026-10-12',
|
|
117
165
|
rates: [
|
|
118
166
|
{ "base": "USD", "quote": "BHD", "type": "reference", "value": 0.376081 },
|
|
119
167
|
// โฆ the rest of the published table (33 currencies vs BHD)
|
|
@@ -155,7 +203,7 @@ Paid plans. One resolved rate per publication date โ ready for charting, reval
|
|
|
155
203
|
import { getHistory } from 'cbb-exchange-rate';
|
|
156
204
|
|
|
157
205
|
const series = await getHistory(
|
|
158
|
-
{ source: 'USD', target: 'BHD', from: '2026-01-01', to: '2026-10-
|
|
206
|
+
{ source: 'USD', target: 'BHD', from: '2026-01-01', to: '2026-10-12' },
|
|
159
207
|
{ apiKey: 'art_live_...' }
|
|
160
208
|
);
|
|
161
209
|
```
|
|
@@ -168,11 +216,11 @@ const series = await getHistory(
|
|
|
168
216
|
source: 'USD',
|
|
169
217
|
target: 'BHD',
|
|
170
218
|
from: '2026-01-01',
|
|
171
|
-
to: '2026-10-
|
|
219
|
+
to: '2026-10-12',
|
|
172
220
|
count: 152,
|
|
173
221
|
rates: [
|
|
174
222
|
// one entry per publication date
|
|
175
|
-
{ date: '2026-10-
|
|
223
|
+
{ date: '2026-10-12', rate: 0.376081, rate_type: 'reference', derived: false, method: 'published' },
|
|
176
224
|
// โฆ
|
|
177
225
|
],
|
|
178
226
|
disclaimer: 'โฆ'
|
|
@@ -222,6 +270,7 @@ curl "https://allratestoday.com/api/v1/central-bank/cbb/latest?format=xml&api_ke
|
|
|
222
270
|
- 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
|
|
223
271
|
- Already using the general SDK or MCP server? Since 2026-10-01 [`@allratestoday/sdk`](https://www.npmjs.com/package/@allratestoday/sdk) 1.4+ has `officialRates('cbb')` and [`@allratestoday/mcp-server`](https://www.npmjs.com/package/@allratestoday/mcp-server) 0.6+ has a `get_official_rates` tool โ both return this source's latest table with no key, so you can add it without a second dependency
|
|
224
272
|
- Claude Code plugin (no key): `/plugin marketplace add AllRates-Today/claude-code-plugin` then `/plugin install allratestoday@allratestoday` โ bundles both MCP servers plus an `/official-rate cbb ...` command
|
|
273
|
+
- Need dated tables or history for an evaluation? Agents can self-issue a trial key with no signup: `POST https://allratestoday.com/api/agent/keys` (send `Content-Type: application/json`) returns a 100-call key valid 7 days; the MCP servers expose it as `request_trial_key`
|
|
225
274
|
- Machine-readable site guide: [llms.txt](https://allratestoday.com/llms.txt) ยท [for-ai-agents](https://allratestoday.com/for-ai-agents/)
|
|
226
275
|
|
|
227
276
|
## โ๏ธ Published vs derived rates
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cbb-exchange-rate",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.8",
|
|
4
4
|
"description": "Official Central Bank of Bahrain (Bahrain) daily exchange rates โ 33 currencies vs BHD, history since 2016. Zero-dependency Node.js/TypeScript client.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cbb",
|