cbn-exchange-rate 1.3.5 โ 1.3.7
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 +64 -9
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
[](https://github.com/AllRates-Today/cbn-exchange-rate/blob/main/LICENSE)
|
|
5
5
|
[](https://www.npmjs.com/package/cbn-exchange-rate)
|
|
6
6
|
[](https://www.typescriptlang.org/)
|
|
7
|
+
[](https://allratestoday.com/central-bank-rates-api/cbn/)
|
|
8
|
+
[](https://allratestoday.com/central-bank-rates-api/cbn/)
|
|
7
9
|
|
|
8
10
|
**Official Central Bank of Nigeria (Nigeria) 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 Nigeria itself prints, every business day.**
|
|
9
11
|
|
|
@@ -33,6 +35,58 @@ 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 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
|
+
|
|
42
|
+
<!-- daily-table:start -->
|
|
43
|
+
Published **2026-10-08** by Central Bank of Nigeria โ 39 rates. Updated 2026-10-08.
|
|
44
|
+
|
|
45
|
+
| Base | Quote | Type | Rate |
|
|
46
|
+
| --- | --- | --- | ---: |
|
|
47
|
+
| AED | NGN | buy | 362.4315 |
|
|
48
|
+
| AED | NGN | middle | 362.5676 |
|
|
49
|
+
| AED | NGN | sell | 362.7038 |
|
|
50
|
+
| CHF | NGN | buy | 1596.2371 |
|
|
51
|
+
| CHF | NGN | middle | 1596.8367 |
|
|
52
|
+
| CHF | NGN | sell | 1597.4363 |
|
|
53
|
+
| CNY | NGN | buy | 198.5979 |
|
|
54
|
+
| CNY | NGN | middle | 198.6725 |
|
|
55
|
+
| CNY | NGN | sell | 198.747 |
|
|
56
|
+
| DKK | NGN | buy | 199.2071 |
|
|
57
|
+
| DKK | NGN | middle | 199.282 |
|
|
58
|
+
| DKK | NGN | sell | 199.3568 |
|
|
59
|
+
| EUR | NGN | buy | 1489.1039 |
|
|
60
|
+
| EUR | NGN | middle | 1489.6633 |
|
|
61
|
+
| EUR | NGN | sell | 1490.2226 |
|
|
62
|
+
| GBP | NGN | buy | 1757.8534 |
|
|
63
|
+
| GBP | NGN | middle | 1758.5137 |
|
|
64
|
+
| GBP | NGN | sell | 1759.174 |
|
|
65
|
+
| JPY | NGN | buy | 8.4135 |
|
|
66
|
+
| JPY | NGN | middle | 8.4167 |
|
|
67
|
+
| JPY | NGN | sell | 8.4198 |
|
|
68
|
+
| SAR | NGN | buy | 354.5351 |
|
|
69
|
+
| SAR | NGN | middle | 354.6683 |
|
|
70
|
+
| SAR | NGN | sell | 354.8015 |
|
|
71
|
+
| USD | NGN | buy | 1331.1021 |
|
|
72
|
+
| USD | NGN | middle | 1331.6021 |
|
|
73
|
+
| USD | NGN | sell | 1332.1021 |
|
|
74
|
+
| XDR | NGN | buy | 1799.4371 |
|
|
75
|
+
| XDR | NGN | middle | 1800.113 |
|
|
76
|
+
| XDR | NGN | sell | 1800.7889 |
|
|
77
|
+
| XOF | NGN | buy | 2.2484 |
|
|
78
|
+
| XOF | NGN | middle | 2.2584 |
|
|
79
|
+
| XOF | NGN | sell | 2.2684 |
|
|
80
|
+
| XUA | NGN | buy | 1798.7758 |
|
|
81
|
+
| XUA | NGN | middle | 1799.4515 |
|
|
82
|
+
| XUA | NGN | sell | 1800.1271 |
|
|
83
|
+
| ZAR | NGN | buy | 79.9442 |
|
|
84
|
+
| ZAR | NGN | middle | 79.9742 |
|
|
85
|
+
| ZAR | NGN | sell | 80.0042 |
|
|
86
|
+
|
|
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
|
+
<!-- daily-table:end -->
|
|
89
|
+
|
|
36
90
|
## ๐ Get your API key
|
|
37
91
|
|
|
38
92
|
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,10 +139,10 @@ const pair = await getRate('USD', 'NGN', { apiKey: 'art_live_...' });
|
|
|
85
139
|
{
|
|
86
140
|
bank: 'cbn',
|
|
87
141
|
name: 'Central Bank of Nigeria',
|
|
88
|
-
rate_date: '2026-10-
|
|
142
|
+
rate_date: '2026-10-08', // Central Bank of Nigeria's own publication date
|
|
89
143
|
source: 'USD',
|
|
90
144
|
target: 'NGN',
|
|
91
|
-
rate:
|
|
145
|
+
rate: 1331.6021,
|
|
92
146
|
rate_type: 'middle',
|
|
93
147
|
derived: false,
|
|
94
148
|
method: 'published',
|
|
@@ -113,11 +167,11 @@ console.log(table.rate_date, table.rates.length);
|
|
|
113
167
|
{
|
|
114
168
|
bank: 'cbn',
|
|
115
169
|
name: 'Central Bank of Nigeria',
|
|
116
|
-
rate_date: '2026-10-
|
|
170
|
+
rate_date: '2026-10-08',
|
|
117
171
|
rates: [
|
|
118
|
-
{ "base": "USD", "quote": "NGN", "type": "middle", "value":
|
|
119
|
-
{ "base": "USD", "quote": "NGN", "type": "sell", "value":
|
|
120
|
-
{ "base": "USD", "quote": "NGN", "type": "buy", "value":
|
|
172
|
+
{ "base": "USD", "quote": "NGN", "type": "middle", "value": 1331.6021 },
|
|
173
|
+
{ "base": "USD", "quote": "NGN", "type": "sell", "value": 1332.1021 },
|
|
174
|
+
{ "base": "USD", "quote": "NGN", "type": "buy", "value": 1331.1021 },
|
|
121
175
|
// โฆ the rest of the published table (13 currencies vs NGN)
|
|
122
176
|
],
|
|
123
177
|
disclaimer: 'โฆ'
|
|
@@ -157,7 +211,7 @@ Paid plans. One resolved rate per publication date โ ready for charting, reval
|
|
|
157
211
|
import { getHistory } from 'cbn-exchange-rate';
|
|
158
212
|
|
|
159
213
|
const series = await getHistory(
|
|
160
|
-
{ source: 'USD', target: 'NGN', from: '2026-01-01', to: '2026-10-
|
|
214
|
+
{ source: 'USD', target: 'NGN', from: '2026-01-01', to: '2026-10-08' },
|
|
161
215
|
{ apiKey: 'art_live_...' }
|
|
162
216
|
);
|
|
163
217
|
```
|
|
@@ -170,11 +224,11 @@ const series = await getHistory(
|
|
|
170
224
|
source: 'USD',
|
|
171
225
|
target: 'NGN',
|
|
172
226
|
from: '2026-01-01',
|
|
173
|
-
to: '2026-10-
|
|
227
|
+
to: '2026-10-08',
|
|
174
228
|
count: 152,
|
|
175
229
|
rates: [
|
|
176
230
|
// one entry per publication date
|
|
177
|
-
{ date: '2026-10-
|
|
231
|
+
{ date: '2026-10-08', rate: 1331.6021, rate_type: 'middle', derived: false, method: 'published' },
|
|
178
232
|
// โฆ
|
|
179
233
|
],
|
|
180
234
|
disclaimer: 'โฆ'
|
|
@@ -223,6 +277,7 @@ curl "https://allratestoday.com/api/v1/central-bank/cbn/latest?format=xml&api_ke
|
|
|
223
277
|
|
|
224
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
|
|
225
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
|
+
- 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
|
|
226
281
|
- Machine-readable site guide: [llms.txt](https://allratestoday.com/llms.txt) ยท [for-ai-agents](https://allratestoday.com/for-ai-agents/)
|
|
227
282
|
|
|
228
283
|
## โ๏ธ 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.7",
|
|
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",
|