# UK Import Duty & Tariff Calculator (`dogmatic_eyepiece/uk-import-tariff`) Actor

Calculate UK customs duty, import VAT and estimated landed cost using authoritative UK Trade Tariff data. Search commodity codes, inspect tariff measures, compare sourcing countries and integrate through API/MCP.

- **URL**: https://apify.com/dogmatic\_eyepiece/uk-import-tariff.md
- **Developed by:** [Matthew Harbour](https://apify.com/dogmatic_eyepiece) (community)
- **Categories:** Developer tools, Automation, E-commerce
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $8.00 / 1,000 landed cost calculations

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

### Calculate UK import duty, tariffs and landed cost

**UK Import Duty & Tariff Calculator API + MCP** provides structured UK customs and import-cost calculations using authoritative UK Trade Tariff data.

Use it to:

- search UK commodity codes
- retrieve tariff rates and import measures
- calculate estimated UK customs duty
- calculate estimated import VAT and landed cost
- compare costs for different countries of origin
- identify licences, restrictions, quotas and other import requirements

Built for **developers, AI coding agents, ecommerce, procurement, sourcing, logistics and workflow automation**.

> **Important:** Unofficial community Actor. Not affiliated with HMRC or the UK Government. Uses authoritative UK Trade Tariff data. Not customs or legal advice.

***

### How to call it

Set `operation`, then the fields for that operation. One run = one operation.

| Intent | Prefer |
|--------|--------|
| “What’s the commodity code for …?” | `search_commodity_codes` |
| “What duty rate applies?” | `get_tariff_measures` or `calculate_import_duty` |
| “What’s the total import cost?” | `calculate_landed_cost` |
| “China vs Germany after UK duty?” | `compare_origin_costs` |
| “Any licences / restrictions?” | `explain_import_requirements` |

**Scope:** Great Britain imports · calculations in **GBP** only · preferential rates are **shown, not auto-applied** · free-text search is classification **assistance**, not a binding ruling.

***

### Operations

| Operation | What it does |
|-----------|--------------|
| `search_commodity_codes` | Declarable UK commodity code candidates from a description |
| `get_tariff_measures` | Measures for code + origin + date |
| `calculate_import_duty` | Estimated UK customs duty |
| `calculate_landed_cost` | Duty + import VAT + landed cost estimate |
| `compare_origin_costs` | Same goods across origin countries |
| `explain_import_requirements` | Licences, restrictions, quotas and related measures |

***

### Example inputs

#### Landed cost

```json
{
  "operation": "calculate_landed_cost",
  "commodity_code": "8712003090",
  "origin_country": "CN",
  "goods_value": 2000,
  "currency": "GBP",
  "shipping_cost": 200
}
```

#### Search codes

```json
{
  "operation": "search_commodity_codes",
  "query": "bicycles",
  "max_results": 10
}
```

#### Compare origins

```json
{
  "operation": "compare_origin_costs",
  "commodity_code": "8712003090",
  "origins": ["CN", "DE"],
  "goods_value": 2000,
  "currency": "GBP",
  "shipping_cost": 200
}
```

Results include assumptions, warnings and provenance so you can cite Trade Tariff sources without scraping GOV.UK pages.

***

### What this Actor does not do

- Currency conversion (GBP only)
- Full Northern Ireland / EU-destination engines in this version
- Auto-applying preferential rates without required proofs
- Inventing freight-forwarder or brokerage fees you did not supply
- Binding legal commodity classification

***

### Example use cases

**Ecommerce** — indicative UK duty / VAT / landed cost before checkout.\
**AI agents** — “Duty on this SKU from China?”, “Cheaper from CN or JP after UK duty?”, “Licence required?”\
**Procurement / sourcing** — compare origin countries on tariff treatment.\
**Logistics / customs software** — pull measures into fulfilment workflows.

***

### Keywords

UK import duty · UK customs duty · UK tariff · UK Trade Tariff · import VAT · landed cost · commodity code · HS code · MCP

# Actor input Schema

## `operation` (type: `string`):

Which tool to run.

## `query` (type: `string`):

For search\_commodity\_codes: product description or HS/commodity code.

## `max_results` (type: `integer`):

Maximum commodity code candidates to return from search.

## `commodity_code` (type: `string`):

10-digit UK commodity code.

## `origin_country` (type: `string`):

ISO 3166-1 alpha-2 origin country code (e.g. CN, US, DE).

## `origins` (type: `array`):

For compare\_origin\_costs: list of ISO country codes.

## `goods_value` (type: `number`):

Goods value in GBP.

## `currency` (type: `string`):

Must be GBP for MVP. No silent currency conversion.

## `shipping_cost` (type: `number`):

Shipping / freight cost in GBP included in customs value when supplied.

## `insurance_cost` (type: `number`):

Insurance cost in GBP included in customs value when supplied.

## `other_costs` (type: `number`):

Other known costs in GBP for landed-cost estimates.

## `other_customs_value_costs` (type: `number`):

Other amounts to include in the customs value basis for duty calculation.

## `shipping_by_origin` (type: `object`):

Map of origin country code to shipping cost for origin comparison.

## `import_date` (type: `string`):

Effective tariff date YYYY-MM-DD. Defaults to today when omitted.

## `quantity` (type: `number`):

Optional quantity for future specific-duty support.

## Actor input object example

```json
{
  "operation": "calculate_landed_cost",
  "query": "bicycles",
  "max_results": 10,
  "commodity_code": "8712003090",
  "origin_country": "CN",
  "origins": [
    "CN",
    "DE"
  ],
  "goods_value": 2000,
  "currency": "GBP",
  "shipping_cost": 200,
  "shipping_by_origin": {
    "CN": 250,
    "DE": 100
  }
}
```

# Actor output Schema

## `result` (type: `string`):

Default dataset item(s) containing the operation result: duty/landed-cost totals, measure buckets, search candidates, origin comparison rows, import requirements, or a structured error.

# 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 = {
    "query": "bicycles",
    "commodity_code": "8712003090",
    "origin_country": "CN",
    "origins": [
        "CN",
        "DE"
    ],
    "goods_value": 2000,
    "shipping_cost": 200,
    "shipping_by_origin": {
        "CN": 250,
        "DE": 100
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("dogmatic_eyepiece/uk-import-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 = {
    "query": "bicycles",
    "commodity_code": "8712003090",
    "origin_country": "CN",
    "origins": [
        "CN",
        "DE",
    ],
    "goods_value": 2000,
    "shipping_cost": 200,
    "shipping_by_origin": {
        "CN": 250,
        "DE": 100,
    },
}

# Run the Actor and wait for it to finish
run = client.actor("dogmatic_eyepiece/uk-import-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 '{
  "query": "bicycles",
  "commodity_code": "8712003090",
  "origin_country": "CN",
  "origins": [
    "CN",
    "DE"
  ],
  "goods_value": 2000,
  "shipping_cost": 200,
  "shipping_by_origin": {
    "CN": 250,
    "DE": 100
  }
}' |
apify call dogmatic_eyepiece/uk-import-tariff --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,dogmatic_eyepiece/uk-import-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/b1RBWHbC8M3gc3iSB/builds/kde6eajDA3gG4LEuy/openapi.json
