apyhub
Back
▣ RETRIEVAL KIT · VERIFICATION KIT

HS Code & Import Duty Lookup API

What it does

The HS Code API returns HS and commodity code data for customs work. Send product words, a code, or mixed lookups in the request body. Use q for search mode, code for one code, mode for the lookup type, market for UK or EU, and origin for the country code when you need origin duty.

You get back ranked matches, one code's details, or validation rows. Search mode returns likely codes from English product words like cotton t-shirt. Code mode shows tariff data, UK VAT, declarable status, and the duty for the origin you pass. Bulk mode lets you mix up to 50 queries in one call.

Teams use the HS Code API to classify goods before shipping. They use it to check duty cost in import tools and to confirm which codes can go on a customs declaration.

To check money values after duty work, use the Currency Converter API. To confirm country codes in import forms, use the Countries Dictionary API.

POST
HS Code Lookup API - Tariff, Duty Rates, Commodity Codes
https://api.eu.apyhub.com/martin10291/hs-code-import-duty-lookup

QUICKSTART

GUIDE

Quickstart

Look up HS codes by keyword with the default search mode.

curl -X POST "https://api.eu.apyhub.com/martin10291/hs-code-import-duty-lookup" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"mode":"search","q":"cotton t-shirt","limit":10}'

What you'll get back

Returns a JSON object with billed and count integers, plus an items array of result objects. Each item can include fields such as q, hs4, hs6, code, chain, level, score, market, tariff, declarable, and other mode-specific fields.

{
  "billed": 1,
  "count": 1,
  "items": [
    {
      "q": "cotton t-shirt",
      "hs6": "610910",
      "code": "6109100000",
      "level": "commodity",
      "score": 98,
      "market": "UK",
      "declarable": true
    }
  ]
}
TRY ITLIVE · 100 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
body
search mode: product words in English, e.g. cotton t-shirt, lithium battery, roasted coffee.
code mode: HS / commodity code with 2, 4, 6, 8 or 10 digits; dots and spaces are ignored, e.g. 6109.10 or 6109100010.
search = keyword to ranked HS/commodity codes; code = full details of one code (duty, VAT, origin rate, measures, or declarable children); validate = check that codes exist and are declarable; bulk = up to 50 queries in one call.

About this endpoint

What it does

Looks up HS / commodity code information from one of four modes: keyword search, direct code lookup, code validation, or bulk mixed queries. The request body controls the mode and related filters such as market, origin, and lookup values, and the response returns billing info plus a list of matched rows.

Request Body

ParameterTypeMandatoryDescription
qStringNoSearch mode only: product words in English, such as cotton t-shirt, lithium battery, or roasted coffee.
codeStringNoCode mode only: HS / commodity code with 2, 4, 6, 8, or 10 digits. Dots and spaces are ignored.
modeENUMNoLookup mode. Allowed values: search, code, validate, bulk.
codesString ArrayNoValidate mode only: up to 100 codes.
limitIntegerNoSearch mode only. Minimum 1, maximum 100, default 20. The description also notes search mode uses 1-50 and default 10.
marketENUMNoMarket selector. Allowed values: UK, EU. UK is the default; EU uses the EU Common Customs Tariff as published by the UK Trade Tariff Northern Ireland (XI) service.
originStringNoISO 2-letter country of origin, such as CN, VN, or US. In code mode, this returns the preferential rate and the duty that applies to this origin.
queriesString ArrayNoBulk mode only: up to 100 items. The description says bulk mode supports up to 50 objects, each one an input of another mode; failing queries return an error row while the others still answer.

Response

Returns a JSON object with billed and count integer fields, plus an items array of objects. billed is the number of charged result rows, count is the number of rows in items, and each items[] entry may include lookup, classification, duty, and validation fields.

ParameterTypeMandatoryDescription
billedIntegerNoUnits charged for this call: result rows only; not-found, unavailable, and invalid rows are free.
countIntegerNoNumber of rows in items.
itemsObject ArrayNoArray of result rows. Each row can include: q, hs4, hs6, url, vat, code, chain, error, level, score, market, source, tariff, children, fetchedAt, matchType, declarable, originDuty, description, matchedTerm, preferentialDuty, thirdCountryDuty, and declarableChildren.
▣ COMMON ERRORS

Errors any endpoint can return

400bad_request

Required parameter missing or malformed body.

401unauthorized

API key missing, revoked, or not authorized for this service.

429rate_limited

Your plan's per-second rate exceeded. Retry with exponential backoff.

503upstream_busy

Backend temporarily unavailable. Try again in a few seconds.