Helenis API
Start for free

API reference

HS Code Classifier API

Product description, page or photo to its HS code, with confidence, US HTS duty and EU CN line.

Host
hs-code-classifier-ai-customs-tariff-lookup.p.rapidapi.com
Base path
/v1/hs-codes
Auth
X-RapidAPI-Key, X-RapidAPI-Host
For agents
openapi.json · hs-codes.md

Classification

Product to HS code with AI, checked against the nomenclature.

Classify Product

POST /v1/hs-codes/classify

Product description, page or photo to its HS code. Classify a product into its 6-digit HS 2022 code from a description, page `url` or photo `image_url`: up to 3 real codes with confidence, reasoning and official texts; with `country`, the US HTS line (duty rate) or EU CN line. An aid, to confirm with a broker. 10 credits.

Parameters of Classify Product
ParameterInTypeDescription
description body string What the product is, in any language: a title, a catalogue line or a full description. Required unless `url` or `image_url` is given.
material body string Material or composition, e.g. '60% cotton, 40% polyester'.
use body string Function or intended use, e.g. 'for passenger cars'.
url body string A product page to read (title, description, specifications).
image_url body string A photo of the product: PNG, JPEG, WEBP, HEIC, GIF, BMP or TIFF, up to 10 MB.
country body "US" | "EU" Also pick the national tariff line: `US` (HTS, 10 digits, with the general duty rate) or `EU` (Combined Nomenclature, 8 digits).
max_results body integer HsCandidate codes to return, best first (1-3). Default 3.
curl -X POST "https://hs-code-classifier-ai-customs-tariff-lookup.p.rapidapi.com/v1/hs-codes/classify" \
  -H "X-RapidAPI-Key: YOUR_API_KEY" \
  -H "X-RapidAPI-Host: hs-code-classifier-ai-customs-tariff-lookup.p.rapidapi.com" \
  -H "Content-Type: application/json" \
  -d '{
    "description": "Men'\''s short-sleeve crew-neck T-shirt, 100% cotton jersey",
    "country": "US"
  }'

Classify Product from Image

POST /v1/hs-codes/classify/upload

Uploaded product photo (plus optional text) to its HS code. Same as /classify, for a photo sent as multipart/form-data (field `file`), with the same optional text fields. 10 credits.

Parameters of Classify Product from Image
ParameterInTypeDescription
file required form file Product photo, up to 10 MB.
description form string What the product is (optional).
material form string Material or composition, e.g. '60% cotton, 40% polyester'.
use form string Function or intended use, e.g. 'for passenger cars'.
country form "US" | "EU" Also pick the national tariff line: `US` (HTS, 10 digits, with the general duty rate) or `EU` (Combined Nomenclature, 8 digits).
max_results form integer Candidate codes to return, best first (1-3). Default 3.
curl -X POST "https://hs-code-classifier-ai-customs-tariff-lookup.p.rapidapi.com/v1/hs-codes/classify/upload" \
  -H "X-RapidAPI-Key: YOUR_API_KEY" \
  -H "X-RapidAPI-Host: hs-code-classifier-ai-customs-tariff-lookup.p.rapidapi.com" \
  -F "file=@./my-file"

Lookup

HS codes, their hierarchy and national lines, and keyword search. No AI.

Get HS Code

GET /v1/hs-codes/code

An HS code with its hierarchy, children and national lines. Check that an HS 2022 code exists and get its official texts up the hierarchy, the codes under it and, with `country`, the US HTS or EU CN lines. 404 `code_not_found` when it does not exist (not billed). 1 credit.

Parameters of Get HS Code
ParameterInTypeDescription
code required query string 2, 4, 6, 8 or 10 digits; dots and spaces are ignored.
country query "US" | "EU" Also list the national lines under the code: `US` (HTS with general duty rates) or `EU` (CN). Required for 8 and 10-digit codes.
curl -G "https://hs-code-classifier-ai-customs-tariff-lookup.p.rapidapi.com/v1/hs-codes/code" \
  --data-urlencode "code=6109.10" \
  --data-urlencode "country=US" \
  -H "X-RapidAPI-Key: YOUR_API_KEY" \
  -H "X-RapidAPI-Host: hs-code-classifier-ai-customs-tariff-lookup.p.rapidapi.com"

Search HS Codes

GET /v1/hs-codes/search

Keywords to matching HS subheadings, no AI. 6-digit subheadings whose official texts match the keywords, ranked by relevance, with their chapter and heading. Instant and deterministic; use /classify when the wording of the product differs from the tariff's. 1 credit.

Parameters of Search HS Codes
ParameterInTypeDescription
q required query string Words describing the goods, in English.
limit query integer Results, 1-25. Default 10.
curl -G "https://hs-code-classifier-ai-customs-tariff-lookup.p.rapidapi.com/v1/hs-codes/search" \
  --data-urlencode "q=cotton t-shirt" \
  -H "X-RapidAPI-Key: YOUR_API_KEY" \
  -H "X-RapidAPI-Host: hs-code-classifier-ai-customs-tariff-lookup.p.rapidapi.com"

Response

{
  "product": "A men's short-sleeve crew-neck T-shirt made of 100% cotton jersey knit fabric.",
  "hs_code": "610910",
  "results": [
    {
      "hs_code": "610910",
      "formatted": "6109.10",
      "section": { "code": "XI", "description": "Textiles and textile articles" },
      "chapter": { "code": "61", "description": "Apparel and clothing accessories; knitted or crocheted" },
      "heading": { "code": "6109", "description": "T-shirts, singlets and other vests; knitted or crocheted" },
      "subheading": { "code": "610910", "description": "T-shirts, singlets and other vests; of cotton, knitted or crocheted" },
      "confidence": 1.0,
      "reasoning": "The product is a knitted T-shirt made of cotton, which is specifically provided for in heading 6109 under GIR 1 and 6.",
      "national": {
        "country": "US",
        "code": "6109100012",
        "formatted": "6109.10.00.12",
        "description": "Of cotton › Men's or boys' › Other T-shirts › Men's (338)",
        "general_duty": "16.5%",
        "units": ["doz.", "kg"]
      }
    }
  ],
  "to_confirm": [],
  "inputs": ["description"],
  "edition": "HS 2022",
  "disclaimer": "Classification aid, not a binding ruling: have the code confirmed by a licensed customs broker before you declare goods."
}

From a real response. When the description leaves room for doubt, you get up to 3 candidates and the facts to check, for example a power bank: 8507.60 (lithium-ion accumulators, 0.95) then 8504.40 (static converters).

Why developers pick this API

  • 💸 Priced for whole catalogues: about $0.008 per classification on PRO, where HS code APIs charge $0.03 to $0.10 and Zonos Classify $0.011 to $0.05. Lookups and searches cost a tenth of that, and failed calls use 0 credits.
  • ✅ No invented codes: a language model alone happily returns codes that do not exist. Here every code is validated against the nomenclature and comes with its official texts.
  • 🎯 Measured, not promised: 106 of 108 test products classified exactly at 6 digits on the first answer (98%), all 108 within the top 3 (textiles, electronics, food, chemicals, auto parts, toys, marketplace titles, rule-driven cases).
  • 🇺🇸🇪🇺 National codes included: HTS line with duty rate or CN line in the same call, where others stop at 6 digits.
  • 🧾 Explainable: the reasoning and the facts to confirm make the answer easy to review by your broker.

From a product page or a photo

{ "url": "https://www.allbirds.com/products/womens-runner-nz-slip-on-light-grey", "country": "EU" }
{ "image_url": "https://example.com/photos/kettle.jpg", "material": "stainless steel" }

The page is read like a browser would (title, product data, description); a photo is looked at by a vision model. To send a file, use /classify/upload with multipart field file and the same optional fields.

Errors

Status code Meaning
400 missing_input No description, url or image_url.
400 not_classifiable Not physical goods (a service, gibberish) or too vague ("parts"). Not billed.
400 page_empty The page has no readable text without JavaScript: send its description instead.
400 unsupported_file The image is not PNG, JPEG, WEBP, HEIC, GIF, BMP or TIFF, or is over 10 MB.
400 invalid_code / country_required A code has 2 to 10 digits; 8 and 10-digit codes need country.
404 code_not_found The code is not in the nomenclature. Not billed.
429 daily_limit_reached Daily safety limit of your plan; resets at 00:00 UTC.
503 ai_error / source_unavailable The AI or the USITC did not answer; retry. Not billed.

Honest limits

  • Material and make decide many codes. "Jeans" alone cannot tell cotton from synthetic: give material and use, or read to_confirm.
  • Sets, parts and multi-function goods are where classification is hardest; expect a lower confidence and 2-3 candidates.
  • No legal notes: the WCO Explanatory Notes and binding rulings are not included; the model applies the Interpretative Rules from its training.
  • EU duty rates (TARIC) are not included, only the CN code.

Use it from an AI agent

Add this MCP server and the HS Code Classifier - Bulk Product to HS, HTS & CN Codes actor becomes a tool your agent can call. Works in Claude, Cursor, VS Code and any MCP client; billed per event through Apify.

MCP server URL
https://mcp.apify.com?tools=helenisapi/hs-code-classifier

Prefer plain HTTP? Give your agent the OpenAPI document or the Markdown reference.

See the plans Error handling