Tariff API

US import duty calculation

Get your Tariff API key

Sign up free and create an API key to get started.

Full Tariff Stack

MFN base duty, IEEPA, Section 301, 232, reciprocal, AD/CVD - all in one call.

AI HTS Classification

Describe your product in plain English. AI returns the correct HTS code.

USITC + Database

Cross-references USITC HTS API with our 30K+ code database for maximum accuracy.

Authentication

Pass your API key in the X-API-Key header with every request. Without a key, requests fall back to IP-based rate limiting.

X-API-Key: tariff_your_api_key_here

Endpoints

Calculate total import duty for an HTS code + country of origin. Returns base duty, IEEPA, Section 301, Section 232, reciprocal tariffs, AD/CVD, and total.

Request Body

{
  "hts_code": "8471.30.01",       // Required - HTS code
  "country_code": "CN",            // Required - ISO country code
  "declared_value": 10000           // Optional - defaults to 10000
}

Response

{
  "result": {
    "hts_code": "8471.30.01",
    "description": "Portable digital automatic data processing machines...",
    "country": { "code": "CN", "name": "China", "flag": "..." },
    "declared_value": 10000,
    "rates": {
      "base_duty": { "rate": 0, "rate_type": "free", "amount": 0 },
      "ieepa": { "rate": 20, "applies": true, "amount": 2000 },
      "section_301": { "rate": 25, "applies": true, "amount": 2500 },
      "section_232": { "rate": 0, "applies": false },
      "reciprocal": { "rate": 0, "applies": false },
      "ad_cvd": { "rate": 0, "applies": false }
    },
    "total_duty_rate": 45,
    "total_duty_amount": 4500,
    "warnings": ["..."],
    "source": "usitc_api"
  },
  "remaining": 4
}

Code Examples

Calculate Tariff

curl -X POST https://tariff.gatewaylines.com/api/tariff/public/calculate \
  -H "Content-Type: application/json" \
  -H "X-API-Key: tariff_YOUR_API_KEY" \
  -d '{
    "hts_code": "8471.30.01",
    "country_code": "CN",
    "declared_value": 10000
  }'

AI HTS Code Search

curl -X POST https://tariff.gatewaylines.com/api/tariff/public/ai-search \
  -H "Content-Type: application/json" \
  -H "X-API-Key: tariff_YOUR_API_KEY" \
  -d '{"query": "cotton t-shirt for men"}'

Rate Limits

Free Tier

5 requests per day, shared across all Tariff API endpoints (calculate + AI search). Resets every 24 hours.

Need more? Contact [email protected] for higher limits.

Error Codes

CodeMeaning
200Success
400Bad Request
401Unauthorized
429Rate Limited
500Server Error

Ready to start?

Create a free account and get your API key in seconds.

Sign Up Free