跳到主要内容
Docs/Features/Hs Code

HS Code Lookup & Duty Calculator

An HS-code search that combines AI classification (DeepSeek) with a curated database of duty rates by importing country, so your team stops guessing tariff codes.

![HS Code Tool](/docs-img/hs-code.png)

What It Does

  • Suggests the most likely HS code (6-, 8-, and 10-digit) given a product name, category, and material.
  • Shows duty rates for the importing country with FTA preferences highlighted.
  • Caches results in the tenant database so a repeat lookup costs zero credits.
  • Powers the auto-fill on Trade Documents so quotes ship with codes already populated.
  • When to Use

    Whenever you create a quote/CI for a new product, or when classifying for a country your team hasn't shipped to before.

    Lookup Flow

  • Open **Tools > HS Code**.
  • Type the product name (or paste a description).
  • Pick the importing country.
  • Anvil returns top-3 suggestions with confidence scores, full chapter notes, and the calculated duty.
  • The first lookup is a paid call to ai-engine; subsequent identical queries hit the cache.

    Duty Calculation

    curl https://api.anvilhk.com/api/v1/tools/hs-code/duty \
      -H "Authorization: Bearer $ANVIL_KEY" \
      -H "X-Tenant-ID: $TENANT" \
      -G --data-urlencode "code=8504.40.85" \
         --data-urlencode "to=US" \
         --data-urlencode "value=120000" \
         --data-urlencode "currency=USD"

    Returns MFN rate, applicable Section 301 surcharges (where relevant), and the duty in absolute terms.

    API Endpoints

  • `POST /api/v1/tools/hs-code/lookup` — AI suggestion (consumes 1 AI credit).
  • `GET /api/v1/tools/hs-code/:code` — full chapter notes for a specific code.
  • `GET /api/v1/tools/hs-code/duty?code=&to=&value=&currency=` — duty calculation.
  • Pricing & Limits

    PlanLookups / monthDuty calls / month
    Starter1001,000
    Pro2,000unlimited
    Enterpriseunlimitedunlimited

    Gotchas

  • Duty rates are advisory. Anvil refreshes the database monthly from official sources, but customs authorities have the final say. Always cross-check on a high-value shipment.
  • Some 10-digit codes are country-specific (US Schedule B vs EU CN). Anvil returns the right granularity for the country in the request.
  • AI suggestions can disagree with a freight forwarder; trust the forwarder for the final entry. Anvil's job is to get you to "ballpark" instantly, not to replace a licensed broker.