---
id: "hs_code"
kind: "datatype"
status: "draft"
is_pii: false
categories: ["industry", "shipping"]
langs: ["common"]
quality: 85
url: "http://registry.apicrafter.io/datatype/hs_code"
---

# Harmonized System (HS) code (`hs_code`)

> **Draft.** Draft records have not been reviewed yet and may be incomplete or wrong; do not treat them as authoritative for legal or compliance decisions.

Code of a goods category in the Harmonized Commodity Description and Coding System of the World Customs Organization (WCO), used for customs tariffs and international trade statistics. A chapter has two digits, a heading four and a subheading six. The WCO writes headings as 01.01 and subheadings as 0101.21; trade databases such as UN Comtrade write the same codes without dots (010121). National tariffs add digits to the six-digit subheading, for example the EU Combined Nomenclature (eu_cn_code) and the US HTS (us_hts_number). The WCO publishes the nomenclature in editions such as HS 2022, and the meaning of a code depends on the edition.

- Personal data (PII): no
- Categories: Industry (industry), Shipping and delivery (shipping)
- Countries: global
- Languages: Common to most languages (common)
- Classification: categorical

## Detection

Regular expression (Python `re`):

```
^(?:\d{2}|\d{4}|\d{6}|\d{2}\.\d{2}|\d{4}\.\d{2})$
```

## Examples

- `0101.21` — Subheading as the WCO writes it: horses, pure-bred breeding animals
- `010121` — The same subheading without the dot, as in UN Comtrade
- `01.01` — Heading: live horses, asses, mules and hinnies
- `2203` — Heading: beer made from malt
- `01` — Chapter: live animals
- `01012100` (invalid example) — Eight digits: an EU Combined Nomenclature code
- `0101.2` (invalid example) — Incomplete subheading

## Mappings

- wikidata: `P5471`

## Sources

- wikipedia: <https://en.wikipedia.org/wiki/Harmonized_System>
- doc: <https://www.wcoomd.org/en/topics/nomenclature/overview/what-is-the-harmonized-system.aspx>
- doc: <https://www.wcoomd.org/-/media/wco/public/global/pdf/topics/nomenclature/instruments-and-tools/hs-nomenclature-2022/2022/0101_2022e.pdf>
- other: <https://comtradeapi.un.org/files/v1/app/reference/HS.json>
- wikidata: <https://www.wikidata.org/wiki/Property:P5471>

## Quality

Score 85/100. Missing: translation, detector coverage.

JSON: <http://registry.apicrafter.io/api/v1/datatypes/hs_code.json> · Edit: <https://github.com/apicrafter/metacrafter-registry/edit/main/data/datatypes/any/industry/hs_code.yaml>
