cbn-exchange-rate 1.3.7 → 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 +50 -49
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -40,49 +40,49 @@ The open endpoint serves the *latest* table only and asks for a visible attribut
|
|
|
40
40
|
Today's full Central Bank of Nigeria 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
41
|
|
|
42
42
|
<!-- daily-table:start -->
|
|
43
|
-
Published **2026-10-
|
|
43
|
+
Published **2026-10-12** by Central Bank of Nigeria — 39 rates. Updated 2026-10-12.
|
|
44
44
|
|
|
45
45
|
| Base | Quote | Type | Rate |
|
|
46
46
|
| --- | --- | --- | ---: |
|
|
47
|
-
| AED | NGN | buy | 362.
|
|
48
|
-
| AED | NGN | middle | 362.
|
|
49
|
-
| AED | NGN | sell | 362.
|
|
50
|
-
| CHF | NGN | buy |
|
|
51
|
-
| CHF | NGN | middle |
|
|
52
|
-
| CHF | NGN | sell |
|
|
53
|
-
| CNY | NGN | buy | 198.
|
|
54
|
-
| CNY | NGN | middle | 198.
|
|
55
|
-
| CNY | NGN | sell |
|
|
56
|
-
| DKK | NGN | buy | 199.
|
|
57
|
-
| DKK | NGN | middle | 199.
|
|
58
|
-
| DKK | NGN | sell | 199.
|
|
59
|
-
| EUR | NGN | buy |
|
|
60
|
-
| EUR | NGN | middle |
|
|
61
|
-
| EUR | NGN | sell |
|
|
62
|
-
| GBP | NGN | buy |
|
|
63
|
-
| GBP | NGN | middle |
|
|
64
|
-
| GBP | NGN | sell |
|
|
65
|
-
| JPY | NGN | buy | 8.
|
|
66
|
-
| JPY | NGN | middle | 8.
|
|
67
|
-
| JPY | NGN | sell | 8.
|
|
68
|
-
| SAR | NGN | buy | 354.
|
|
69
|
-
| SAR | NGN | middle | 354.
|
|
70
|
-
| SAR | NGN | sell | 354.
|
|
71
|
-
| USD | NGN | buy | 1331.
|
|
72
|
-
| USD | NGN | middle | 1331.
|
|
73
|
-
| USD | NGN | sell | 1332.
|
|
74
|
-
| XDR | NGN | buy |
|
|
75
|
-
| XDR | NGN | middle |
|
|
76
|
-
| XDR | NGN | sell |
|
|
77
|
-
| XOF | NGN | buy | 2.
|
|
78
|
-
| XOF | NGN | middle | 2.
|
|
79
|
-
| XOF | NGN | sell | 2.
|
|
80
|
-
| XUA | NGN | buy |
|
|
81
|
-
| XUA | NGN | middle |
|
|
82
|
-
| XUA | NGN | sell | 1800.
|
|
83
|
-
| ZAR | NGN | buy |
|
|
84
|
-
| ZAR | NGN | middle |
|
|
85
|
-
| ZAR | NGN | sell | 80.
|
|
47
|
+
| AED | NGN | buy | 362.3805 |
|
|
48
|
+
| AED | NGN | middle | 362.5166 |
|
|
49
|
+
| AED | NGN | sell | 362.6527 |
|
|
50
|
+
| CHF | NGN | buy | 1597.3791 |
|
|
51
|
+
| CHF | NGN | middle | 1597.9791 |
|
|
52
|
+
| CHF | NGN | sell | 1598.5791 |
|
|
53
|
+
| CNY | NGN | buy | 198.8759 |
|
|
54
|
+
| CNY | NGN | middle | 198.9506 |
|
|
55
|
+
| CNY | NGN | sell | 199.0253 |
|
|
56
|
+
| DKK | NGN | buy | 199.0364 |
|
|
57
|
+
| DKK | NGN | middle | 199.1112 |
|
|
58
|
+
| DKK | NGN | sell | 199.186 |
|
|
59
|
+
| EUR | NGN | buy | 1488.0322 |
|
|
60
|
+
| EUR | NGN | middle | 1488.5912 |
|
|
61
|
+
| EUR | NGN | sell | 1489.1501 |
|
|
62
|
+
| GBP | NGN | buy | 1761.3062 |
|
|
63
|
+
| GBP | NGN | middle | 1761.9678 |
|
|
64
|
+
| GBP | NGN | sell | 1762.6294 |
|
|
65
|
+
| JPY | NGN | buy | 8.3912 |
|
|
66
|
+
| JPY | NGN | middle | 8.3944 |
|
|
67
|
+
| JPY | NGN | sell | 8.3975 |
|
|
68
|
+
| SAR | NGN | buy | 354.4013 |
|
|
69
|
+
| SAR | NGN | middle | 354.5345 |
|
|
70
|
+
| SAR | NGN | sell | 354.6676 |
|
|
71
|
+
| USD | NGN | buy | 1331.096 |
|
|
72
|
+
| USD | NGN | middle | 1331.596 |
|
|
73
|
+
| USD | NGN | sell | 1332.096 |
|
|
74
|
+
| XDR | NGN | buy | 1801.3722 |
|
|
75
|
+
| XDR | NGN | middle | 1802.0489 |
|
|
76
|
+
| XDR | NGN | sell | 1802.7255 |
|
|
77
|
+
| XOF | NGN | buy | 2.2533 |
|
|
78
|
+
| XOF | NGN | middle | 2.2633 |
|
|
79
|
+
| XOF | NGN | sell | 2.2733 |
|
|
80
|
+
| XUA | NGN | buy | 1799.4123 |
|
|
81
|
+
| XUA | NGN | middle | 1800.0882 |
|
|
82
|
+
| XUA | NGN | sell | 1800.7641 |
|
|
83
|
+
| ZAR | NGN | buy | 80.5193 |
|
|
84
|
+
| ZAR | NGN | middle | 80.5495 |
|
|
85
|
+
| ZAR | NGN | sell | 80.5797 |
|
|
86
86
|
|
|
87
87
|
Source: [Official rates published by CBN, served by AllRatesToday](https://allratestoday.com/central-bank-rates-api/cbn/). Rates are as printed by the central bank; AllRatesToday is not affiliated with it.
|
|
88
88
|
<!-- daily-table:end -->
|
|
@@ -139,10 +139,10 @@ const pair = await getRate('USD', 'NGN', { apiKey: 'art_live_...' });
|
|
|
139
139
|
{
|
|
140
140
|
bank: 'cbn',
|
|
141
141
|
name: 'Central Bank of Nigeria',
|
|
142
|
-
rate_date: '2026-10-
|
|
142
|
+
rate_date: '2026-10-12', // Central Bank of Nigeria's own publication date
|
|
143
143
|
source: 'USD',
|
|
144
144
|
target: 'NGN',
|
|
145
|
-
rate: 1331.
|
|
145
|
+
rate: 1331.596,
|
|
146
146
|
rate_type: 'middle',
|
|
147
147
|
derived: false,
|
|
148
148
|
method: 'published',
|
|
@@ -167,11 +167,11 @@ console.log(table.rate_date, table.rates.length);
|
|
|
167
167
|
{
|
|
168
168
|
bank: 'cbn',
|
|
169
169
|
name: 'Central Bank of Nigeria',
|
|
170
|
-
rate_date: '2026-10-
|
|
170
|
+
rate_date: '2026-10-12',
|
|
171
171
|
rates: [
|
|
172
|
-
{ "base": "USD", "quote": "NGN", "type": "middle", "value": 1331.
|
|
173
|
-
{ "base": "USD", "quote": "NGN", "type": "sell", "value": 1332.
|
|
174
|
-
{ "base": "USD", "quote": "NGN", "type": "buy", "value": 1331.
|
|
172
|
+
{ "base": "USD", "quote": "NGN", "type": "middle", "value": 1331.596 },
|
|
173
|
+
{ "base": "USD", "quote": "NGN", "type": "sell", "value": 1332.096 },
|
|
174
|
+
{ "base": "USD", "quote": "NGN", "type": "buy", "value": 1331.096 },
|
|
175
175
|
// … the rest of the published table (13 currencies vs NGN)
|
|
176
176
|
],
|
|
177
177
|
disclaimer: '…'
|
|
@@ -211,7 +211,7 @@ Paid plans. One resolved rate per publication date — ready for charting, reval
|
|
|
211
211
|
import { getHistory } from 'cbn-exchange-rate';
|
|
212
212
|
|
|
213
213
|
const series = await getHistory(
|
|
214
|
-
{ source: 'USD', target: 'NGN', from: '2026-01-01', to: '2026-10-
|
|
214
|
+
{ source: 'USD', target: 'NGN', from: '2026-01-01', to: '2026-10-12' },
|
|
215
215
|
{ apiKey: 'art_live_...' }
|
|
216
216
|
);
|
|
217
217
|
```
|
|
@@ -224,11 +224,11 @@ const series = await getHistory(
|
|
|
224
224
|
source: 'USD',
|
|
225
225
|
target: 'NGN',
|
|
226
226
|
from: '2026-01-01',
|
|
227
|
-
to: '2026-10-
|
|
227
|
+
to: '2026-10-12',
|
|
228
228
|
count: 152,
|
|
229
229
|
rates: [
|
|
230
230
|
// one entry per publication date
|
|
231
|
-
{ date: '2026-10-
|
|
231
|
+
{ date: '2026-10-12', rate: 1331.596, rate_type: 'middle', derived: false, method: 'published' },
|
|
232
232
|
// …
|
|
233
233
|
],
|
|
234
234
|
disclaimer: '…'
|
|
@@ -278,6 +278,7 @@ curl "https://allratestoday.com/api/v1/central-bank/cbn/latest?format=xml&api_ke
|
|
|
278
278
|
- 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
|
|
279
279
|
- 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('cbn')` 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
|
|
280
280
|
- 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 cbn ...` command
|
|
281
|
+
- 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`
|
|
281
282
|
- Machine-readable site guide: [llms.txt](https://allratestoday.com/llms.txt) · [for-ai-agents](https://allratestoday.com/for-ai-agents/)
|
|
282
283
|
|
|
283
284
|
## ⚖️ Published vs derived rates
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cbn-exchange-rate",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.8",
|
|
4
4
|
"description": "Official Central Bank of Nigeria (Nigeria) daily exchange rates — 13 currencies vs NGN, history since 2001. Zero-dependency Node.js/TypeScript client.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cbn",
|