HTS Code Lookup API for Customs Compliance (2026)
htsapi.dev provides a REST API that classifies products into 10-digit US HTS codes with CBP ruling evidence, Census effective duty rates, and GRI legal notes — built for compliance teams who need defensible classifications.
Last updated: April 2026
Why Customs Compliance Teams Need an HTS API
Manual HTS classification does not scale. A compliance team handling 500 SKUs spends weeks researching codes, cross-referencing USITC schedules, and verifying rulings. When product catalogs grow to thousands of items or new tariff provisions change overnight, spreadsheet-based processes break.
Misclassification is expensive. CBP can assess penalties up to four times the duty owed for negligent classification errors. Intentional misclassification triggers fraud penalties with no statutory cap. In FY2025, CBP recovered $192.77M through focused assessments and audits.
An API solves both problems. Every classification call returns a 10-digit HTS code plus the rationale behind it: which GRI rule was applied, which CBP ruling supports the classification, and what the effective duty rate is. That rationale is your audit trail — a documented, reproducible record that your classification followed established methodology.
What the API Returns
A single POST to /v1/classify with a product description returns:
- 10-digit HTS code with confidence level (high, medium, low)
- CBP ruling citation when a precedent exists in the 134,050-ruling CROSS database
- Census Bureau effective duty rate — the actual percentage importers paid, calculated from real import data
- Rate provision breakdown — MFN base, Section 301/232 surcharges, FTA program savings, exclusions
- GRI legal notes for the relevant chapter and heading
- Clarification question when the product description is ambiguous (e.g., "what is the material of the outer shell?")
CBP Ruling Evidence — Not Just a Code
The API indexes 134,050 CBP CROSS rulings — the full history of classification decisions published by U.S. Customs and Border Protection. Before the LLM classifies a product, it searches this database for precedent.
This matters because a CBP ruling is the strongest evidence available for how customs classifies a specific product. It is not legally binding on other importers, but it shows how a government agency actually decided the question for a substantially similar product.
Input: "leather case for iPhone 15, exterior genuine cowhide"
The API identifies heading 4202 ("trunks, suitcases, vanity cases ... and similar containers") via GRI 1 — the heading terms explicitly cover cases with an outer surface of leather. Result: 4202.31.6000.
Input: "nitrile rubber examination gloves, powder-free, non-sterile"
The API finds ruling N342078, which classified substantially similar nitrile gloves under 4015.19.1110. The ruling provides an exact match — same material, same use, same subheading.
When no ruling exists for a product, the API still classifies using the GRI methodology and notes that no precedent was found. Transparency about evidence strength is part of the compliance value.
Census Bureau Effective Duty Rates
The statutory duty rate published in the HTS schedule is not what importers actually pay. A code listed as "Free" or "6.5%" may carry 30%+ in real duties once Section 301, Section 232, and reciprocal tariffs are applied.
The API returns effective duty rates from the US Census Bureau — calculated from actual import data (duties collected divided by customs value). This shows what CBP actually charged at the port, not what the schedule says in theory.
Rate provision breakdown
Each effective rate is decomposed into its component provisions:
| Provision | Description | Example Rate |
|---|---|---|
| MFN base | Standard duty rate for WTO members | 8.0% |
| Section 301 | Additional tariff on Chinese goods (Lists 1-4) | +25.0% |
| Section 232 | Steel/aluminum national security tariffs | +25.0% |
| Reciprocal | Country-specific reciprocal tariffs | varies |
| FTA programs | Preferential rates under trade agreements | -8.0% |
| Exclusions | Product-specific tariff exemptions | -25.0% |
Country-specific rates
Pass country_of_origin in your API request for targeted rates. For example, a cotton t-shirt (6109.10) imported from China shows a 42.7% effective rate versus the 8% MFN statutory rate — the difference is Section 301 List 4a surcharges plus reciprocal tariffs stacked on top of the base duty.
Compliance Workflow Integration
The API fits into four stages of a compliance workflow:
Pre-classification
Screen products before customs filing. Run new SKUs through the API during product onboarding to flag duty exposure, identify potential Section 301 impacts, and catch classification issues before they become CBP audit findings.
Audit defense
Every API response includes the classification rationale, GRI rule applied, and CBP ruling citation. Store these responses as part of your compliance records. When CBP requests documentation during a focused assessment, you have a timestamped, reproducible classification with legal reasoning attached.
Duty calculation
Combine the HTS code with the Census Bureau effective duty rate for accurate landed cost estimates. The rate provision breakdown lets you model scenarios: what happens if a Section 301 exclusion expires, or if you shift sourcing to an FTA-eligible country.
Batch processing
Classify an entire product catalog via API. A 5,000-SKU catalog processes in hours, not weeks. Each result includes the same evidence package — ruling citation, GRI notes, effective rate — that a manual classification would require.
API Quick Start
Three ways to call the API. All return JSON with the HTS code, confidence level, ruling evidence, and duty rates.
import requests
r = requests.post("https://htsapi.dev/v1/classify",
headers={"X-API-Key": "YOUR_KEY"},
json={"description": "stainless steel water bottle",
"country_of_origin": "China"})
print(r.json())
The response includes hts_code, confidence, rationale, rulings (cited CBP rulings), census_duties (with rate provision breakdown), and legal_notes (Section/Chapter/Heading GRI notes). See the developer guide for the full response schema.
Pricing for Compliance Teams
| Plan | Per Classification | Cost |
|---|---|---|
| 100 credits | $0.10 | $10 |
| 1,000 credits | $0.05 | $50 |
- Credits never expire. Buy once, use over months or years.
- No subscription. No monthly fees, no auto-renewal.
- Supporting endpoints are free. HTS code search, ruling search, tariff screening — no credit cost. Only
/classifyconsumes credits. - Free web demo. Test the API at htsapi.dev with no API key required.
Frequently Asked Questions
country_of_origin parameter, the API returns a full rate provision breakdown including Section 301 surcharges, Section 232 duties, reciprocal tariffs, FTA savings, and exclusions. For Chinese imports, this shows the combined effective rate (e.g., 42.7% effective vs 8% MFN base) with each provision identified by code and label.Sources and External References
- USITC Harmonized Tariff Schedule — official U.S. tariff schedule and data API
- CBP CROSS Rulings Database — 134,050+ classification rulings
- US Census Bureau International Trade API — import statistics and duty data
- World Customs Organization (WCO) — Harmonized System nomenclature
- Trade.gov — HS Codes — U.S. Department of Commerce trade resources