cbn-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.
Files changed (2) hide show
  1. package/README.md +64 -9
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -4,6 +4,8 @@
4
4
  [![license](https://img.shields.io/npm/l/cbn-exchange-rate.svg)](https://github.com/AllRates-Today/cbn-exchange-rate/blob/main/LICENSE)
5
5
  [![zero dependencies](https://img.shields.io/badge/dependencies-0-brightgreen.svg)](https://www.npmjs.com/package/cbn-exchange-rate)
6
6
  [![TypeScript](https://img.shields.io/badge/TypeScript-types%20included-3178C6.svg)](https://www.typescriptlang.org/)
7
+ [![USD/NGN today](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fallratestoday.com%2Fapi%2Fopen%2Fcentral-bank%2Fcbn%3Fsource%3DUSD%26target%3DNGN&query=%24.rate&label=USD%2FNGN%20published%20by%20Central%20Bank%20of%20Nigeria&color=0A7E8C&cacheSeconds=3600)](https://allratestoday.com/central-bank-rates-api/cbn/)
8
+ [![rate date](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fallratestoday.com%2Fapi%2Fopen%2Fcentral-bank%2Fcbn%3Fsource%3DUSD%26target%3DNGN&query=%24.rate_date&label=rate%20date&color=555&cacheSeconds=3600)](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-12** by Central Bank of Nigeria โ€” 39 rates. Updated 2026-10-12.
44
+
45
+ | Base | Quote | Type | Rate |
46
+ | --- | --- | --- | ---: |
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
+
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-08', // Central Bank of Nigeria's own publication date
142
+ rate_date: '2026-10-12', // Central Bank of Nigeria's own publication date
89
143
  source: 'USD',
90
144
  target: 'NGN',
91
- rate: 1331.6021,
145
+ rate: 1331.596,
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-08',
170
+ rate_date: '2026-10-12',
117
171
  rates: [
118
- { "base": "USD", "quote": "NGN", "type": "middle", "value": 1331.6021 },
119
- { "base": "USD", "quote": "NGN", "type": "sell", "value": 1332.1021 },
120
- { "base": "USD", "quote": "NGN", "type": "buy", "value": 1331.1021 },
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 },
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-08' },
214
+ { source: 'USD', target: 'NGN', from: '2026-01-01', to: '2026-10-12' },
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-08',
227
+ to: '2026-10-12',
174
228
  count: 152,
175
229
  rates: [
176
230
  // one entry per publication date
177
- { date: '2026-10-08', rate: 1331.6021, rate_type: 'middle', derived: false, method: 'published' },
231
+ { date: '2026-10-12', rate: 1331.596, rate_type: 'middle', derived: false, method: 'published' },
178
232
  // โ€ฆ
179
233
  ],
180
234
  disclaimer: 'โ€ฆ'
@@ -224,6 +278,7 @@ curl "https://allratestoday.com/api/v1/central-bank/cbn/latest?format=xml&api_ke
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
226
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`
227
282
  - Machine-readable site guide: [llms.txt](https://allratestoday.com/llms.txt) ยท [for-ai-agents](https://allratestoday.com/for-ai-agents/)
228
283
 
229
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.6",
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",