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:

One API call, the whole evidence package. The code, the evidence, duty figures, and the legal reasoning: the pieces a compliance team uses to document a classification.

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.

Example: Leather iPhone Case

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.

Example: Rubber Examination Gloves

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:

ProvisionCensus RPWhat it shows
MFN61Entries dutiable at the General (MFN) rate
Chapter 9969Entries dutiable under Chapter 99 (Section 301, Section 232, reciprocal and other additional duties)
Preferential64Entries dutiable at a Special (preferential) rate
Free10-19Entries that came in free: under the general or special column, other legislation, or Chapter 99 (19)
Other00, 62, 70, 79Bonded 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.

Statutory vs. effective. Quoting only the MFN rate to your CFO can badly understate duty on Chinese imports, because Section 301 and other Chapter 99 duties are not in that rate. The Census rate shows what was collected on past imports; for a specific shipment, confirm the Chapter 99 provisions that apply to it.

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.

Python Node.js curl
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

PlanPer ClassificationCost
100 credits$0.10$10
1,000 credits$0.05$50
Volume pricing. At $0.05 per classification, a 5,000-SKU catalog costs $250, roughly the cost of a single hour of customs broker time. Get an API key.

Frequently Asked Questions

Is the API compliant for customs filing?
The API provides classification guidance with CBP ruling citations and GRI rationale. It is not a licensed customs broker and does not file entries on your behalf. Compliance teams use API results as supporting evidence alongside their own review. The ruling citations and legal reasoning are designed to support defensible classifications.
How often is the HTS data updated?
The HTS schedule (current USITC release, Chapters 1-97) and our copy of the CBP CROSS rulings are both refreshed weekly. Census Bureau duty figures are the latest 3 months Census has published, about two months behind, with a 12-month average.
Can I use the API for audit defense?
Yes. Every classification response includes the rationale, the relevant legal notes, and the CBP ruling relied on when precedent exists. Stored with your own review, that is a documented record of how the classification was reached. It is investigatory guidance, not a binding determination.
What is the difference between statutory and effective duty rates?
Statutory rates are published in the HTS schedule (e.g., "Free" or "6.5%"). Effective rates are what importers actually pay after all additional duties (Section 301, Section 232, reciprocal tariffs) and savings (FTA programs, exclusions) are applied. The Census Bureau effective rate is calculated from real import data: duties actually collected divided by dutiable value over the latest 12 months: so it is a historical average across all entries, not the rate a specific shipment will owe.
How does the API handle Section 301 tariffs?
When you pass a 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

Related Guides