US Import Duty & HTS Lookup
Use this skill when a task needs US import tariff information: classifying goods under the Harmonized Tariff Schedule (HTS), looking up a duty rate, or computing the landed duty for a shipment (including ad-valorem rates plus active surcharges such as Section 301 / Section 232). Data is refreshed from the official USITC HTS release on a 30-minute cron, so rates track the current revision.
Base URL: https://duty-stack.foomworks.workers.dev
When to use
- "What's the duty on imported to the US?"
- "Classify this item under the HTS" / "find the HTS code for "
- "Compute the total duty for $X of from by <ocean|air>"
- "Have the tariff rules for changed recently?"
Free endpoints (no payment)
Use these first to orient — they return a truncated/preview answer at no cost:
GET /hts/lookup/preview?code=<HTS10>— preview of a code's description + base rateGET /duty/preview?code=<HTS10>&origin=<ISO2>&value=<USD>&transport=<ocean|air|truck>— preview duty calcGET /hts/search/preview?q=<keywords>— preview classification searchGET /changes/previewandGET /changes/by-code?code=<HTS>— recent tariff changes (free front door)GET /health— service status (ok, current revision, chapters loaded)
Paid endpoints (x402 — USDC on Base, auto-settled)
These return the full answer. They respond HTTP 402 Payment Required with an x402
challenge; your x402 auto-handler signs a USDC micropayment on Base and retries automatically
(within your configured budget). Prices are small, per-call:
| Endpoint | Price | Returns |
|---|---|---|
GET /hts/lookup?code=<HTS10> |
$0.003 | full classification + duty rate detail |
GET /duty?code=<HTS10>&origin=<ISO2>&value=<USD>&transport=<ocean|air|truck> |
$0.005 | full landed-duty calc incl. surcharges |
GET /hts/search?q=<keywords> |
$0.002 | ranked classification candidates |
GET /changes?since=<ISO8601> |
$0.002 | full tariff-change diff |
If you do not have an x402 wallet/handler configured, fall back to the free */preview
and /changes/by-code endpoints above — they answer most orientation questions.
Workflow
- Normalize inputs: HTS codes are 10 digits (dotted
0101.21.00.10or undotted0101210010both accepted);originis an ISO-3166 alpha-2 country code;valueis the customs value in USD;transportis one ofocean|air|truck. - If you only have a product description, call
GET /hts/search/preview?q=(free) orGET /hts/search?q=(paid, ranked) to find candidate codes, then confirm with the user. - For a rate only, call
GET /hts/lookup?code=. For a full landed cost, callGET /duty?.... - Report the rate(s) and any surcharge lines the response includes (Section 301/232 etc.),
plus the HTS revision the answer is based on (see
/health).
Notes
- This is reference tooling, not legal/customs advice — flag that final classification and entry filing are the importer's/broker's responsibility.
- The service holds no keys and never initiates payments; all payment is buyer-side via x402.
Example
BASE=https://duty-stack.foomworks.workers.dev
# Free preview first
curl -s "$BASE/duty/preview?code=2825.20.00.00&origin=CN&value=10000&transport=ocean"
# Full calc (x402 handler settles the 402 automatically)
curl -s "$BASE/duty?code=2825.20.00.00&origin=CN&value=10000&transport=ocean"
