# US Tariff, HTS Code & Landed Cost Calculator (MCP-Ready) (`ferraz_michel/usitc-hts-tariff-mcp`) Actor

Look up official USITC Harmonized Tariff Schedule (HTS) duty rates and compute complete US import landed costs: General MFN duties, USMCA/FTA exemptions, Chapter 99 (Section 301/232) tariffs, CBP MPF & HMF fees, and multi-country sourcing comparisons (China vs Vietnam vs Mexico) for AI agents.

- **URL**: https://apify.com/ferraz_michel/usitc-hts-tariff-mcp.md
- **Developed by:** [Michel Ferraz](https://apify.com/ferraz_michel) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.00 / 1,000 hts 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.

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

## US Tariff, HTS Code & Landed Cost Calculator (MCP-Ready)

> Look up official U.S. International Trade Commission (USITC) Harmonized Tariff Schedule (HTS) duty rates and compute complete US import landed costs—combining automatic 10-digit rate inheritance, USMCA/FTA exemptions, Chapter 99 Section 301/232 estimates, CBP MPF & HMF import fees, and multi-country sourcing comparisons (`China vs. Vietnam vs. Mexico vs. South Korea`).

***

### Why This Actor Beats Raw USITC API Lookups

1. **Solves 10-Digit HTS Rate Inheritance Automatically:** In the raw USITC API, 10-digit statistical codes (e.g. `8507.60.00.10`) return blank `general` / `special` / `other` strings because tariff rates sit on the 8-digit parent (`8507.60.00`). This Actor fetches the heading tree automatically and attaches inherited rates + related Chapter 99 (`9902.*` / `9903.*`) provisions.
2. **Full CBP Customs Fee Engine (MPF + HMF + FTA):** Computes FY2026 **Merchandise Processing Fee (MPF: 0.3464%, min $32.71 / max $634.62 formal or $2.62 informal, $0 FTA-exempt)** and **Harbor Maintenance Fee (HMF: 0.125% ocean)**.
3. **Instant Multi-Country Sourcing Comparison:** Evaluates your `countryOfOrigin` side-by-side against `compareCountries` (default `CN`, `VN`, `MX`, `KR`), surfacing `bestAlternativeCountry` and `maxSourcingSavingsUsd` in both dataset rows and the compact MCP `OUTPUT` summary.
4. **Zero API Keys Required:** Queries official `https://hts.usitc.gov/reststop/search` directly with no external tokens.

***

### Input Parameters

| Field | Type | Description | Example |
| :--- | :--- | :--- | :--- |
| `query` | String | 6/8/10-digit HTS code or product keyword | `"8507.60"`, `"8507.60.00.10"`, `"solar panels"` |
| `countryOfOrigin` | String | Primary 2-letter ISO country of origin | `"CN"` |
| `compareCountries` | Array | Alternative origins for sourcing cost comparison | `["CN", "VN", "MX", "KR"]` |
| `shipmentValueUsd` | Number | Commercial invoice FOB customs value (USD) | `25000` |
| `freightAndInsuranceUsd` | Number | International freight & insurance cost (USD) | `1200` |
| `transportMode` | String | Arrival mode (`"ocean"`, `"air"`, `"truck"`) | `"ocean"` |
| `additionalTariffPercent` | Number | Optional Chapter 99 / Section 301 / 232 override % | `25` |
| `includeChapter99Notes` | Boolean | Attach related Chapter 99 provisions returned by USITC | `true` |
| `maxResults` | Integer | Maximum HTS lines to analyze (1–100) | `10` |
| `outputMode` | String | `"detailed"` or `"mcp_summary"` | `"detailed"` |

***

### MCP Executive Tariff Summary Example (`OUTPUT`)

```json
{
  "title": "USITC HTS Tariff & Landed Cost MCP Summary",
  "status": "OK",
  "metrics": {
    "total_hts_lines_evaluated": 4,
    "avg_effective_duty_and_fee_percent": 28.87,
    "fta_exempt_lines_for_origin": 0,
    "highest_duty_htsno": "8507.60.00.10",
    "highest_total_duties_and_fees_usd": 7217.85
  },
  "items": [
    {
      "htsno": "8507.60.00.10",
      "general_mfn": "3.4%",
      "origin": "CN",
      "effective_rate_pct": 28.87,
      "total_landed_cost_usd": 33417.85,
      "best_alternative_country": "MX",
      "max_sourcing_savings_usd": 7186.6
    }
  ]
}
```

# Actor input Schema

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

10-digit, 8-digit, or 6-digit US HTS code (e.g. '8507.60', '8507.60.00.10', '9403.20') OR product description keyword (e.g. 'lithium-ion batteries', 'solar panels').

## `countryOfOrigin` (type: `string`):

Two-letter ISO origin country code for landed cost calculation (e.g. 'CN', 'VN', 'MX', 'CA', 'KR', 'IN', 'TW', 'DE').

## `compareCountries` (type: `array`):

Origin country codes to compare side-by-side in multi-country landed cost analysis (e.g. China vs. Vietnam vs. Mexico vs. South Korea).

## `shipmentValueUsd` (type: `number`):

Commercial invoice customs value (FOB value) of the shipment in USD.

## `freightAndInsuranceUsd` (type: `number`):

Estimated international shipping and marine/air cargo insurance cost in USD.

## `transportMode` (type: `string`):

Mode of arrival into the US. Harbor Maintenance Fee (HMF 0.125%) applies only to ocean shipments.

## `additionalTariffPercent` (type: `number`):

Optional override for Section 301 / Section 232 / reciprocal additional duty percentage on the primary countryOfOrigin. Leave blank to auto-estimate by country and HTS chapter.

## `includeChapter99Notes` (type: `boolean`):

Attach related Chapter 99 temporary tariff rules and suspensions returned in the USITC search tree.

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

Maximum number of HTS tariff lines to calculate and return (1–100).

## `outputMode` (type: `string`):

Choose between detailed tariff dataset records or a compact MCP landed-cost summary.

## Actor input object example

```json
{
  "query": "8507.60",
  "countryOfOrigin": "CN",
  "compareCountries": [
    "CN",
    "VN",
    "MX",
    "KR"
  ],
  "shipmentValueUsd": 25000,
  "freightAndInsuranceUsd": 1200,
  "transportMode": "ocean",
  "includeChapter99Notes": true,
  "maxResults": 10,
  "outputMode": "detailed"
}
```

# Actor output Schema

## `summary` (type: `string`):

No description

## `htsItems` (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 = {
    "query": "8507.60",
    "countryOfOrigin": "CN",
    "compareCountries": [
        "CN",
        "VN",
        "MX",
        "KR"
    ],
    "shipmentValueUsd": 25000,
    "freightAndInsuranceUsd": 1200,
    "maxResults": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("ferraz_michel/usitc-hts-tariff-mcp").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": "8507.60",
    "countryOfOrigin": "CN",
    "compareCountries": [
        "CN",
        "VN",
        "MX",
        "KR",
    ],
    "shipmentValueUsd": 25000,
    "freightAndInsuranceUsd": 1200,
    "maxResults": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("ferraz_michel/usitc-hts-tariff-mcp").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": "8507.60",
  "countryOfOrigin": "CN",
  "compareCountries": [
    "CN",
    "VN",
    "MX",
    "KR"
  ],
  "shipmentValueUsd": 25000,
  "freightAndInsuranceUsd": 1200,
  "maxResults": 10
}' |
apify call ferraz_michel/usitc-hts-tariff-mcp --silent --output-dataset

```

## MCP server setup

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

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/k2m3X9Dr7skOSvzTu/builds/xwhvQo9mi9IzuzRX3/openapi.json
