Available8 endpoints$0.01 – $0.05 per successful call, by endpoint
Tariff Calculator API
Calculate U.S. import duties with full tariff stacking.
Base URL · https://api.compliancegrid.ai/v1/tariffs
Calculate duties · no signuplive data
Try , or .
What it checks
The Tariff Calculator API computes total landed cost for U.S. imports by stacking all applicable duty layers: base MFN rates from the Harmonized Tariff Schedule, Section 301, Section 232 (steel/aluminum/autos/copper), AD/CVD flags, Merchandise Processing Fee (MPF), and Harbor Maintenance Fee (HMF). Includes AI-powered compliance advisory, country sourcing comparison, and FTA eligibility checks.
- Tariff stacking by entry date: Base MFN + Section 301 + Section 232 + AD/CVD + MPF + HMF. Section 122 (expired 24 Jul 2026) and IEEPA (invalidated 20 Feb 2026) apply only to earlier entry dates
- Retired HTS numbers are rejected (HTS_CODE_RETIRED) with the replacement codes instead of silently resolving to a parent heading
- Date-sensitive calculation — the entry date decides which tariff authorities apply
- Country-of-origin aware — provisions apply by country scope, FTAs reduce duty for partner countries
- AD/CVD order flagging with case numbers and rate ranges
- FTA eligibility detection (USMCA, AGOA, CAFTA-DR, KORUS, and 12+ bilateral agreements)
- MPF ($31.67–$614.35) and HMF (ocean shipments only) fee calculation
- AI-powered compliance advisory with plain-English duty explanations
- Country comparison — find the cheapest sourcing option across 20+ countries
- Bulk calculation for up to 100 items per request
- Complex rate parsing: ad valorem, specific, compound, and complex rate strings
- Audit logging for every calculation
Endpoints
| Method | Path | What it does | |
|---|---|---|---|
| POST | /v1/tariffs/calculate | Calculate total U.S. import duty and landed cost for a single shipment. Stacks all applicable duty layers. | Docs |
| POST | /v1/tariffs/calculate/smart | AI-enhanced tariff calculation with plain-English compliance advisory, risk factors, and sourcing insights. | Docs |
| POST | /v1/tariffs/calculate/bulk | Calculate tariffs for up to 100 items in a single request. | Docs |
| POST | /v1/tariffs/compare | Compare tariff costs for the same product across multiple countries of origin. | Docs |
| GET | /v1/tariffs/provisions | List all active tariff provisions (Section 301, 232, 122, IEEPA, safeguards). | Docs |
| GET | /v1/tariffs/provisions/{authority} | Filter tariff provisions by authority type. | Docs |
| GET | /v1/tariffs/adcvd | List antidumping and countervailing duty orders. | Docs |
| GET | /v1/tariffs/programs | List active Free Trade Agreements and preferential trade programs. | 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 post = (path: string, body: unknown) => fetch(API + path, { method: "POST", headers, body: JSON.stringify(body) }).then((r) => r.json());
// Duty for cotton T-shirts (HTS 6109.10.00.04) from China, entered 1 Mar 2026. The entry date matters:
// which authorities apply (Section 301, Section 122, IEEPA) and the fee limits all depend on it.
const result = await post("/v1/tariffs/calculate", {
htsCode: "6109.10.00.04",
countryOfOrigin: "CN",
declaredValue: 50000,
entryDate: "2026-03-01",
modeOfTransport: "OCEAN",
});
console.log(result.data.summary.totalLandedCost);
console.log(result.data.duties.section122?.rate); // 10% inside its 24 Feb to 24 Jul 2026 window
console.log(result.data.warnings); // read these: they say what is approximate or not modelled
// Compare sourcing countries (sorted by landed cost, lowest first)
const compare = await post("/v1/tariffs/compare", {
htsCode: "6109.10.00.04",
countries: ["CN", "VN", "IN", "MX", "KR"],
declaredValue: 50000,
entryDate: "2026-03-01",
});
console.log(compare.data.comparisons[0].country, compare.data.cheapest, compare.data.mostExpensive);Example response
{
"success": true,
"data": {
"id": "tcalc_abc123",
"htsCode": "6109.10.00.04",
"htsDescription": "T-shirts, all white, short hemmed sleeves ... (352)",
"countryOfOrigin": "CN",
"declaredValue": 50000,
"entryDate": "2026-03-01",
"duties": {
"baseDuty": {
"rate": "16.5%",
"amount": 8250
},
"section301": {
"rate": "7.5%",
"amount": 3750,
"htsProvision": "9903.88.15"
},
"section122": {
"rate": "10%",
"amount": 5000,
"htsProvision": "9903.03.01"
},
"ieepa": null
},
"fees": {
"mpf": {
"amount": 173.2,
"min": 33.58,
"max": 651.5
},
"hmf": {
"amount": 62.5
}
},
"summary": {
"totalDutyAmount": 17000,
"totalFeesAmount": 235.7,
"totalLandedCost": 67235.7,
"effectiveDutyRate": "34.0%"
},
"warnings": [
"On 20 Feb 2026 the Supreme Court held (Learning Resources v. Trump) that IEEPA does not authorize tariffs; IEEPA tariffs are not applied to entries on or after this date.",
"No USTR exclusion (U.S. note 20, headings 9903.88.66 to 9903.88.70) covers this line on the entry date.",
"Section 122 surcharge is temporary (expires 2026-07-24)",
"The duty rate (16.5%) is set on the parent line 6109.10.00; 6109.10.00.04 is a statistical suffix under it."
]
}
}Good to know
- Rates and duty layers depend on the entry date. The response lists warnings for anything the request does not give us, such as steel content or a trade-agreement claim.
- Final duties are set by U.S. Customs and Border Protection.
- 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 →