HS classification without the PDF tariff schedules.
The full HS 2022 nomenclature — all 21 sections, all 99 chapters, plus 131 deeper 4-digit headings and 6-digit subheadings — as structured JSON. Look up a code, search by keyword with ranking, and resolve the section → chapter → heading → subheading hierarchy for customs, landed-cost and shipping tools.
curl -H "Authorization: Bearer YOUR_API_KEY" \
"https://almanac.tools/v1/hs-codes/lookup?code=090111"{
"data": {
"code": "090111",
"title": "Coffee: not roasted, not decaffeinated",
"level": "subheading",
"section": "II",
"parent": "0901"
}
}- 21
- WCO sections (I–XXI)
- 99
- Chapters (01–99)
- 131
- Deeper headings & subheadings
- HS 2022
- WCO nomenclature edition
The HS & Tariff Codes API serves the World Customs Organization Harmonized System 2022 nomenclature as structured JSON — the international 6-digit base every country builds its tariff schedule on. It looks up a code, searches the taxonomy by keyword, and resolves the section/chapter hierarchy, so you classify products without parsing PDF tariff schedules.
Built for the awkward middle.
The WCO taxonomy, already parsed
Section titles, chapter titles, and every chapter→section assignment are complete and verbatim from the WCO HS 2022 edition. No scraping the official PDF schedules, no mapping roman-numeral sections by hand — the hierarchy arrives as clean JSON with correct parent linkage on every entry.
Keyword search with real ranking
GET /search matches your query against entry titles and ranks results best-first: an exact whole-word hit ("smartphones") outranks a word-prefix, which outranks a loose substring. Ties break toward shorter, more specific titles. Search "honey", "olive oil" or "lithium battery" and get the right heading at the top.
Dotted codes and hierarchy resolution
Lookup accepts 09.01.11, "0901 11" or 090111 — dots and spaces are normalized away. Every result carries its level (chapter / heading / subheading), its roman-numeral section, and its parent code, so you can walk straight up the tree from a 6-digit subheading to its chapter and section.
Endpoints
Every route takes a Bearer API key. Validation runs before authentication, so a malformed request never costs you a credit.
| GET | /v1/hs-codes/lookup | Look up one HS code (2/4/6-digit, dotted forms accepted). Returns title, level, section and parent. |
| GET | /v1/hs-codes/search | Keyword search over entry titles with relevance ranking. Optional limit (default 25). |
| GET | /v1/hs-codes/sections | List all 21 WCO sections with their chapter membership. |
| GET | /v1/hs-codes/chapters | List all 99 chapters with title and parent section. |
Frequently asked
Is this HS, HTS, or a national tariff code?
This is the international Harmonized System (HS 2022) maintained by the World Customs Organization — the 6-digit base that every country shares. It is not the US HTS, the EU CN, or any other national schedule. Those national systems take the WCO 6-digit code and extend it to 8 or 10 digits (e.g. the US HTS adds digits 7–10 for duty rates). We return the universal 6-digit classification and its hierarchy; you append the national extension your customs authority requires.
How deep does the coverage go?
Sections and chapters are complete: all 21 WCO sections (I–XXI) and all 99 chapters (01–99, with 77 reserved), titled verbatim from the HS 2022 edition. Below that we carry 131 deeper entries — 116 4-digit headings and 15 6-digit subheadings — a representative sample spread across many chapters (coffee, apparel, electronics, vehicles, machinery and more), each with correct parent and section linkage. The dataset is structured so deeper headings extend cleanly chapter by chapter.
Can I pass a dotted code like 09.01.11?
Yes. The lookup endpoint normalizes input before matching — dots and whitespace are stripped, so 09.01.11, "0901 11" and 090111 all resolve to the same subheading. You can hand it codes straight from a tariff document without reformatting. Lookup is exact: a normalized code that is not in the dataset returns a not-found rather than a fuzzy guess.
What is the difference between a section and a chapter?
A section is the top-level grouping, identified by a roman numeral (I–XXI) — for example Section II, "Vegetable products". A chapter is a 2-digit code (01–99) that sits inside a section — chapter 09, "Coffee, tea, maté and spices", belongs to Section II. Headings (4-digit) live inside chapters and subheadings (6-digit) inside headings. GET /sections lists each section with its chapter membership; GET /chapters lists every chapter with its parent section.
How does keyword search work?
GET /search matches your query case-insensitively against entry titles and ranks results best-first: an exact whole-word match outranks a word-prefix match, which outranks a loose substring; within a tier, shorter (more specific) titles sort ahead. It searches descriptions, not code numbers — use /lookup when you already have a code. Pass an optional limit (1–100, default 25) to cap the result set.
Why an API instead of the WCO PDF schedules?
The official HS nomenclature ships as PDF schedules that are painful to parse and easy to get wrong on parent linkage and section assignment. This API gives you the same taxonomy as predictable JSON with a stable code → entry contract — ideal for customs, landed-cost, duty-estimation and shipping tools that need to classify a product or resolve its chapter and section programmatically.
More from the almanac
Business Days & Settlement
Settlement-date and SLA-calendar math for 21 market & regional calendars.
VAT & GST Validation
Offline format + checksum validation for 36 VAT/GST schemes — no dependency on VIES uptime.
Postal Code Validation
Structural postal-code validation for 208 countries — including the 62 that have none.
Start building with HS & Tariff Codes.
One key unlocks every Almanac API. Free tier, no credit card, deterministic results you can pin in a test.