@allratestoday/customs-exchange-rates
v1.0.0
Published
Customs exchange rates API for Node.js and browsers: the official rates 46 customs authorities set for customs valuation (German Zoll, Dutch Douane, HMRC, CBSA, US CBP, China Customs, Japan Customs and more), by clearance country and declaration date. Typ
Maintainers
Keywords
Readme
customs-exchange-rates
Customs exchange rates API for Node.js and browsers. The official exchange rates that 46 customs authorities set for customs valuation, asked for by clearance country and declaration date: German Zoll, Dutch Douane, French customs, HMRC, CBSA, US Customs and Border Protection, China Customs, Japan Customs, Korea Customs, SARS, India CBIC and more. TypeScript, zero dependencies.
Built for customs filing and brokerage software, freight forwarding systems, landed-cost and duty calculators, and cross-border checkout.
Why a separate rate
Customs duty and import VAT are a percentage of customs value, and customs value must be converted into the importing country's currency at the rate the customs authority of the clearance country sets for the declaration date. That is not the market rate, and usually not the central bank rate either. Each country has its own table, period (daily, weekly, fortnightly, monthly) and format. This package gives you all of them through one call, keyed by ISO country code, with the date of the table in force so it can be kept with the entry.
Install
npm install customs-exchange-ratesGet an API key at allratestoday.com/register. The latest table works on every key; dated lookups (the table in force on a past declaration date) need a paid plan.
Usage
import { CustomsExchangeRates, authorityFor } from 'customs-exchange-rates';
const customs = new CustomsExchangeRates({ apiKey: process.env.ALLRATES_KEY! });
// Goods cleared in Rotterdam, declaration accepted 12 November 2026
const r = await customs.rate('NL', 'USD', 'EUR', { date: '2026-11-12' });
r.rate; // EUR per 1 USD, from the Dutch customs table in force
r.rate_date; // the date of that table
r.authority.name; // "Douane (Netherlands Customs)"
// Customs value of an invoice, with the evidence to keep with the entry
const v = await customs.customsValue(18_400, 'USD', 'NL', '2026-11-12');
// { value: 15xxx.xx, currency: 'EUR', rate, evidence: { country: 'NL', authority: 'douanenl', rate_date, method } }
// The whole table in force today for Japan
const jp = await customs.table('JP');
// Offline: which authority covers a country (no request, no key)
authorityFor('US'); // { authority: 'cbp', name: 'U.S. Customs and Border Protection', currency: 'USD', cadence: 'weekly', ... }Methods
| Method | What it returns |
|---|---|
| rate(country, source, target, { date?, type? }) | One pair from the customs table in force, today or on date |
| table(country, { date? }) | The whole customs table in force |
| customsValue(amount, invoiceCurrency, country, date?) | The amount in the clearance country's customs currency, plus evidence |
| countries() | Every covered clearance country (offline) |
| authorityFor(country) / isCovered(country) | Catalog lookups (offline) |
date is the declaration acceptance date, or the date of exportation for the United States (19 CFR 159). A dated request returns the table in force on that date: the latest table on or before it.
Two-sided tables (India CBIC, Korea Customs) carry import and export rates; pass { type: 'import' } or { type: 'export' }.
US and China
US CBP and China Customs offer no table a program can fetch, so the API applies their published rules to the official series they come from:
- US (
cbp): rates certified by the Federal Reserve Bank of New York, per 19 CFR 159 Subpart C: a quarterly rate for the listed currencies, replaced by the daily rate on days it moves 5% or more, and the daily rate for the rest. These are the Federal Reserve H.10 figures. - China (
gacc): GACC Order 272 Article 13: the CFETS central parity of the third Wednesday of the previous month.
Those responses carry method: 'rule', derived: true and a basis object naming the series and the rule.
Coverage
46 customs authorities, 48 clearance countries:
| Country | Code | Customs authority | Currency | Cadence |
|---|---|---|---|---|
| Argentina | AR | ARCA Customs (Argentina) | ARS | daily |
| Australia | AU | Australian Border Force | AUD | daily |
| Austria | AT | Austrian Ministry of Finance (BMF) | EUR | monthly |
| Bangladesh | BD | Bangladesh National Board of Revenue (customs rates) | BDT | monthly |
| Belgium | BE | Belgian Customs (FPS Finance) | EUR | monthly |
| Belize | BZ | Belize Customs and Excise | BZD | weekly |
| Bermuda | BM | Bermuda Customs | BMD | weekly |
| Cambodia | KH | Cambodia General Department of Customs and Excise | KHR | daily |
| Canada | CA | Canada Border Services Agency | CAD | daily |
| Chile | CL | Servicio Nacional de Aduanas (Chile customs) | CLP | monthly |
| China | CN | General Administration of Customs of China (GACC) | CNY | monthly |
| Cyprus | CY | Cyprus Department of Customs and Excise | EUR | monthly |
| Czech Republic | CZ | Czech Customs Administration | CZK | monthly |
| Dominican Republic | DO | DGA (Dominican Republic customs) | DOP | daily |
| France | FR | French Customs (DGDDI) | EUR | monthly |
| Germany | DE | German Customs (Zoll) | EUR | monthly |
| Ghana | GH | Ghana Revenue Authority Customs (ICUMS) | GHS | weekly |
| Guyana | GY | Guyana Revenue Authority (customs rates) | GYD | monthly |
| Iceland | IS | Iceland Revenue and Customs (Skatturinn) | ISK | weekly |
| India | IN | Central Board of Indirect Taxes and Customs (CBIC) | INR | fortnightly |
| Indonesia | ID | Indonesia Ministry of Finance (Kurs Pajak) | IDR | weekly |
| Ireland | IE | Revenue Commissioners (Ireland customs rates) | EUR | monthly |
| Japan | JP | Japan Customs | JPY | weekly |
| Jordan | JO | Jordan Customs Department | JOD | monthly |
| Kenya | KE | Kenya Revenue Authority (customs rates) | KES | weekly |
| Liechtenstein | LI | Swiss Federal Office for Customs and Border Security | CHF | undefined |
| Luxembourg | LU | Luxembourg Customs and Excise | EUR | monthly |
| Madagascar | MG | Madagascar Customs (Douanes) | MGA | weekly |
| Mauritius | MU | Mauritius Revenue Authority (Customs) | MUR | weekly |
| Monaco | MC | French Customs (DGDDI) | EUR | undefined |
| Netherlands | NL | Douane (Netherlands Customs) | EUR | monthly |
| New Zealand | NZ | New Zealand Customs Service | NZD | fortnightly |
| North Macedonia | MK | North Macedonia Customs Administration | MKD | monthly |
| Norway | NO | Norwegian Customs (Tolletaten) | NOK | fortnightly |
| Paraguay | PY | DNIT (Paraguay tax and customs authority) | PYG | daily |
| Peru | PE | SUNAT (Peru tax and customs authority) | PEN | daily |
| Poland | PL | Poland Ministry of Finance customs rates | PLN | monthly |
| Portugal | PT | Portugal Tax and Customs Authority (AT) | EUR | monthly |
| Serbia | RS | Serbia Customs Administration | RSD | weekly |
| South Africa | ZA | SARS customs rates of exchange | ZAR | daily |
| South Korea | KR | Korea Customs Service | KRW | weekly |
| Sri Lanka | LK | Sri Lanka Customs | LKR | weekly |
| Sweden | SE | Swedish Customs (Tullverket) | SEK | monthly |
| Switzerland | CH | Swiss Federal Office for Customs and Border Security | CHF | daily |
| Thailand | TH | Thai Customs Department | THB | monthly |
| Uganda | UG | Uganda Revenue Authority | UGX | per notice |
| United Kingdom | GB | HM Revenue & Customs | GBP | monthly |
| United States | US | U.S. Customs and Border Protection | USD | weekly |
Missing a clearance country? Tell us which one.
REST API
The package wraps these endpoints, which any language can call:
# Which authority covers which country (no key)
curl https://allratestoday.com/api/v1/customs
# The table in force on a declaration date
curl "https://allratestoday.com/api/v1/customs/NL/2026-11-12?source=USD&target=EUR" \
-H "Authorization: Bearer YOUR_KEY"Every endpoint also returns CSV, XML or XLSX with ?format=csv|xml|xlsx. See the customs exchange rate API page and the OpenAPI spec.
🔗 Links
- Website: allratestoday.com
- Customs Exchange Rate API
- Tax and customs authority rates
- Customs rates for finance teams
- API Documentation
- Register (Free)
- Status
- GitHub
📜 License
MIT
