# Global Tariff & Duty Monitor: US HTS + UK Customs (MCP) (`amygraphics/global-tariff-duty-monitor`) Actor

Official customs-duty lookup & alerts: US HTS (USITC) + UK Trade Tariff (GOV.UK) in one run. Search any product or HS code for MFN, FTA/preferential & column-2 rates, or watch your product codes - charged only when a duty changes. MCP-ready.

- **URL**: https://apify.com/amygraphics/global-tariff-duty-monitor.md
- **Developed by:** [Zakaria el bouami](https://apify.com/amygraphics) (community)
- **Categories:** Lead generation, Automation, MCP servers
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event

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/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

## Global Tariff & Duty Monitor: US HTS + UK Customs (MCP)

Search **official customs-duty rates** and get alerted when they change — for the United States (USITC Harmonized Tariff Schedule) and the United Kingdom (HMRC Trade Tariff API) in one run. Built for AI agents and humans: no key, no login, dataset-ready, MCP-compatible.

### Why this data is hard (and worth it)

- Every search hits **two official government APIs** — `hts.usitc.gov` (US International Trade Commission) and `www.trade-tariff.service.gov.uk` (GOV.UK / HMRC). No mirrors, no summarized blogs: the authoritative rate, fetched live.
- The raw formats are hostile: USITC returns undocumented `reststop` objects where the code lives in `htsno` and rates split across `general` / `special` / `other` columns; the UK API is JSON:API with 500+ `included` nodes per product (60+ measures, effective-date windows, preferential origins). This actor resolves all of it into one clean row per tariff line.
- Tariffs move constantly (trade measures, quotas, preference schemes). An LLM memorizing "the duty for coffee" will be wrong sooner or later — a customs broker bills $50–$500 per classification. Here you get the **current official rate** for $0.001 per line.

### What you get per tariff line

| field | meaning |
|---|---|
| `hsCode`, `description` | normalized code + product text (US: as in HTS; UK: declarable commodity) |
| `dutyGeneral` | US: **General** (MFN) column rate. UK: **Third country duty** (base UKGT rate) |
| `dutySpecial` | US only: **Special** column (FTA rates incl. country groups, e.g. `Free (A+,AU,BH,...,MA,...)`) |
| `dutyOther` | US only: **Column 2** rate (countries without normal trade relations) |
| `dutyPreferences` | UK only: preferential rates with origin (e.g. `0.00% (European Union); 0.00% (CARIFORUM)`) |
| `dutyOtherMeasures` | UK only: other current measures (organic controls, restrictions…), truncated list |
| `dutyNotes`, `units` | US footnote flags + tariff units; UK `measureCount` of active measures |
| `additionalDuties` | US flag that extra duties (e.g. Section 301) may apply — verify on hts.usitc.gov |
| `declarable` | UK: this code is a real customs-line code you can declare with |

### Mode `search` — duty lookup

```json
{ "mode": "search", "query": "coffee", "markets": ["us", "uk"], "maxResults": 10 }
```

- Keyword → USITC keyword search + UK search references (8,900+ cross-refs filtered to your exact words), each resolved to its real commodity with duty.
- HS code → prefix matching: `0901`, `0901.90`, or full `0901210000`.
- Charged per tariff line returned.

### Mode `monitor` — duty-change alerts (watchlist)

```json
{ "mode": "monitor", "watchlist": ["us:0901.90.20.00", "uk:0901210000", "uk:8507600000"] }
```

- **Run 1 = free baseline** (info row only, $0 in line charges) — duty snapshot of every watched code stored in a persistent key-value store.
- **Run 2+ = diff** — you are charged **only for codes whose duty actually changed** (`changeKind: "duty-changed"`, with `previousDuty` for before/after).
- Schedule it daily in Apify (Console → Schedule) and add a webhook to Slack / Google Sheets / n8n / Make for push alerts. A zero-change day costs **$0.001 total** (start event only).

### Three ready recipes

1. **Landed-cost checker for AI agents** — wire this actor as an MCP tool; your agent answers "what's the import duty for LED lamps into the US and UK?" with official rates and source links.
2. **Importer watchlist** — export your product codes from your ERP to `watchlist`, run daily, receive alerts before a rate change hits your margins or makes a customs declaration wrong.
3. **Catalog browsing** — query a 4-digit heading (e.g. `0901`) to list every tariff line under it, US and UK, with rates — for classification research.

### Data honesty & limits

- US rates shown are the HTS **General/Special/Other** text exactly as USITC publishes; additional duties (Section 301, AD/CVD, quotas) are **flagged, not summed** — always confirm on hts.usitc.gov before declaring.
- UK rates come from the live Trade Tariff API; preferential eligibility depends on rules of origin — `dutyPreferences` lists the scheme rates, not eligibility.
- **EU TARIC is not covered** (the official Access2Markets API requires a registered key) — US + UK only, stated plainly.
- This is **official data, not legal/tax advice**. For binding classification, consult a licensed customs broker or the relevant authority.

### Sources (official, anonymous, no key)

- US ITC — Harmonized Tariff Schedule: <https://hts.usitc.gov> (endpoint `reststop/search`)
- UK HMRC — Trade Tariff API: <https://www.gov.uk/trade-tariff> (JSON:API `api/v2`)

### Price

| event | price |
|---|---|
| Actor start | $0.001 |
| Tariff line extracted (search row or changed watchlist code) | $0.001 / line |

Typical runs: a 10-line search ≈ **$0.011** · a 25-code watchlist with 2 changed duties ≈ **$0.003**.

### MCP / AI-agent usage

Add the actor URL to your agent as a tool, or run via API:

```
https://api.apify.com/v2/acts/YOUR_HANDLE~global-tariff-duty-monitor/run-sync-get-dataset-items?token=YOUR_TOKEN
```

Input = the JSON examples above. Output = the dataset rows described in the table. The actor is compatible with per-request agentic payments.

Questions / feedback: see the actor's **Issues** tab on Apify Store.

# Actor input Schema

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

search = find duty rates by product keyword or HS code. monitor = diff duty rates for your watchlist of codes (first run = free baseline).

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

Product keyword (e.g. 'coffee', 'lithium batteries') or HS code (e.g. '0901210000', '0901.21'). Long codes are matched by prefix.

## `markets` (type: `array`):

us = USITC Harmonized Tariff Schedule (US). uk = HMRC Trade Tariff (UK).

## `watchlist` (type: `array`):

Codes to watch, each as 'market:code', e.g. 'us:0901.90.20.00' or 'uk:0901210000'. First run saves a free baseline; later runs emit only duty changes.

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

Maximum tariff lines returned (charged per line).

## `requestDelaySecs` (type: `number`):

Politeness pacing between calls to the official APIs.

## `proxyConfiguration` (type: `object`):

Optional. The official USITC and GOV.UK endpoints do not require proxies.

## Actor input object example

```json
{
  "mode": "search",
  "query": "coffee",
  "markets": [
    "us",
    "uk"
  ],
  "watchlist": [
    "us:0901.90.20.00",
    "uk:0901210000"
  ],
  "maxResults": 10,
  "requestDelaySecs": 0.6
}
```

# Actor output Schema

## `results` (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("amygraphics/global-tariff-duty-monitor").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("amygraphics/global-tariff-duty-monitor").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 amygraphics/global-tariff-duty-monitor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,amygraphics/global-tariff-duty-monitor"
        }
    }
}
```

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/OllWrvjy4usYkTsfJ/builds/e3osGR7Ig7rQgY8vP/openapi.json
