Back to Home
Tariff Calculator API
Calculate U.S. import duties with full tariff stacking
https://api.compliancegrid.ai/v1/tariffs
8 endpoints
~45ms avg response
Overview
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 (China), Section 232 (steel/aluminum/autos/copper), Section 122 (temporary surcharge), AD/CVD flags, Merchandise Processing Fee (MPF), and Harbor Maintenance Fee (HMF). Includes AI-powered compliance advisory, country sourcing comparison, and FTA eligibility checks.
Key Features
Full tariff stacking: Base MFN + Section 301 + Section 232 + Section 122 + IEEPA + AD/CVD + MPF + HMF
Date-sensitive calculation — rates change with Executive Orders and proclamations
Country-of-origin aware — Section 301 applies only to China, 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
POST
/v1/tariffs/calculatePOST
/v1/tariffs/calculate/smartPOST
/v1/tariffs/calculate/bulkPOST
/v1/tariffs/compareGET
/v1/tariffs/provisionsGET
/v1/tariffs/provisions/:authorityGET
/v1/tariffs/adcvdGET
/v1/tariffs/programsQuick Example
tariff-example.ts
import ComplianceGrid from "@compliancegrid/sdk";
const cg = new ComplianceGrid({
apiKey: process.env.COMPLIANCEGRID_API_KEY,
});
// Calculate tariff for cell phones from China
const result = await cg.tariffs.calculate({
htsCode: "8517.12.00.10",
countryOfOrigin: "CN",
declaredValue: 50000,
entryDate: "2026-02-27",
modeOfTransport: "OCEAN",
});
console.log(result.data.summary.totalLandedCost); // 67735.70
console.log(result.data.summary.effectiveDutyRate); // "35.0%"
console.log(result.data.duties.section301?.rate); // "25%"
console.log(result.data.duties.section122?.rate); // "10%"
// Compare sourcing countries
const compare = await cg.tariffs.compare({
htsCode: "8517.12.00.10",
countries: ["CN", "VN", "IN", "MX", "KR"],
declaredValue: 50000,
entryDate: "2026-02-27",
});
console.log(compare.data.cheapest); // "MX"
console.log(compare.data.mostExpensive); // "CN"Sample Response
response.json
{
"success": true,
"data": {
"id": "tcalc_abc123",
"htsCode": "8517.12.00.10",
"htsDescription": "Telephones for cellular networks...",
"countryOfOrigin": "CN",
"countryName": "China",
"declaredValue": 50000,
"duties": {
"baseDuty": { "rate": "Free", "amount": 0 },
"section301": { "rate": "25%", "amount": 12500 },
"section232": null,
"section122": { "rate": "10%", "amount": 5000 },
"adCvd": { "flag": false }
},
"fees": {
"mpf": { "rate": "0.3464%", "amount": 173.20 },
"hmf": { "rate": "0.125%", "amount": 62.50 }
},
"summary": {
"totalDutyAmount": 17500,
"totalFeesAmount": 235.70,
"totalLandedCost": 67735.70,
"effectiveDutyRate": "35.0%"
},
"ftaOpportunities": [],
"warnings": ["Section 122 surcharge is temporary (expires 2026-07-24)"]
}
}