Customs does not use the market rate. Each customs service publishes its own table for a set period, and the declaration must use the table in force on the date the rule names. The official rates endpoints return that table, the dates it covers and how the figure was reached. The example is a Japanese import.
Which customs tables the API serves
On 2 November 2026 the official rates endpoints served customs tables for 14 countries. Eleven have a public page on this site: the United Kingdom, Switzerland, South Africa, Singapore, the Philippines, Ireland, New Zealand, Norway and Sri Lanka under official rates, Japan in Japanese at /ja/official/japan and Indonesia in Indonesian. Each table has an authority, a cadence and a legal basis, and the API returns all three.
curl "https://api.exchangerate.dev/v1/official/JPN/customs"{"country":"JPN","types":["customs"],"name":"Japan Customs weekly exchange rates for customs value","authority":{"name":"Japan Customs (Ministry of Finance)"},"home_currency":"JPY","cadence":"weekly, Sunday to Saturday","history_start":"2025-01-05","latest_publication":"2026-11-01"}Get the rate in force on the import date
Japan Customs publishes a new table every Sunday that stays in force until Saturday. An import declared on Wednesday 14 October uses the table that started on Sunday 11 October. Pass the declaration date and the API selects the publication.
curl "https://api.exchangerate.dev/v1/official/JPN/customs/rate/USD/JPY?date=2026-10-14"{"date":"2026-10-11","base":"USD","quote":"JPY","rate":157.75,"valid_to":"2026-10-17","method":"published"}date is the first day of the publication and valid_to the last. method is published when the authority printed that pair itself.
Convert the invoice
The convert endpoint multiplies for you and returns the same publication. A lookup for the latest table works on the Free plan. A lookup for a past date needs Basic ($19 a month), and official convert needs Plus ($39 a month).
curl "https://api.exchangerate.dev/v1/official/JPN/customs/convert/USD/JPY/12500?date=2026-10-14" \ -H "X-API-Key: $EXCHANGERATE_API_KEY"{"date":"2026-10-11","base":"USD","quote":"JPY","rate":157.75,"valid_to":"2026-10-17","method":"published","amount":12500.0,"converted":1971875.0}12,500 USD at 157.75 is 1,971,875 yen as the customs value before duty. Check the rounding rules of the declaration form, as the API returns the product without applying them.
When the authority prints the other direction
HMRC in the United Kingdom publishes foreign currency per pound, once a month. Ask for dollars to pounds and the API inverts the published figure and says so in method.
curl "https://api.exchangerate.dev/v1/official/GBR/customs/rate/USD/GBP?date=2026-10-15"{"date":"2026-10-01","base":"USD","quote":"GBP","rate":0.7431629013,"valid_to":"2026-10-31","method":"inverted"}The monthly table was in force from 1 to 31 October. Keep the publication date with the declaration, so an inspector sees which table you used.
How far from the market these rates sit
A customs rate can sit well away from the market. From 2 January to 30 October 2026 the Japanese table sat 1.05% from the ECB reference rate on average and 4.14% on its widest day. Duty is calculated on the customs value, so the declared rate is the one that counts.
The API reports the tables the authorities publish. Which table applies to a shipment, and from what date, depends on the customs law of the importing country. Confirm it with a broker or the authority.