{"openapi":"3.1.0","info":{"title":"HS Code Classifier - AI Customs Tariff Lookup","description":"Product description, page or photo to its 6-digit HS code with confidence and reasoning, plus US HTS and EU CN lines; code lookup and search.","version":"v1"},"servers":[{"url":"https://hs-code-classifier-ai-customs-tariff-lookup.p.rapidapi.com","description":"RapidAPI"}],"paths":{"/v1/hs-codes/classify":{"post":{"tags":["Classification"],"summary":"Product description, page or photo to its HS code","description":"Classify a product into its 6-digit HS 2022 code from a description,\npage `url` or photo `image_url`: up to 3 real codes with confidence,\nreasoning and official texts; with `country`, the US HTS line (duty rate)\nor EU CN line. An aid, to confirm with a broker. 10 credits.","operationId":"classifyProduct","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HsClassifyRequest"},"examples":{"Classify Product":{"summary":"Classify Product","value":{"description":"Men's short-sleeve crew-neck T-shirt, 100% cotton jersey","material":"100% cotton, knitted jersey","country":"US","max_results":3}}}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HsClassifyResponse"},"examples":{"Classify Product":{"summary":"Classify Product (real response)","value":{"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."}}}}}},"400":{"description":"Invalid input, or the target could not be processed (see `error.code`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing proxy secret (call through RapidAPI with your key).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Invalid proxy secret.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Daily limit of your plan reached.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"The AI provider failed (`ai_error`) or capacity is temporarily exhausted (`capacity_exhausted`); retry. Not billed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"x-rapidapi-endpoint":"Classify Product"}},"/v1/hs-codes/classify/upload":{"post":{"tags":["Classification"],"summary":"Uploaded product photo (plus optional text) to its HS code","description":"Same as /classify, for a photo sent as multipart/form-data (field\n`file`), with the same optional text fields. 10 credits.","operationId":"classifyProductFromImage","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_Classify_Product_from_Image"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HsClassifyResponse"},"examples":{"Classify Product from Image":{"summary":"Classify Product from Image","value":{"product":"Men's short-sleeved T-shirt of 100% cotton knitted jersey.","hs_code":"610910","results":[{"hs_code":"610910","formatted":"6109.10","section":{"code":"6109","description":"T-shirts, singlets and other vests; knitted or crocheted"},"chapter":{"code":"6109","description":"T-shirts, singlets and other vests; knitted or crocheted"},"heading":{"code":"6109","description":"T-shirts, singlets and other vests; knitted or crocheted"},"subheading":{"code":"6109","description":"T-shirts, singlets and other vests; knitted or crocheted"},"confidence":0.95,"reasoning":"A knitted cotton T-shirt: heading 6109, cotton subheading.","national":{"country":"US","code":"6109100012","formatted":"6109.10.00.12","description":"Of cotton › T-shirts, all white... > Men's (338)","general_duty":"16.5%","units":["doz.","kg"]}}],"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."}}}}}},"400":{"description":"Invalid input, or the target could not be processed (see `error.code`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing proxy secret (call through RapidAPI with your key).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Invalid proxy secret.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Daily limit of your plan reached.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"The AI provider failed (`ai_error`) or capacity is temporarily exhausted (`capacity_exhausted`); retry. Not billed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"x-rapidapi-endpoint":"Classify Product from Image"}},"/v1/hs-codes/code":{"get":{"tags":["Lookup"],"summary":"An HS code with its hierarchy, children and national lines","description":"Check that an HS 2022 code exists and get its official texts up the\nhierarchy, the codes under it and, with `country`, the US HTS or EU CN\nlines. 404 `code_not_found` when it does not exist (not billed). 1\ncredit.","operationId":"getHsCode","parameters":[{"name":"code","in":"query","required":true,"schema":{"type":"string","maxLength":20,"description":"2, 4, 6, 8 or 10 digits; dots and spaces are ignored.","examples":["6109.10"],"title":"Code"},"description":"2, 4, 6, 8 or 10 digits; dots and spaces are ignored."},{"name":"country","in":"query","required":false,"schema":{"enum":["US","EU"],"type":"string","description":"Also list the national lines under the code: `US` (HTS with general duty rates) or `EU` (CN). Required for 8 and 10-digit codes.","examples":["US"],"title":"Country"},"description":"Also list the national lines under the code: `US` (HTS with general duty rates) or `EU` (CN). Required for 8 and 10-digit codes."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HsCodeResponse"},"examples":{"Get HS Code":{"summary":"Get HS Code","value":{"hs_code":"610910","formatted":"6109.10","section":{"code":"6109","description":"T-shirts, singlets and other vests; knitted or crocheted"},"chapter":{"code":"6109","description":"T-shirts, singlets and other vests; knitted or crocheted"},"heading":{"code":"6109","description":"T-shirts, singlets and other vests; knitted or crocheted"},"subheading":{"code":"6109","description":"T-shirts, singlets and other vests; knitted or crocheted"},"level":"subheading","children":[{"code":"6109","description":"T-shirts, singlets and other vests; knitted or crocheted"}],"national":[{"country":"US","code":"6109100012","formatted":"6109.10.00.12","description":"Of cotton › T-shirts, all white... > Men's (338)","general_duty":"16.5%","units":["doz.","kg"]}],"edition":"HS 2022"}}}}}},"400":{"description":"Invalid input, or the target could not be processed (see `error.code`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing proxy secret (call through RapidAPI with your key).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Invalid proxy secret.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Nothing found for this identifier. Not billed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Daily limit of your plan reached.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"The AI provider failed (`ai_error`) or capacity is temporarily exhausted (`capacity_exhausted`); retry. Not billed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"x-rapidapi-endpoint":"Get HS Code"}},"/v1/hs-codes/search":{"get":{"tags":["Lookup"],"summary":"Keywords to matching HS subheadings, no AI","description":"6-digit subheadings whose official texts match the keywords, ranked\nby relevance, with their chapter and heading. Instant and deterministic;\nuse /classify when the wording of the product differs from the tariff's.\n1 credit.","operationId":"searchHsCodes","parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string","minLength":2,"maxLength":200,"description":"Words describing the goods, in English.","examples":["cotton t-shirt"],"title":"Q"},"description":"Words describing the goods, in English."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":25,"minimum":1,"description":"Results, 1-25.","default":10,"title":"Limit"},"description":"Results, 1-25."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HsSearchResponse"},"examples":{"Search HS Codes":{"summary":"Search HS Codes","value":{"query":"cotton t-shirt","results":[{"hs_code":"610910","formatted":"6109.10","section":{"code":"6109","description":"T-shirts, singlets and other vests; knitted or crocheted"},"chapter":{"code":"6109","description":"T-shirts, singlets and other vests; knitted or crocheted"},"heading":{"code":"6109","description":"T-shirts, singlets and other vests; knitted or crocheted"},"subheading":{"code":"6109","description":"T-shirts, singlets and other vests; knitted or crocheted"},"score":12.4}],"edition":"HS 2022"}}}}}},"400":{"description":"Invalid input, or the target could not be processed (see `error.code`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing proxy secret (call through RapidAPI with your key).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Invalid proxy secret.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Daily limit of your plan reached.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"The AI provider failed (`ai_error`) or capacity is temporarily exhausted (`capacity_exhausted`); retry. Not billed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"x-rapidapi-endpoint":"Search HS Codes"}}},"components":{"schemas":{"Body_Classify_Product_from_Image":{"properties":{"file":{"type":"string","title":"File","description":"Product photo, up to 10 MB.","format":"binary"},"description":{"type":"string","maxLength":2000,"title":"Description","description":"What the product is (optional)."},"material":{"type":"string","maxLength":300,"title":"Material","description":"Material or composition, e.g. '60% cotton, 40% polyester'."},"use":{"type":"string","maxLength":300,"title":"Use","description":"Function or intended use, e.g. 'for passenger cars'."},"country":{"type":"string","enum":["US","EU"],"title":"Country","description":"Also pick the national tariff line: `US` (HTS, 10 digits, with the general duty rate) or `EU` (Combined Nomenclature, 8 digits)."},"max_results":{"type":"integer","maximum":3.0,"minimum":1.0,"title":"Max Results","description":"Candidate codes to return, best first (1-3).","default":3}},"type":"object","required":["file"],"title":"Body_Classify Product from Image"},"ErrorBody":{"properties":{"status":{"type":"integer","title":"Status","examples":[400]},"code":{"type":"string","title":"Code","examples":["invalid_url"]},"message":{"type":"string","title":"Message","examples":["A website URL is required."]}},"type":"object","required":["status","code","message"],"title":"ErrorBody"},"ErrorEnvelope":{"properties":{"error":{"$ref":"#/components/schemas/ErrorBody"}},"type":"object","required":["error"],"title":"ErrorEnvelope"},"HsCandidate":{"properties":{"hs_code":{"type":"string","title":"Hs Code","examples":["610910"]},"formatted":{"type":"string","title":"Formatted","examples":["6109.10"]},"section":{"$ref":"#/components/schemas/HsLevel"},"chapter":{"$ref":"#/components/schemas/HsLevel"},"heading":{"anyOf":[{"$ref":"#/components/schemas/HsLevel"},{"type":"null"}]},"subheading":{"anyOf":[{"$ref":"#/components/schemas/HsLevel"},{"type":"null"}]},"confidence":{"type":"number","title":"Confidence","description":"0 to 1, the model's own estimate.","examples":[0.95]},"reasoning":{"type":"string","title":"Reasoning","examples":["A knitted cotton T-shirt: heading 6109, cotton subheading."]},"national":{"anyOf":[{"$ref":"#/components/schemas/HsNationalLine"},{"type":"null"}]}},"type":"object","required":["hs_code","formatted","section","chapter","confidence","reasoning"],"title":"HsCandidate"},"HsClassifyRequest":{"properties":{"description":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Description","description":"What the product is, in any language: a title, a catalogue line or a full description. Required unless `url` or `image_url` is given.","examples":["Men's short-sleeve crew-neck T-shirt, 100% cotton jersey"]},"material":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}],"title":"Material","description":"Material or composition, e.g. '60% cotton, 40% polyester'.","examples":["100% cotton, knitted jersey"]},"use":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}],"title":"Use","description":"Function or intended use, e.g. 'for passenger cars'."},"url":{"anyOf":[{"type":"string","maxLength":2048},{"type":"null"}],"title":"Url","description":"A product page to read (title, description, specifications)."},"image_url":{"anyOf":[{"type":"string","maxLength":2048},{"type":"null"}],"title":"Image Url","description":"A photo of the product: PNG, JPEG, WEBP, HEIC, GIF, BMP or TIFF, up to 10 MB."},"country":{"anyOf":[{"type":"string","enum":["US","EU"]},{"type":"null"}],"title":"Country","description":"Also pick the national tariff line: `US` (HTS, 10 digits, with the general duty rate) or `EU` (Combined Nomenclature, 8 digits).","examples":["US"]},"max_results":{"type":"integer","maximum":3.0,"minimum":1.0,"title":"Max Results","description":"HsCandidate codes to return, best first (1-3).","default":3}},"type":"object","title":"HsClassifyRequest"},"HsClassifyResponse":{"properties":{"product":{"type":"string","title":"Product","description":"The goods as the AI understood them, in customs terms.","examples":["Men's short-sleeved T-shirt of 100% cotton knitted jersey."]},"hs_code":{"type":"string","title":"Hs Code","description":"The best 6-digit code.","examples":["610910"]},"results":{"items":{"$ref":"#/components/schemas/HsCandidate"},"type":"array","title":"Results"},"to_confirm":{"items":{"type":"string"},"type":"array","title":"To Confirm","description":"Facts that would change the code, to check before declaring."},"inputs":{"items":{"type":"string"},"type":"array","title":"Inputs","description":"What was read: description, url, image.","examples":[["description"]]},"edition":{"type":"string","title":"Edition","default":"HS 2022","examples":["HS 2022"]},"disclaimer":{"type":"string","title":"Disclaimer","default":"Classification aid, not a binding ruling: have the code confirmed by a licensed customs broker before you declare goods."}},"type":"object","required":["product","hs_code","results","inputs"],"title":"HsClassifyResponse"},"HsCodeResponse":{"properties":{"hs_code":{"type":"string","title":"Hs Code","examples":["610910"]},"formatted":{"type":"string","title":"Formatted","examples":["6109.10"]},"section":{"$ref":"#/components/schemas/HsLevel"},"chapter":{"$ref":"#/components/schemas/HsLevel"},"heading":{"anyOf":[{"$ref":"#/components/schemas/HsLevel"},{"type":"null"}]},"subheading":{"anyOf":[{"$ref":"#/components/schemas/HsLevel"},{"type":"null"}]},"level":{"type":"string","enum":["chapter","heading","subheading"],"title":"Level","examples":["subheading"]},"children":{"items":{"$ref":"#/components/schemas/HsLevel"},"type":"array","title":"Children","description":"Headings of a chapter, or subheadings of a heading."},"national":{"items":{"$ref":"#/components/schemas/HsNationalLine"},"type":"array","title":"National","description":"With `country`: the national lines under the code."},"edition":{"type":"string","title":"Edition","default":"HS 2022","examples":["HS 2022"]}},"type":"object","required":["hs_code","formatted","section","chapter","level"],"title":"HsCodeResponse"},"HsLevel":{"properties":{"code":{"type":"string","title":"Code","examples":["6109"]},"description":{"type":"string","title":"Description","examples":["T-shirts, singlets and other vests; knitted or crocheted"]}},"type":"object","required":["code","description"],"title":"HsLevel"},"HsNationalLine":{"properties":{"country":{"type":"string","enum":["US","EU"],"title":"Country","examples":["US"]},"code":{"type":"string","title":"Code","examples":["6109100012"]},"formatted":{"type":"string","title":"Formatted","examples":["6109.10.00.12"]},"description":{"type":"string","title":"Description","description":"The line's text with its parent lines, ' › '-separated.","examples":["Of cotton › T-shirts, all white... > Men's (338)"]},"general_duty":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"General Duty","description":"US only: the general (MFN, column 1) duty rate. Additional Chapter 99 duties (Sections 232/301, reciprocal tariffs) are not included.","examples":["16.5%"]},"units":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Units","description":"US only: reporting units.","examples":[["doz.","kg"]]}},"type":"object","required":["country","code","formatted","description"],"title":"HsNationalLine"},"HsSearchHit":{"properties":{"hs_code":{"type":"string","title":"Hs Code","examples":["610910"]},"formatted":{"type":"string","title":"Formatted","examples":["6109.10"]},"section":{"$ref":"#/components/schemas/HsLevel"},"chapter":{"$ref":"#/components/schemas/HsLevel"},"heading":{"anyOf":[{"$ref":"#/components/schemas/HsLevel"},{"type":"null"}]},"subheading":{"anyOf":[{"$ref":"#/components/schemas/HsLevel"},{"type":"null"}]},"score":{"type":"number","title":"Score","description":"Relevance, higher is better.","examples":[12.4]}},"type":"object","required":["hs_code","formatted","section","chapter","score"],"title":"HsSearchHit"},"HsSearchResponse":{"properties":{"query":{"type":"string","title":"Query","examples":["cotton t-shirt"]},"count":{"type":"integer","title":"Count"},"results":{"items":{"$ref":"#/components/schemas/HsSearchHit"},"type":"array","title":"Results"},"edition":{"type":"string","title":"Edition","default":"HS 2022","examples":["HS 2022"]}},"type":"object","required":["query","count","results"],"title":"HsSearchResponse"}},"securitySchemes":{"RapidAPIKey":{"type":"apiKey","in":"header","name":"X-RapidAPI-Key"},"RapidAPIHost":{"type":"apiKey","in":"header","name":"X-RapidAPI-Host"}}},"tags":[{"name":"Classification","description":"Product to HS code with AI, checked against the nomenclature."},{"name":"Lookup","description":"HS codes, their hierarchy and national lines, and keyword search. No AI."}],"security":[{"RapidAPIKey":[],"RapidAPIHost":[]}]}