UK Trade Tariff API
Free UK Trade Tariff API with no key: look up any commodity code for duty rates, import measures, VAT treatment, quotas and the full goods nomenclature tree. Tested example.
Endpoint tested and returned HTTP 200 on 2026-08-21
What is the UK Trade Tariff API?
The UK Trade Tariff service publishes commodity codes, duty rates and import and export measures as a free JSON:API with no key. A ten-digit commodity code returns its description, duties, measures and place in the nomenclature.
Every physical good crossing the UK border has a ten-digit commodity code, and that code determines the duty, the VAT treatment and which licences or restrictions apply. This API is the machine-readable form of the official tariff, which means an import cost calculation can be built against the same data a customs declaration is checked against rather than a scraped copy of it.
The response is JSON:API, so the commodity object holds mostly attributes and identifiers while the substance — duty measures, footnotes, geographical areas, section and chapter — sits in `relationships` and must be resolved against the `included` array. A `basic_duty_rate` of null does not mean duty-free: it means the applicable rate is expressed as a measure rather than a single headline number. Codes are also time-bound, with `validity_start_date` and `validity_end_date` marking when a code was in force.
Quick facts
- Base URL
https://www.trade-tariff.service.gov.uk/api/v2- Authentication
- No key or registration. Published by HMRC as part of the UK Trade Tariff service.
- Rate limit
- No documented limit. The tariff changes on defined dates rather than continuously.
- Pricing
- Free.
- CORS
- Enabled — callable directly from browser JavaScript
- Official docs
- Read the docs
How to use the UK Trade Tariff API
Every request below was executed against the live API on 2026-08-21, and the response shown is the real body it returned — not an illustration.
1. UK commodity code 0101210000 with its duty measures
GET https://www.trade-tariff.service.gov.uk/api/v2/commodities/0101210000
curl 'https://www.trade-tariff.service.gov.uk/api/v2/commodities/0101210000'const res = await fetch("https://www.trade-tariff.service.gov.uk/api/v2/commodities/0101210000");
if (!res.ok) throw new Error(`Request failed: ${res.status}`);
const data = await res.json();
console.log(data);import requests
res = requests.get("https://www.trade-tariff.service.gov.uk/api/v2/commodities/0101210000", timeout=20)
res.raise_for_status()
print(res.json()){
"data": {
"id": "93796",
"type": "commodity",
"attributes": {
"producline_suffix": "80",
"description": "Pure-bred breeding animals",
"number_indents": 2,
"goods_nomenclature_item_id": "0101210000",
"bti_url": "https://www.gov.uk/guidance/check-what-youll-need-to-get-a-legally-binding-decision-on-a-commodity-code",
"formatted_description": "Pure-bred breeding animals",
"description_plain": "Pure-bred breeding animals",
"consigned": false,
"consigned_from": null,
"basic_duty_rate": null,
"meursing_code": false,
"validity_start_date": "2012-01-01T00:00:00.000Z",
"validity_end_date": null,
"has_chemicals": false,
"declarable": true
},
"relationships": {
"footnotes": {
"data": [
{
"id": "NC018",
"type": "footnote"
},
{
"id": "TN701",
"type": "footnote"
}
]
},
"section": {
"data": {
"id": "1",
"type": "section"
}
},
"chapter": {
"data": {
"id": "27623",
"type": "chapter"
}
},
"heading": {
"data": {
"id": "27624",
"type": "heading"
}
},
"ancestors": {
"data": [
{
"id": "93797",
"type": "commodity"
}
]
},
"import_measures": {
"data": [
{
"id": "20000000",
"type": "measure"
},Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
/commodities/{code} | path | Required | Ten-digit commodity code. 0101210000 |
as_of | query | Optional | Date in `YYYY-MM-DD` to see the tariff as it stood then. 2026-01-01 |
/headings/{code} | path | Optional | Four-digit heading, for browsing down the nomenclature. 0101 |
/sections | /chapters | path | Optional | Top levels of the goods classification tree. |
/search | path | Optional | Free-text search across commodity descriptions. |
Response fields
data.attributes.goods_nomenclature_item_idstring- The ten-digit commodity code itself.
data.attributes.description / formatted_descriptionstring- Official description, plain and with markup.
data.attributes.basic_duty_ratestring|null- Headline duty rate where one exists. Null means duty is expressed through measures instead — not that it is zero.
data.attributes.declarableboolean- Whether this code can be used on a declaration, or is only a classification level.
data.attributes.validity_start_date / validity_end_datestring- When the code came into force and, if applicable, when it ceased.
data.attributes.number_indentsinteger- Depth in the nomenclature tree, which drives indentation in a browse UI.
data.relationships.footnotes / section / measuresobject- References into the `included` array holding the real substance.
included[]array- Resolved measures, duty expressions, geographical areas and footnotes.
What you can build with the UK Trade Tariff API
- Calculate import duty and VAT for a product before shipping
- Validate a commodity code supplied by a supplier
- Browse the goods nomenclature to classify a new product
- Check the tariff as it stood on a past date with `as_of`
Common errors and how to fix them
404 not found
The commodity code does not exist or is not declarable at that length.
Fix: Codes are ten digits with no spaces. Some classification levels are browse-only; check `declarable`.
Duty appears to be zero
`basic_duty_rate` is null.
Fix: Null means the rate is expressed as measures in `included`, not that the good is duty-free. Resolve the relationships.
Historical lookup returns current data
`as_of` was omitted.
Fix: Without it you get today's tariff. Codes and rates change on defined dates and the API can serve either.
UK Trade Tariff API — frequently asked questions
Is the UK Trade Tariff API free?
Yes. HMRC publishes commodity codes, duty rates and import measures openly with no key or registration.
What is a commodity code?
A ten-digit classification for a physical good, applied when it crosses the UK border. The code determines the duty rate, the VAT treatment and any licences or restrictions that apply, so classifying a product wrongly changes what you owe.
Why is basic_duty_rate null?
Because the applicable duty is expressed as one or more measures rather than a single headline rate. Resolve `relationships.measures` against the `included` array to see the real treatment.
Can I look up the tariff as it was last year?
Yes. Pass `as_of` with a date and the API returns the classification and measures in force then, which matters when checking a historical declaration.
Tools that pair with this API
VAT Calculator
Add VAT to a net price or extract VAT from a gross amount. Preset 5%, 10%, 20% and 23% rates plus custom, showing net, VAT and gross values instantly.
Margin & Markup Calculator
Calculate profit margin, markup and profit from cost and selling price, or find the price for a target margin. Ideal for pricing products and quotes.
JSON Path Finder
Evaluate a dot/bracket path against your JSON and list every leaf path for discovery. Free online JSON path finder that runs 100% in your browser.
UK Trade Tariff is an independent third-party service and is not affiliated with ByteTools or ByteVancer. Details on this page were verified on 2026-08-21; always check the official documentation before relying on this API in production, as terms and limits can change.