# UK Trade Tariff - Commodity Codes & Duty Rates (HMRC) (`j0401/uk-trade-tariff`) Actor

The UK Trade Tariff (HMRC, OGL v3, no key): 21 sections, 98 chapters and the commodity tree, plus every import/export measure for a code - third-country duty, preferences, quotas, VAT, excise, document conditions, geographical area and validity. Browse, look up or fuzzy-search.

- **URL**: https://apify.com/j0401/uk-trade-tariff.md
- **Developed by:** [Wenhao Yang](https://apify.com/j0401) (community)
- **Categories:** Business, Developer tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.03 / 1,000 uk trade tariff records

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## UK Trade Tariff - Commodity Codes & Duty Rates (HMRC)

The UK Trade Tariff published by HMRC: **21 sections**, **98 chapters**, the
commodity tree down to 10-digit commodity codes, and every import/export
measure attached to a code. Ask for a code and you get the customs picture -
third country duty, preferential rates, quotas, VAT and excise flags, the
documents and certificates required, the geographical area and the validity
dates.

Example: `2204101100` (sparkling wine) carries **53 measures**, including a
third-country duty of **£26.00 per 100 litres**, preferential rates under the
UK's trade agreements, quota conditions and document requirements.

### Low cost

**From $0.00005 per record, down to $0.00003 at Gold.** Pay only for the
records you receive; the tariff is queried live and you are never billed for
the lookup behind it.

### What you get

| field | meaning |
|---|---|
| `recordType` | `section`, `chapter`, `heading`, `commodity` or `measure` |
| `code`, `description` | tariff code and its official description |
| `declarable` | whether the code can be declared on a customs entry |
| `sectionNumeral`, `sectionTitle`, `chapterCode`, `headingCode`, `commodityCode` | position in the tariff tree |
| `measureType`, `measureTypeSeries` | e.g. `Third country duty`, `Tariff preference`, `Supplementary unit`, `Veterinary control` |
| `geographicalArea` | where the measure applies (`ERGA OMNES`, a country, a trade agreement) |
| `dutyExpression` | the rate as printed, e.g. `0.00%`, `£26.00 / 100 litre (hl)` |
| `vat`, `excise` | VAT and excise flags |
| `conditions`, `documentCodes` | certificates, licences or documents required |
| `legalAct`, `orderNumber` | legal basis and quota order number where applicable |
| `effectiveStart`, `effectiveEnd` | measure validity |
| `chapterNote`, `matchType`, `score` | chapter note, and search match metadata |
| `refreshedDate` | lookup date |

### Browse it

- **Sections** - the default run returns all 21 sections with their chapter
  ranges.
- **Chapters** - `level="chapters"` returns all 98 chapters.
- **A chapter's headings** - `chapter="22"` (beverages).
- **A heading's commodities** - `heading="2204"` (wine).

### Search it

```json
{ "q": "bicycle", "maxResults": 10 }
```

Search covers chapters, headings, commodities and reference titles. HMRC's
search returns an exact match when the words match a reference title (one
result) and a broader list otherwise; use it to find a candidate code, then
pass the 10-digit code to `commodityCode`.

### Look up a commodity

```json
{ "commodityCode": "2204101100" }
```

Returns one row per measure. Use a **10-digit** code - the tariff only
publishes those. An 8-digit input is treated as that code with `00` appended;
if no such 10-digit commodity exists the actor returns a clear "unknown
commodity" error rather than an empty set.

Heading listings return one row per commodity code. When the tariff carries
the same 10-digit code under more than one product-line suffix, one row is
kept (the declarable node, then the longer description); rows with
`declarable=false` are grouping codes that cannot be looked up with
`commodityCode`. Chapter notes are trimmed to their first 1,000 characters,
and `conditions` (kept as the source HTML) to 1,000 characters as well.
`maxResults` applies to `mode=search` only; browse, chapter, heading and
commodity lookups return their full set.

### Example inputs

**Wine heading (all commodity codes under it)**

```json
{ "heading": "2204" }
```

**Beverages chapter**

```json
{ "chapter": "22" }
```

**Duty measures for sparkling wine**

```json
{ "commodityCode": "2204101100" }
```

### Scope and licence

The tariff is a **live legal reference**: codes, rates and conditions change,
and HMRC is the authority. This actor returns the tariff API's records as
published; it is not customs or legal advice - confirm a declaration against
the official tariff before relying on it commercially. `dutyExpression` is
blank on measures that are not duty rates (for example an excise or an import
control), and `conditions`/`documentCodes` are populated only where the
measure has them.

Published under the **Open Government Licence v3**, which permits commercial
reuse with attribution. No personal data is involved.

Data source: [UK Trade Tariff](https://www.trade-tariff.service.gov.uk/).

### Use it from an AI agent (MCP)

Connect any MCP client to `https://mcp.apify.com/?tools=j0401/uk-trade-tariff` to load this dataset as a single tool beside the tools you already have - same records, same per-record pricing.

# Actor input Schema

## `mode` (type: `string`):

browse = sections or chapters; chapter = headings in a 2-digit chapter; heading = commodities under a 4-digit heading; commodity = duty measures for a code; search = fuzzy keyword search. Leave blank to auto-route from the other fields (default: browse sections).

## `level` (type: `string`):

For mode=browse: sections (21) or chapters (98). Blank = sections.

## `chapter` (type: `string`):

Two-digit chapter code, e.g. "22" for beverages. Lists the chapter's headings.

## `heading` (type: `string`):

Four-digit heading code, e.g. "2204" for wine. Lists the commodity codes under it.

## `commodityCode` (type: `string`):

10-digit (or 8-digit) commodity code, e.g. "2204101100". Returns every import/export measure: duty rate, conditions, geographical area and validity.

## `q` (type: `string`):

Fuzzy search over chapters, headings, commodities and reference titles (e.g. "wine", "bicycle", "solar").

## `maxResults` (type: `integer`):

Cap the number of search hits (0 = the default 50). Browse, chapter, heading and commodity modes return their full list.

## Actor input object example

```json
{
  "maxResults": 50
}
```

# Actor output Schema

## `recordsUrl` (type: `string`):

UK Trade Tariff records - as JSON

## `datasetUrl` (type: `string`):

No description

## `runUrl` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("j0401/uk-trade-tariff").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("j0401/uk-trade-tariff").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call j0401/uk-trade-tariff --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,j0401/uk-trade-tariff"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/i7fZqmHsxcf3cdVly/builds/dntSX6DF55Cphr8nr/openapi.json
