New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

groundtruth-tariff

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

groundtruth-tariff

2026 US tariff and landed cost API for AI agents and ecommerce sellers. Source-linked duty rates (MFN, Section 301/232, forced-labor), MPF/HMF, and total landed cost.

latest
Source
npmnpm
Version
1.0.2
Version published
Weekly downloads
9
-97.04%
Maintainers
1
Weekly downloads
 
Created
Source

groundtruth-tariff

Source-linked 2026 US tariff & landed-cost API for AI agents and ecommerce sellers.

Get accurate US import duties — MFN rates, Section 301/232 tariffs, MPF/HMF fees — and total landed cost in a single call. Every rate is traceable to an official source.

npm version license

Install

npm install groundtruth-tariff

Quick start

const { calculateTariff } = require('groundtruth-tariff');

const result = await calculateTariff({
  product: 'cotton t-shirt',
  origin: 'CN',
  value: 1000
});

console.log(result);
// {
//   as_of: '2026-09-29',
//   origin: 'CN',
//   matched_category: { id: 'apparel', label: 'Apparel & clothing' },
//   duty_breakdown: [
//     { name: 'MFN duty', rate: 0.165 },
//     { name: 'Section 301', rate: 0.25 },
//     ...
//   ],
//   total_duty_rate: 0.54,
//   total_customs_duty: 540,
//   fees: { mpf: 34.65, hmf: 12.5 },
//   total_landed_cost: 1573.50,
//   sources: [ ... ]
// }

API

calculateTariff({ product, origin, value, mode })

Calculate import duty and full landed cost.

ParamTypeRequiredDescription
productstring✅Product description, e.g. 'cotton t-shirt'
originstring✅Origin country code: CN, VN, IN, MX, etc.
valuenumber✅Declared customs value in USD
modestring❌Shipping mode: 'ocean' (default) or 'air'

Returns a promise resolving to the full duty breakdown, fees, and landed cost.

listCategories()

List all supported tariff categories, origin countries, and fee rules.

const { listCategories } = require('groundtruth-tariff');

const data = await listCategories();
console.log(data.categories);

Examples

Smartphone from Vietnam, shipped by air:

const result = await calculateTariff({
  product: 'smartphone',
  origin: 'VN',
  value: 2000,
  mode: 'air'
});

Error handling:

try {
  const result = await calculateTariff({ product: 'shoes', origin: 'CN', value: 500 });
} catch (err) {
  console.error('Tariff lookup failed:', err.message);
}

Why GroundTruth?

  • 🔗 Source-linked — every rate points to an official source, no black-box guesses
  • 🇺🇸 US-specific — MFN, Section 301 (China), Section 232 (steel/aluminum), forced-labor flags
  • 📦 Landed cost, not just duty — includes MPF, HMF, and shipping-mode adjustments
  • 🤖 Built for AI agents — also available over MCP
  • 🔄 Always current — rates refresh automatically as policy changes

Free tools

License

MIT © GroundTruth

Free tier includes attribution. Paid plans remove attribution and raise rate limits.

Keywords

tariff

FAQs

Package last updated on 29 Sep 2026

Related posts