› compliance_grid.aiCOMPLIANCEGRIDGOV · COMPLIANCE · INTELLIGENCE
Available6 endpoints$0.01 – $0.05 per successful call, by endpoint

HS Code Lookup API

Search tariff codes and classify commodities with AI.

Base URL · https://api.compliancegrid.ai/v1/hs
Find a tariff code · no signuplive data
Try , or .

What it checks

The HS Code Lookup API provides two ways to find the right tariff classification. Keyword search queries a synced copy of the official USITC Harmonized Tariff Schedule, returning HTS numbers with duty rates, indent hierarchy, and statistical suffixes. AI-powered classification uses Claude to analyze commodity descriptions and suggest HTS codes with confidence levels and GRI reasoning. Results are enriched with live USITC data including duty rates and units of quantity.

  • Keyword search against a synced copy of the USITC HTS database
  • AI-powered commodity classification with confidence levels (HIGH/MEDIUM/LOW)
  • General Rules of Interpretation (GRI) reasoning in AI suggestions
  • HTS number lookup with duty rates (general, special, other/Column 2)
  • Schedule B number derivation from HTS codes
  • USITC data enrichment: descriptions, indent hierarchy, units of quantity
  • HTS section and chapter reference data (22 sections, 99 chapters)
  • GRI rules reference endpoint for classification guidance

Endpoints

MethodPathWhat it does
GET/v1/hs/searchKeyword search of the HTS schedule loaded from the USITC. Each tariff line is searched together with its parent lines, plurals and a few everyday words are understood, and lines that contain all the words rank first. Chapters 98 and 99 (temporary and special provisions) are not searched, and a line without a rate of its own shows its parent line's rate. This is a keyword search, not a classifier: use POST /v1/hs/classify for an AI-assisted suggestion.Docs
POST/v1/hs/searchKeyword search of the HTS schedule loaded from the USITC. Each tariff line is searched together with its parent lines, plurals and a few everyday words are understood, and lines that contain all the words rank first. Chapters 98 and 99 (temporary and special provisions) are not searched, and a line without a rate of its own shows its parent line's rate. This is a keyword search, not a classifier: use POST /v1/hs/classify for an AI-assisted suggestion.Docs
POST/v1/hs/classifyClassify a commodity into HTS codes using Claude with GRI reasoning.Docs
GET/v1/hs/lookup/{htsNumber}Look up a specific HTS number with all matching tariff lines.Docs
GET/v1/hs/reference/sectionsList all 22 sections of the Harmonized Tariff Schedule.Docs
GET/v1/hs/reference/griReference for the 9 GRI used in tariff classification.Docs

Request and response

const API = "https://api.compliancegrid.ai";
const headers = { "x-api-key": process.env.CG_API_KEY!, "Content-Type": "application/json" };
const get = (path: string) => fetch(API + path, { headers }).then((r) => r.json());
const post = (path: string, body: unknown) => fetch(API + path, { method: "POST", headers, body: JSON.stringify(body) }).then((r) => r.json());

// Search by keyword
const results = await post("/v1/hs/search", { query: "smartphone", limit: 5 });
console.log(results.data.totalResults);
console.log(results.data.results[0].htsNumber, results.data.results[0].generalDutyRate);

// AI-assisted classification: up to three candidates with reasoning
const classification = await post("/v1/hs/classify", {
  description: "Stainless steel kitchen knife set with wooden handles",
  countryOfOrigin: "CN",
  intendedUse: "household kitchen use",
});

for (const s of classification.data.suggestions) {
  console.log(s.htsNumber + " [" + s.confidence + "] - " + s.reasoning.slice(0, 120));
}
Example response
{
  "success": true,
  "data": {
    "query": "smartphone",
    "totalResults": 3,
    "results": [
      {
        "htsNumber": "8517",
        "description": "Telephone sets, including smartphones and other telephones for cellular networks or for other wireless network...",
        "generalDutyRate": null,
        "chapter": "85",
        "heading": "8517"
      },
      {
        "htsNumber": "8517.13.00.00",
        "description": "Smartphones",
        "generalDutyRate": "Free",
        "chapter": "85",
        "heading": "8517"
      },
      {
        "htsNumber": "9902.12.09",
        "description": "Back-shell style smartphone cases of hard plastics, each incorporating flexible rubber over command buttons an...",
        "generalDutyRate": "Free",
        "chapter": "99",
        "heading": "9902"
      }
    ]
  }
}

Good to know

  • Search returns candidate lines from the USITC tariff schedule, not a binding classification. Confirm with a licensed customs broker or CBP.
  • Every response carries its source and the list version, so the result can go in your audit file.
  • The sandbox returns mock data and production returns live data. Build in the sandbox and switch your key to go live.

Pricing

$0.01 – $0.05per successful call, by endpoint
Only successful calls are billed. Volume discounts start at 10,001 calls a month, and the sandbox is free.See pricing and estimate your bill →