REST API · v1

TariffClassify API

Pipe HTS classification, tariff overlay, and landed cost into your ERP, PIM, broker workflow, or custom application. Bearer-token auth. JSON in, JSON out. Pro and Business subscription plans only.

Authentication

Every request must include a bearer token in the Authorization header. Generate a key from Account → API Keys. Keys are shown once at creation — copy them immediately. Only the SHA-256 hash is stored server-side.

curl https://tariffclassify.ai/api/v1/hts/lookup?code=8471.30 \
  -H "Authorization: Bearer tc_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

Quotas and pricing

  • Pro: 500 classifications per billing period, $100/mo
  • Business: 2,500 classifications per billing period, $250/mo
  • The classification endpoint (POST /api/v1/classify) consumes one unit of your monthly cap. UI classifications and API classifications share the same cap.
  • /hts/lookup, /hts/duties, and /landed-costare zero-cost reads — they don't count against your cap.
  • Hitting your cap returns HTTP 402 with code monthly_cap_reached.

Endpoints

POST/api/v1/classify

Start an AI HTS classification job. Returns 202 with a session_id immediately; poll the result endpoint until status=COMPLETE. Typical completion: 15–45 seconds depending on description detail. Counts one unit against your monthly cap.

Request body

{
  "product_description": "Men's cotton t-shirt, knitted, short sleeve, 100% cotton",
  "country_of_origin": "VN"
}

Response

HTTP 202 Accepted

{
  "session_id": "3f5e8a30-1234-5678-9abc-def012345678",
  "status": "PENDING",
  "poll_url": "/api/v1/classify/3f5e8a30-1234-5678-9abc-def012345678"
}
GET/api/v1/classify/{session_id}

Poll for classification status. While the classifier is running, status will be PENDING, CLARIFYING, or PROCESSING. Poll every 2-3 seconds. When status becomes COMPLETE or FAILED, the job is done.

Response

{
  "session_id": "3f5e8a30-1234-5678-9abc-def012345678",
  "status": "COMPLETE",
  "country_of_origin": "VN",
  "created_at": "2026-05-15T18:42:11.000Z",
  "completed_at": "2026-05-15T18:42:38.000Z",
  "result": {
    "hts_code": "6109.10.0012",
    "confidence": 0.94,
    "reasoning": "Knitted cotton t-shirts for men classify under 6109.10 ...",
    "alternatives": [ /* ... */ ],
    "notes": null
  }
}
GET/api/v1/hts/lookup?code={code}

Look up an HTS code in the 2026 HTSUS. Accepts 2–10 digits with or without dots. Returns the official description, general (MFN) duty rate, units of quantity, and HS chapter/heading/subheading breakdown.

Response

{
  "htsno": "6109.10.0012",
  "description": "Men's or boys' T-shirts, knitted ...",
  "general": "16.5%",
  "special": "Free (AU,BH,CA,CL,CO,IL,JO,KR,MA,MX,OM,P,PA,PE,S,SG)",
  "units": ["doz.", "kg"]
}
GET/api/v1/hts/duties?hts={hts}&coo={ISO}

Returns Section 301, IEEPA, and AD/CVD duty overlays applicable to the HTS code and country of origin via longest-prefix match (10→8→6→4→2 digit fallback). Country-specific rows override global rows.

Response

{
  "hts": "6109100012",
  "country_of_origin": "CN",
  "duties": [
    {
      "program": "Section 301 List 4A",
      "rateNotes": "7.5% additional ad valorem",
      "additionalRate": 7.5,
      "sourceUrl": "https://ustr.gov/..."
    },
    {
      "program": "IEEPA China",
      "rateNotes": "Reciprocal country tariff",
      "additionalRate": 10.0,
      "sourceUrl": "https://..."
    }
  ]
}
GET/api/v1/hts/pga-flags?hts={hts}

Returns Partner Government Agency (FDA, USDA, EPA, FCC, ATF, DOT) requirements that attach to the HTS code via longest-prefix match. Country-agnostic. Use this to surface regulatory filing requirements alongside customs duty calculations.

Response

{
  "hts": "3304",
  "flags": [
    {
      "agency": "FDA",
      "description": "FDA jurisdiction: beauty and skincare cosmetics. Subject to MoCRA registration.",
      "source_url": "https://www.fda.gov/cosmetics/..."
    }
  ]
}
GET/api/v1/hts/rulings?hts={hts}&limit={n}

Returns CBP CROSS binding rulings whose tariff lines share a prefix with the supplied HTS code, sorted by ruling date (newest first). Useful for defending a classification against CF-28 challenges or audits — every ruling links directly to CBP's published ruling text. `limit` defaults to 5, max 20. Always includes a `cross_search_url` deep link for users to explore the full CROSS database.

Response

{
  "hts": "8471300100",
  "rulings": [
    {
      "rulingNumber": "N304566",
      "htsCode": "8471300100",
      "subject": "The tariff classification of a portable laptop computer from China",
      "rulingDate": "2019-06-21",
      "collection": "ny",
      "url": "https://rulings.cbp.gov/ruling/N304566"
    },
    /* ... up to limit ... */
  ],
  "cross_search_url": "https://rulings.cbp.gov/search?term=847130&category=Classification"
}
POST/api/v1/landed-cost

Compute the full landed cost stack: base customs duty + Section 301 / IEEPA / AD-CVD overlays + MPF (0.3464%, $29.66 floor, $575.35 cap; USMCA exempt) + HMF (0.125%, ocean only). Pass base_duty_rate as a string from /hts/lookup (e.g. "16.5%") to include base duty; omit it to treat as Free.

Request body

{
  "hts_code": "6109100012",
  "country_of_origin": "CN",
  "shipment_value_usd": 50000,
  "base_duty_rate": "16.5%",
  "transport_mode": "ocean",
  "quantity": 1000
}

Response

{
  "hts_code": "6109100012",
  "country_of_origin": "CN",
  "shipment_value_usd": 50000,
  "transport_mode": "ocean",
  "quantity": 1000,
  "base_duty": {
    "rate_string": "16.5%",
    "rate_percent": 16.5,
    "amount_usd": 8250
  },
  "additional_duties": [ /* Section 301, IEEPA, ... */ ],
  "mpf": {
    "rate_percent": 0.3464,
    "floor_usd": 29.66,
    "cap_usd": 575.35,
    "usmca_exempt": false,
    "amount_usd": 173.20
  },
  "hmf": {
    "rate_percent": 0.125,
    "applies": true,
    "amount_usd": 62.50
  },
  "total_duty_usd": 12235.70,
  "landed_cost_usd": 62235.70,
  "per_unit_landed_cost_usd": 62.24,
  "de_minimis": {
    "status": "INELIGIBLE",
    "threshold_usd": 800,
    "reason": "Shipment value exceeds the $800 Section 321 de minimis threshold."
  },
  "pga_flags": []
}

Errors

All errors follow the same shape:

{ "error": { "code": "invalid_request", "message": "Human-readable description" } }
codeStatusMeaning
missing_authorization401No bearer token in Authorization header
invalid_api_key401Token is invalid or revoked
subscription_required403No active Pro or Business subscription
tier_insufficient403Starter plan does not include API access
invalid_request400Request body or query params malformed
invalid_hts400HTS code is not 1–10 digits
invalid_coo400Country code is not 2-letter ISO
not_found404HTS code or classification not found
forbidden403Resource belongs to another account
monthly_cap_reached402Subscription cap exhausted for the current billing period
classifier_unavailable503Classifier service is temporarily unavailable

End-to-end example

Classify a product, poll until complete, then compute landed cost using the returned HTS code:

# 1. Start classification
SESSION=$(curl -s https://tariffclassify.ai/api/v1/classify \
  -H "Authorization: Bearer $TC_KEY" \
  -H "Content-Type: application/json" \
  -d '{"product_description":"Men cotton t-shirt knit","country_of_origin":"VN"}' \
  | jq -r .session_id)

# 2. Poll until COMPLETE
while [ "$(curl -s https://tariffclassify.ai/api/v1/classify/$SESSION \
  -H "Authorization: Bearer $TC_KEY" | jq -r .status)" != "COMPLETE" ]; do sleep 2; done

# 3. Read the HTS code from the result
HTS=$(curl -s https://tariffclassify.ai/api/v1/classify/$SESSION \
  -H "Authorization: Bearer $TC_KEY" | jq -r .result.hts_code)

# 4. Compute landed cost
curl -s https://tariffclassify.ai/api/v1/landed-cost \
  -H "Authorization: Bearer $TC_KEY" \
  -H "Content-Type: application/json" \
  -d "{\"hts_code\":\"$HTS\",\"country_of_origin\":\"VN\",\"shipment_value_usd\":50000,\"transport_mode\":\"ocean\"}"

Ready to integrate?

Subscribe to Pro or Business, generate an API key, and start sending requests.

Get an API key