Skip to content

HS Code API

Overview

The HS Code (Harmonized System Code) API provides access to the international commodity classification system maintained by the World Customs Organization (WCO). It includes sections, headings, subheadings, and product descriptions.

Note: This API provides read-only access to HS Code data. Data synchronization is managed internally by scheduled tasks.

Base Endpoint: /api/hs-code

API Endpoints

1. List All Sections

Retrieve all HS Code sections.

Endpoint: GET /api/hs-code/sections

Request:

bash
curl "https://api.alaikis.com/std/api/hs-code/sections" \
  -H "X-API-Key: your_api_key" \
  -H "X-API-Secret: your_api_secret"

Response:

json
{
  "code": 200,
  "msg": "Request successful",
  "data": [
    {
      "id": 1,
      "section": "I",
      "name": "Live animals; animal products"
    },
    {
      "id": 2,
      "section": "II",
      "name": "Vegetable products"
    },
    {
      "id": 3,
      "section": "III",
      "name": "Animal or vegetable fats and oils"
    }
  ]
}

2. Get Section by Code

Retrieve a specific section by its section code.

Endpoint: GET /api/hs-code/sections/{section}

Parameters:

ParameterTypeRequiredDescription
sectionStringYesSection code (e.g., I, II, III)

Request:

bash
curl "https://api.alaikis.com/std/api/hs-code/sections/I" \
  -H "X-API-Key: your_api_key" \
  -H "X-API-Secret: your_api_secret"

3. List HS Codes (Paginated)

Retrieve a paginated list of all HS Code records.

Endpoint: GET /api/hs-code

Parameters:

ParameterTypeRequiredDescription
pageIntegerNoPage number, starting from 0 (default: 0)
sizeIntegerNoPage size (default: 20)

Request:

bash
curl "https://api.alaikis.com/std/api/hs-code?page=0&size=20" \
  -H "X-API-Key: your_api_key" \
  -H "X-API-Secret: your_api_secret"

Response:

json
{
  "code": 200,
  "msg": "Request successful",
  "data": {
    "content": [
      {
        "id": 1,
        "hsCode": "0101",
        "description": "Live horses, asses, mules",
        "parent": "01",
        "level": 2,
        "unit": "kg",
        "type": "base",
        "version": "2022",
        "section": {
          "id": 1,
          "section": "I",
          "name": "Live animals; animal products"
        }
      }
    ],
    "totalElements": 15000,
    "totalPages": 750,
    "number": 0,
    "size": 20
  }
}

4. Search by HS Code

Search records by HS code (exact match).

Endpoint: GET /api/hs-code/code/{hsCode}

Parameters:

ParameterTypeRequiredDescription
hsCodeStringYesHS code (e.g., 0101, 8471)

Request:

bash
curl "https://api.alaikis.com/std/api/hs-code/code/8471" \
  -H "X-API-Key: your_api_key" \
  -H "X-API-Secret: your_api_secret"

5. List HS Codes by Section

Retrieve a paginated list of HS Codes under a specific section.

Endpoint: GET /api/hs-code/section/{section}/codes

Parameters:

ParameterTypeRequiredDescription
sectionStringYesSection code (e.g., I, II)
pageIntegerNoPage number, starting from 0 (default: 0)
sizeIntegerNoPage size (default: 20)

Request:

bash
curl "https://api.alaikis.com/std/api/hs-code/section/I/codes?page=0&size=20" \
  -H "X-API-Key: your_api_key" \
  -H "X-API-Secret: your_api_secret"

6. List HS Codes by Level

Retrieve a paginated list of HS Codes at a specific level.

Endpoint: GET /api/hs-code/level/{level}

Parameters:

ParameterTypeRequiredDescription
levelIntegerYesLevel (2 = chapter, 4 = heading, 6 = subheading)
pageIntegerNoPage number, starting from 0 (default: 0)
sizeIntegerNoPage size (default: 20)

Request:

bash
curl "https://api.alaikis.com/std/api/hs-code/level/2?page=0&size=20" \
  -H "X-API-Key: your_api_key" \
  -H "X-API-Secret: your_api_secret"

Data Model

HsCode Fields

FieldTypeDescription
idIntegerRecord ID
sectionObjectAssociated section
hsCodeStringHS code
descriptionStringProduct description
parentStringParent code
levelIntegerLevel (2=chapter, 4=heading, 6=subheading)
unitStringUnit of measurement
typeStringType (default: base)
versionStringVersion (default: 2022)

HsCodeSections Fields

FieldTypeDescription
idIntegerRecord ID
sectionStringSection code (I-XXI)
nameStringSection name

HS Code Levels

LevelDigitsDescription
22-digitChapter (e.g., 01, 84)
44-digitHeading (e.g., 0101, 8471)
66-digitSubheading (e.g., 010121, 847130)

Sections Reference

SectionDescription
ILive animals; animal products
IIVegetable products
IIIAnimal or vegetable fats and oils
IVPrepared foodstuffs; beverages, spirits and vinegar; tobacco
VMineral products
VIProducts of the chemical or allied industries
VIIPlastics and articles thereof; rubber and articles thereof
VIIIRaw hides and skins; leather; travel goods
IXWood and articles of wood; wood charcoal; cork
XPulp of wood; paper and paperboard
XITextiles and textile articles
XIIFootwear, headgear, umbrellas, walking-sticks
XIIIArticles of stone, plaster, cement, asbestos, mica
XIVNatural or cultured pearls, precious or semi-precious stones, precious metals
XVBase metals and articles of base metal
XVIMachinery and mechanical appliances; electrical equipment
XVIIVehicles, aircraft, vessels
XVIIIOptical, photographic, cinematographic, measuring, checking instruments
XIXArms and ammunition; parts and accessories thereof
XXMiscellaneous manufactured articles
XXIWorks of art, collectors' pieces and antiques

Data Update Frequency

HS Code data is automatically synchronized on a monthly basis. You can check the sync task status via the Scheduler Status API.