2026 customs changesWhat it means

API Reference

HS Code Endpoints
CargoLint REST API.

Search, classify, browse and look up Harmonized System codes, chapter notes and national tariff lines.

HS Code Endpoints

The same classification engine as the in-app Find HS Code dialog, exposed over the API. All endpoints need an API key or a user token.

CargoLint classifies to the six-digit WCO subheading of the HS 2022 edition, over 5,600 subheadings, and completes the code to a destination’s national tariff line where it holds that country’s schedule.

Important: HS code suggestions are decision support. They explain and rank candidates; they do not decide the classification, which rests with the importer and their licensed customs broker.

Classify a description

POST /hs-codes/suggest

The full classification pipeline: retrieval, the WCO section and chapter notes, reranking with a rationale, and the destination’s tariff line.

curl -X POST "https://api.cargolint.com/api/v1/hs-codes/suggest" \
  -H "X-API-Key: cl_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "children'\''s cotton hooded sweatshirts, knitted",
    "destinationCountry": "US",
    "topK": 10
  }'
Field Required Description
query Yes The goods description
destinationCountry No ISO 3166-1 alpha-2 code; adds the destination’s national tariff lines
attributes No Answers about the goods (material, article type and so on), as a map of attribute to value
nationalFacts No Answers to the tariff-line question a previous response asked
mode No auto (default, the full pipeline) or fast (retrieval only)
topK No Number of candidates, default 10

The response carries the ranked suggestions (each with code, description, confidence and reasoning), the selectedCode, a rationale (the General Rule of Interpretation applied, the notes cited, the decisive attributes and the alternatives rejected), hints (the attribute questions worth answering, each with the confidence it could reach), an outcome that says whether CargoLint committed to a code or abstained and why, and for a destination the nationalLines under the top code. fullNationalCode is set only when the destination’s schedule has exactly one line under that code; otherwise nationalMissingFact and nationalMissingOptions ask the one question that would settle it, and you send the answer back in nationalFacts.

When the AI service is unavailable, the response comes from retrieval only, with faissFallback set and the reason in fallbackReason.

GET /hs-codes/search?q={description}&topK={n}

A semantic search over the subheadings, with no language model. q is required; topK is 1 to 20 (default 10). It returns 503 when the classification service is unavailable.

Browse and look up

GET /hs-codes/browse                - chapters, or the children of ?parentCode=, or matches for ?q=
GET /hs-codes/lookup/{code}         - one code with its parent chain (breadcrumb)
GET /hs-codes/versions              - the editions held and their code counts

Codes are written without dots: 61, 6110, 611020. browse pages with page and pageSize (default 50, at most 200) and returns items (each with code, description, level, parentCode, hsVersion and childCount) and totalCount. Both read HS 2022 unless you pass version=HS 2017; the HS 2017 table is kept for reference, and classification uses HS 2022 only.

Notes and national lines

GET /reference/hs-notes?chapter=61          - section and chapter notes (or ?heading=6110, ?section=XI)
GET /reference/hs-national?hs6=611020&country=US

hs-national returns the national tariff line under a six-digit code for a destination whose schedule CargoLint holds, with its fullCode, description, effective dates and source. A member state of the EU returns the EU’s line. A country without a schedule, or a code with no line, returns 404.

What’s next