Central Bank of Nigeria Exchange Rates API — cbn-exchange-rate
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.
🚀 Why this client?
- 🏛️ Official rates — Central Bank of Nigeria's own table, with the publisher's own
rate_date on every response
- 📅 History back to 2001 — point-in-time tables and daily series for any past date
- 🔀 Official vs derived, always flagged — computed inverse/cross pairs carry
derived: true, never mixed with official prints
- ⚡ Zero dependencies — pure ESM + CJS over global
fetch; Node 18+, Bun, Deno, and edge runtimes
- 🔷 Type-safe — full TypeScript definitions shipped with the package
- 🧾 Compliance-grade metadata —
rate_type, publication date, and source disclaimer on every response
Official rate, not mid-market: every value here is a number Central Bank of Nigeria itself published, fixed once printed and carrying the central bank's own rate_date — what filings and audits require. Need the live mid-market rate for pricing or display instead? Use the mid-market API or @allratestoday/sdk. The two can diverge by several percent.
🔑 Get your API key
Get a free API key at allratestoday.com/register — no credit card required. Latest rates are on every plan, including free.
📈 Latest official table
The image is rendered live from the keyless endpoint, so it follows the central bank's publications on npm and on GitHub alike without a new release. The same table as text is folded below for search and copy-paste: on GitHub a daily Action refreshes it whenever the central bank publishes a new table; on npm it is as of the package's publish date.
| Base | Quote | Type | Rate |
|---|
| AED | NGN | buy | 368.8961 |
| AED | NGN | middle | 369.0322 |
| AED | NGN | sell | 369.1683 |
| CHF | NGN | buy | 1627.0944 |
| CHF | NGN | middle | 1627.6948 |
| CHF | NGN | sell | 1628.2953 |
| CNY | NGN | buy | 203.1337 |
| CNY | NGN | middle | 203.2087 |
| CNY | NGN | sell | 203.2836 |
| DKK | NGN | buy | 200.9167 |
| DKK | NGN | middle | 200.9908 |
| DKK | NGN | sell | 201.065 |
| EUR | NGN | buy | 1502.0216 |
| EUR | NGN | middle | 1502.5759 |
| EUR | NGN | sell | 1503.1302 |
| GBP | NGN | buy | 1796.5729 |
| GBP | NGN | middle | 1797.2359 |
| GBP | NGN | sell | 1797.8989 |
| JPY | NGN | buy | 8.4839 |
| JPY | NGN | middle | 8.487 |
| JPY | NGN | sell | 8.4902 |
| SAR | NGN | buy | 361.0033 |
| SAR | NGN |
Source: Official rates published by CBN, served by AllRatesToday. Rates are as printed by the central bank; AllRatesToday is not affiliated with it.
📦 Installation
npm install cbn-exchange-rate
yarn add cbn-exchange-rate
pnpm add cbn-exchange-rate
Requires Node 18+ (global fetch); also runs on Bun, Deno and edge runtimes. Also published under the org scope as @allratestoday/cbn-exchange-rate — same code, same versions.
🏁 Quick start
import { getRate } from 'cbn-exchange-rate';
const pair = await getRate('USD', 'NGN', { apiKey: 'art_live_...' });
console.log(pair.rate, pair.rate_date); // the official Central Bank of Nigeria rate, on the central bank's own date
📚 API reference
This is the beginning of the README. Read the rest at the original. Read the full README ↗