npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

groundtruth-tariff

v1.0.2

Published

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.

Readme

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.

| Param | Type | Required | Description | |-------|------|----------|-------------| | product | string | ✅ | Product description, e.g. 'cotton t-shirt' | | origin | string | ✅ | Origin country code: CN, VN, IN, MX, etc. | | value | number | ✅ | Declared customs value in USD | | mode | string | ❌ | 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

  • 🧮 Free tariff calculator: https://contentforge-press.github.io/groundtruth-calculator/
  • 📚 API docs & pricing: https://dytsk9wrfv.page.coze.site/groundtruth.html

License

MIT © GroundTruth

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