HTS Code Lookup API for Customs Compliance (2026)
htsapi.dev provides a REST API that classifies products into US HTS codes (to 10 digits when the facts support it) with CBP ruling evidence, Census figures for duty actually collected, and 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 an HTS code, as deep as your facts support, plus the rationale behind it: which GRI rule was applied, which CBP ruling supports the classification, and what duty was collected on past imports. That rationale is your audit trail: a documented record that your classification followed established methodology.
What the API Returns
A single POST to /v1/classify with a product description returns:
- HTS code at the depth your facts support (10 digits when they do), with confidence levels (high, medium, low); when a fact is missing, the options and the question that decides them
- CBP ruling citation when a precedent exists in our copy of the CROSS database (220,000+ rulings)
- Census Bureau effective rate: what importers paid (duty collected divided by dutiable value) in the latest published month, at the 10-digit line when there is enough trade, else the 6-digit subheading (and country); last 3 months shown, 12-month average as a footnote. Past imports, not your shipment's duty
- Rate provision breakdown: what was collected at the MFN rate, under Chapter 99 (Section 301/232), at preferential rates, and what entered free
- Legal notes for the relevant section and chapter
- 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 over 220,000 CBP CROSS rulings: our weekly-refreshed copy of the 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 from the schedule and legal notes using the GRI methodology; the candidate then cites no ruling, which tells you the evidence is thinner. 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 often not what importers actually pay. A code listed as "Free" or "6.5%" can carry much more once Section 301, Section 232, and reciprocal tariffs apply. The API does not compute those additional Chapter 99 duties; GET /v1/hts/{code} gives the base rate, and the Census figures show what was actually paid, Chapter 99 duties included. For Section 301 status, check USITC's China Tariffs list at hts.usitc.gov.
The API returns effective rates from the US Census Bureau, calculated from actual import data (duties collected divided by dutiable value, per country: the latest published month at the 10-digit line when there is enough trade, else the 6-digit subheading, with the last 3 months and a 12-month average). This shows what was actually collected across past entries, not what a specific shipment will be charged.
Rate provision breakdown
Census reports imports by rate provision (RP). The breakdown gives import value, dutiable value, duty collected and the resulting rate for each:
| Provision | Census RP | What it shows |
|---|---|---|
| MFN | 61 | Entries dutiable at the General (MFN) rate |
| Chapter 99 | 69 | Entries dutiable under Chapter 99 (Section 301, Section 232, reciprocal and other additional duties) |
| Preferential | 64 | Entries dutiable at a Special (preferential) rate |
| Free | 10-19 | Entries that came in free: under the general or special column, other legislation, or Chapter 99 (19) |
| Other | 00, 62, 70, 79 | Bonded warehouse/FTZ, Column 2, various or special rates, Chapter 99 with no duty calculated |
Country-specific rates
Pass country_of_origin in your API request for figures from that country. For a product from China, the collected rate can sit well above the MFN statutory rate; the difference is Section 301 and other Chapter 99 duties actually paid 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 classification response includes the rationale, the relevant legal notes, and the CBP ruling relied on when precedent exists. Store these responses as part of your compliance records. When CBP requests documentation during a focused assessment, you have a stored classification with its legal reasoning and cited ruling attached.
Duty calculation
Use the Census Bureau effective rate as historical context for duty budgeting: it shows what was collected on past imports of the subheading from each country. It is an average, not a calculation for a specific shipment. Comparing countries' figures shows how sourcing has played out for other importers.
Catalog processing
Classify a product catalog one call per product (there is no batch endpoint), up to 10 requests per minute per key: each call takes 15-35 seconds, so a 5,000-SKU catalog takes about 30-60 hours of calls sequentially, not weeks. Each result includes the same evidence package (ruling citation, legal notes, Census figures) 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 leads with answer (the code at the depth the facts support, with options and a question when a fact is missing), then candidates, each with hts_code, confidence, rationale, rulings (cited CBP rulings), census_duties (with rate provision breakdown), and legal_notes (section and chapter 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 with a key. HTS code search, ruling search, the optional AD/CVD screen (which can miss real orders; a nil result is not a clearance): 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 Census figures cover imports from that country, with a rate provision breakdown: duty collected at the MFN rate, under Chapter 99 (Section 301, Section 232 and other additional duties), at preferential rates, and imports that entered free. These are historical averages for the 6-digit subheading. The tariff schedule data itself does not include Chapter 99, so the API does not compute the Section 301 duty for a specific shipment.Sources and External References
- USITC Harmonized Tariff Schedule: official U.S. tariff schedule and data API
- CBP CROSS Rulings Database: over 220,000 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