360 Secure SkillHub
360 安全技能中心

HTS Classifier — US Tariff Code & Duty Lookup

通过 Python 脚本查询 ustariffrates 公共 API,按产品描述或 HTS 编码匹配关税条目,返回基础税率、301/232/IEEPA 附加税与合计估算;可选调用本地 Ollama 对候选结果重排序。查询会发送至外部服务并默认记录日志,结果仅供参考。

inasens
inasens
热度 32.61
最近更新 2026-03-05 07:11:18
分类:搜索依赖:代码执行 / 第三方 API / 内部调用大模型应用场景:研究 / 推荐

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add hts-classifier
Metadata
name
hts-classifier
description
Look up HTS tariff codes and 2026 US duty rates. Use when: user asks about tariff codes, duty rates, HTS classification, import taxes, or trade compliance for any product. NOT for: customs brokerage, filing entries, or legal trade advice. No API key needed.
homepage
https://ustariffrates.com
metadata
{"openclaw":{"emoji":"📦","requires":{"bins":["python3"]}}}

HTS Classifier — US Tariff Code & Duty Rate Lookup

Classify products into HTS codes and get current 2026 US duty rates including Section 301, Section 232, and IEEPA (Section 122) tariffs.

When to Use

USE this skill when:

  • "What's the HTS code for solar panels?"
  • "Tariff rate on steel pipes from China"
  • "Look up duty for HTS 8541.40"
  • "How much import tax on lithium batteries?"
  • "Classify this product for customs"
  • Any question about US import duties or tariff codes

When NOT to Use

DON'T use this skill when:

  • Filing customs entries or ISF → use a customs broker
  • Legal classification disputes → consult a licensed customs broker
  • Export controls / ITAR / EAR → use export compliance tools
  • Tariff engineering or structuring advice → consult trade counsel

Commands

Search by product description

python3 ~/.openclaw/skills/hts-classifier/scripts/classify.py --query "solar panels"

Look up a specific HTS code

python3 ~/.openclaw/skills/hts-classifier/scripts/classify.py --hts "8541.40"

Both at once

python3 ~/.openclaw/skills/hts-classifier/scripts/classify.py --query "photovoltaic cells" --hts "8541.40"

With LLM ranking (optional, slower — uses local Ollama)

python3 ~/.openclaw/skills/hts-classifier/scripts/classify.py --query "solar panels" --rank

Output

Returns JSON with top matching HTS codes including:

  • hts_code — The harmonized tariff code
  • description — Official HTS description
  • base_duty — General (MFN) duty rate
  • section_301_china — Section 301 additional duty (%) for Chinese-origin goods
  • section_232 — Section 232 duty (%) for steel/aluminum
  • section_122 — IEEPA/Section 122 universal tariff (%)
  • total_estimated — Total estimated effective duty rate
  • warnings — Active tariff overlays and special notes
  • trade_data — Import volume data when available

Environment Variables (all optional)

Variable Default Purpose
OLLAMA_URL http://localhost:11434 Local Ollama endpoint for LLM ranking
OLLAMA_MODEL qwen3:8b Ollama model for ranking (must support JSON output)
OLLAMA_TIMEOUT 30 Seconds before ranking times out (falls back to FTS5)
HTS_LOG /tmp/hts-classifier.log Log file path (queries are logged — use /dev/null to disable)
HTS_API_KEY (unset) Cloudflare D1 API token for direct DB fallback — only set if you operate the ustariffrates D1 database

Network Interactions

  • Always: queries ustariffrates.com/api/search (public API, no auth)
  • Optional: calls local Ollama (localhost:11434) when --rank is used
  • Optional: queries Cloudflare D1 only if HTS_API_KEY is explicitly set (disabled by default)

Notes

  • Data is live from ustariffrates.com (2026 HTS schedule)
  • Includes Section 301, 232, and IEEPA (Section 122) tariff overlays
  • Results are informational — always verify with a licensed customs broker for formal entries
  • No API key required for public search
  • Queries are logged to HTS_LOG — set to /dev/null if handling sensitive product descriptions