Contents
Getting Started
The API provides programmatic access to comprehensive HTS (Harmonized Tariff Schedule) data. Get complete tariff information including base duty rates and additional measures. This RESTful API uses standard HTTP response codes and returns JSON-encoded responses.
https://tariffsapi.com/api/v1
Prerequisites: Active premium subscription and a valid API key.
Authentication
All API requests require authentication using an API key.
Bearer Token (Recommended)
curl "https://tariffsapi.com/api/v1/tariffs/resolve?hts=8541.10.00.80&origin=CN" \
-H "Authorization: Bearer YOUR_API_KEY"
Alternative: X-API-Key Header
curl "https://tariffsapi.com/api/v1/tariffs/resolve?hts=8541.10.00.80&origin=CN" \
-H "X-API-Key: YOUR_API_KEY"
Security: Never expose your API keys in client-side code, public repositories, or version control systems.
Rate Limits
Two limits apply. Each API key has a per-minute burst limit, and each IP address has a
cap of 300 requests per 5 minutes (about 60 a minute sustained). A client
on a single IP address hits the per-IP cap first, so the per-key figure below is not the
rate you can sustain from one address. The per-IP cap covers /api/v1/* except the
MCP endpoint (/api/v1/mcp and /api/v1/mcp/*). MCP with a key is limited to
500 requests a minute per IP and per key; MCP with no key to 60 a minute per IP. A per-key MCP 429
is RATE_LIMITED with the X-RateLimit-* headers; the per-IP one is the
plain-string 429 with Retry-After: 60.
Rate Limit Headers
Per-key limits send these headers (example for /resolve):
X-RateLimit-Limit: 300
X-RateLimit-Remaining: 298
X-RateLimit-Reset: 1640995200
The per-IP cap answers 429 with {"error":"Too many requests. Please slow down."}
(a string, not the error object), Retry-After: 300 (the window length in seconds), and
none of the X-RateLimit-* headers. A per-key burst 429 has code RATE_LIMITED and
a Retry-After until the next UTC minute. Monthly allowances (Starter 1,000, Developer 10,000,
Pro 100,000) return 429 with MONTHLY_LIMIT_EXCEEDED when the gate blocks;
it does not block on every account.
Tariff Resolution API
Resolve complete tariff information including base duty rates and additional measures (Section 301, 232, 338) for any HTS code and country of origin.
/api/v1/tariffs/resolve
Primary consumer-facing endpoint. Given an HTS code and country of origin, returns the complete tariff picture: base duty (general or special via trade agreements) plus every additional measure in force on that date (Section 301, 232, 338). Measures that have ended, such as the IEEPA tariffs and the Section 122 surcharge, are returned only when as_of falls inside the period they were in force. Uses HTS inheritance when needed. Returns a transparent breakdown—never silently sums rates. Use resolve_chapter_99=true to resolve reference-only measures (e.g. “See 9903.91.05”) to numeric rates by looking up the Chapter 99 HTS line in our database; rates are never invented.
Query Parameters
| Parameter | Required | Description |
|---|---|---|
hts |
Required | HTS number (any length; inheritance applies) |
origin |
Required | ISO-2 country code (e.g., CN, MX, CA) |
as_of |
Optional | Date (YYYY-MM-DD) to price for. Omit to price for today (US Eastern). Pass a date only for historical/point-in-time rates — a hardcoded past date always returns that day’s rates, not current ones, and won’t reflect new tariffs or sunsets. |
include_unknown_effective_dates |
Optional | Include measures with unknown effective dates (default: true). Set false to exclude. |
resolve_chapter_99 |
Optional | Boolean (default: false). Resolves Chapter 99 references to numeric rates. |
conditions[<key>] |
Optional | Pick a branch of rate_conditional, e.g. conditions[preference_claimed]=usmca_not_claimed. The key is the response’s rate_conditional.depends_on (also given as rate_conditional.condition_param) and the value one of its alternatives[].case. The response then returns that branch’s duties and total as the main result and lists what it applied in applied_conditions. Selectable: preference_claimed, metal_melt_and_pour_origin, quota_fill_at_entry, patent_status, and end_use on Section 232 auto parts that are also medium- and heavy-duty vehicle parts (conditions[end_use]=medium_or_heavy_duty_vehicle returns the heavy-truck stack and total). end_use on any other line returns 422 CONDITION_NOT_SELECTABLE. An unknown key or case returns 422 with the allowed values. |
Example Request
const axios = require('axios');
// For origins where additional duties apply (e.g. CN), use resolve_chapter_99: true to get numeric rates
const response = await axios.get('https://tariffsapi.com/api/v1/tariffs/resolve', {
headers: { 'Authorization': 'Bearer YOUR_API_KEY' },
params: {
hts: '8541.10.00.80',
origin: 'CN',
as_of: '2026-11-30',
include_unknown_effective_dates: true,
resolve_chapter_99: true
}
});
console.log(response.data);
import requests
# For origins where additional duties apply (e.g. CN), use resolve_chapter_99=True to get numeric rates
response = requests.get(
'https://tariffsapi.com/api/v1/tariffs/resolve',
headers={'Authorization': 'Bearer YOUR_API_KEY'},
params={
'hts': '8541.10.00.80',
'origin': 'CN',
'as_of': '2026-11-30',
'include_unknown_effective_dates': True,
'resolve_chapter_99': True
}
)
print(response.json())
require 'net/http'
require 'json'
# For origins where additional duties apply (e.g. CN), use resolve_chapter_99: true to get numeric rates
params = {
hts: '8541.10.00.80',
origin: 'CN',
as_of: '2026-11-30',
include_unknown_effective_dates: true,
resolve_chapter_99: true
}
query = URI.encode_www_form(params)
uri = URI("https://tariffsapi.com/api/v1/tariffs/resolve?#{query}")
request = Net::HTTP::Get.new(uri)
request['Authorization'] = 'Bearer YOUR_API_KEY'
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(request) }
puts JSON.parse(response.body)
Example Response
{
"data_source": {
"hts_revision": "2026HTSRev21",
"data_as_of": "2026-10-09T04:31:07Z"
},
"resolution": {
"requested_hts": "8541.10.00.80",
"resolved_hts": "8541.10.00",
"origin": "CN",
"as_of": "2026-11-30",
"include_unknown_effective_dates": true,
"resolve_chapter_99": true
},
"base_tariff": {
"type": "general",
"rate_type": "ad_valorem",
"percentage_component": 0.0,
"per_unit_component": null,
"agreement": null
},
"additional_measures": [
{
"program": "section_301",
"rate_type": "reference",
"details": "See 9903.91.05",
"chapter_99_code": "9903.91.05",
"effective_date_unknown": true,
"uncertain": true,
"resolved_rate": {
"rate_type": "ad_valorem",
"percentage_component": 0.25,
"source": "chapter_99",
"chapter_99_hts": "9903.91.05"
},
"chapter_99_resolution": {
"status": "resolved",
"resolved_hts": "9903.91.05",
"product_id": 12345
}
}
],
"summary": {
"applicable_ad_valorem_rate": 0.0,
"resolved_additional_ad_valorem_rate": 25.0,
"total_resolved_ad_valorem_rate": 25.0,
"notes": [
"Base duty is 0%",
"Section 301: See 9903.91.05 for details"
]
},
"notice": "This information is provided for general educational and research purposes only. Tariffs API is not a licensed customs broker. Duty rates, HTS classifications, and tariff information should not be relied upon as legal or compliance advice, and should not be used as the basis for filing entry documentation with U.S. Customs and Border Protection without review and approval by a licensed customs broker. Actual classification and applicable duty rates are determined by CBP at its sole discretion.",
"adcvd_status": "not_modeled",
"adcvd_notice": "Antidumping and countervailing duty (AD/CVD) amounts are not included in this total; deposit rates are set per producer and exporter. If your goods may fall under an AD/CVD order, check with a licensed customs broker."
}
When resolve_chapter_99=true, reference measures may include resolved_rate (numeric rate from the Chapter 99 line) and chapter_99_resolution (status: resolved, not_found, no_numeric_rate, or multiple_rates). The summary may also include resolved_additional_ad_valorem_rate and total_resolved_ad_valorem_rate.
data_source.hts_revision names the USITC HTS revision the answer was computed from, and data_source.data_as_of says when the most recent complete load of that revision finished (UTC). A revision is named only once its data has fully loaded; while a new revision is still loading, the field keeps naming the previous one. Both are null if the revision behind an answer cannot be stated.
Every row in additional_measures and suppressed_measures carries effect. A charged row reads adds (with floor_top_up: true when it is a floor/cap top-up: percentage_component is the top-up and all_in_floor is the combined rate), or replaces with a replaces list when another duty stepped aside for it. A relieved row reads replaced with replaced_by (the charged duty that takes its place), excluded with excluded_by (the exemption or exclusion heading), or cancelled. With include_inapplicable_measures=true, a row that does not apply to the origin reads not_applicable.
Missing hts or origin, or a malformed hts (e.g. abc), returns 422 (INVALID_HTS for the malformed case). A well-formed HTS that is not in the schedule returns 404. Results are advisory only.
/api/v1/tariffs/resolve_batch
Developer
Resolve multiple tariffs in a single request. Process up to 200 items with automatic deduplication and caching.
Request Body Parameters
| Parameter | Required | Description |
|---|---|---|
requests |
Required | Array of request objects (max 200) |
requests[].hts |
Required | HTS number for this item |
requests[].origin |
Required | ISO-2 country code for this item |
requests[].as_of |
Optional | Date override for this specific item (YYYY-MM-DD) |
as_of |
Optional | Default date for all items (default: today) |
include_unknown_effective_dates |
Optional | Include measures with unknown dates (default: true) |
resolve_chapter_99 |
Optional | Resolve Chapter 99 references to numeric rates (default: false) |
Example Request
const axios = require('axios');
const response = await axios.post(
'https://tariffsapi.com/api/v1/tariffs/resolve_batch',
{
requests: [
{ hts: '8541.10.0080', origin: 'CN' },
{ hts: '7208.10.15', origin: 'CA' },
{ hts: '8703.23.00', origin: 'MX', as_of: '2025-01-15' }
],
as_of: '2026-11-30',
include_unknown_effective_dates: true,
resolve_chapter_99: false
},
{
headers: { 'Authorization': 'Bearer YOUR_API_KEY' }
}
);
console.log(`Processed ${response.data.meta.count} items in ${response.data.meta.ms_total}ms`);
console.log(response.data.results);
import requests
response = requests.post(
'https://tariffsapi.com/api/v1/tariffs/resolve_batch',
headers={'Authorization': 'Bearer YOUR_API_KEY'},
json={
'requests': [
{'hts': '8541.10.0080', 'origin': 'CN'},
{'hts': '7208.10.15', 'origin': 'CA'},
{'hts': '8703.23.00', 'origin': 'MX', 'as_of': '2025-01-15'}
],
'as_of': '2026-11-30',
'include_unknown_effective_dates': True,
'resolve_chapter_99': False
}
)
batch = response.json()
print(f"Processed {batch['meta']['count']} items in {batch['meta']['ms_total']}ms")
for result in batch['results']:
if result['ok']:
print(f"✓ {result['data']['resolution']['resolved_hts']}")
else:
print(f"✗ {result['error']['message']}")
require 'net/http'
require 'json'
uri = URI('https://tariffsapi.com/api/v1/tariffs/resolve_batch')
request = Net::HTTP::Post.new(uri)
request['Content-Type'] = 'application/json'
request['Authorization'] = 'Bearer YOUR_API_KEY'
request.body = {
requests: [
{ hts: '8541.10.0080', origin: 'CN' },
{ hts: '7208.10.15', origin: 'CA' },
{ hts: '8703.23.00', origin: 'MX', as_of: '2025-01-15' }
],
as_of: '2026-11-30',
include_unknown_effective_dates: true,
resolve_chapter_99: false
}.to_json
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(request) }
batch = JSON.parse(response.body)
puts "Processed #{batch['meta']['count']} items in #{batch['meta']['ms_total']}ms"
batch['results'].each do |result|
if result['ok']
puts "✓ #{result['data']['resolution']['resolved_hts']}"
else
puts "✗ #{result['error']['message']}"
end
end
curl -X POST https://tariffsapi.com/api/v1/tariffs/resolve_batch \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"requests": [
{ "hts": "8541.10.0080", "origin": "CN" },
{ "hts": "7208.10.15", "origin": "CA" },
{ "hts": "8703.23.00", "origin": "MX", "as_of": "2025-01-15" }
],
"as_of": "2026-11-30",
"include_unknown_effective_dates": true,
"resolve_chapter_99": false
}'
Example Response
{
"meta": {
"count": 3,
"unique": 3,
"ms_total": 45.23
},
"data_source": {
"hts_revision": "2026HTSRev21",
"data_as_of": "2026-10-09T04:31:07Z"
},
"results": [
{
"index": 0,
"ok": true,
"data": {
"resolution": {
"requested_hts": "8541.10.0080",
"resolved_hts": "8541.10.00.80",
"origin": "CN",
"as_of": "2026-11-30"
},
"base_tariff": { ... },
"additional_measures": [ ... ],
"summary": {
"applicable_ad_valorem_rate": 25.0,
"notes": ["Base: 0.0% (general) + Additional: 25.0% (section_301)"]
}
}
},
{
"index": 1,
"ok": true,
"data": { ... }
},
{
"index": 2,
"ok": false,
"error": {
"code": "not_found",
"message": "HTS code not found: 8703.23.00"
}
}
]
}
Limits: Maximum 200 items per batch. Each batch counts as one API request for rate limiting.
Common Use Cases
Performance Benchmarks
| Batch Size | Typical Time | vs Individual Requests |
|---|---|---|
| 10 items | 50-150ms | 10-20x faster |
| 50 items | 200-400ms | 20-30x faster |
| 100 items | 400-800ms | 20-40x faster |
| 200 items | 800-1500ms | 25-50x faster |
Each result includes an index field matching the original request array position and an ok boolean indicating success.
Failed items include an error object with code and message fields.
/api/v1/tariffs/timeline
Every dated change we hold for one HTS code, oldest first: Chapter 99 measures and exemptions that started or ended. Pass origin to keep only what applies to goods from that country, and since to see what changed after a date. Same authentication, plan, monthly allowance and per-minute limit as /resolve; a successful call counts as one call.
Query Parameters
| Parameter | Required | Description |
|---|---|---|
hts |
Required | HTS number (any length; inheritance applies as in /resolve) |
origin |
Optional | ISO-2 country code. Without it, every origin's measures are listed with their country scope, and measures that cover every product from a country are left out. |
since |
Optional | Date (YYYY-MM-DD). Only events on or after this day. |
Reading the response
date_basissays what each date means. Today it is alwayseffective_date: the day a measure or exemption took effect or ended (for an end, the last day it applied).- Base-rate (Column 1 and Column 2) changes are not listed yet, and
coverage.base_rate.servedisfalse./resolvegives the base rate in force today. rate_on_recordon a Chapter 99 event is the measure's rate as we hold it today, not necessarily its rate on that date.- Measures and exemptions whose start date we do not hold are listed under
undated, never placed on the timeline at a guessed date. - Some relief is a rule in the schedule's notes rather than a dated row. With
origin,today.relievedlists the measures relieved today and why; for another date, call/resolvewithas_of. coveragecounts what we matched and what we left out, andcoverage.limitationslists every gap with a stablecodeyou can check for.
Example
curl -H "Authorization: Bearer YOUR_API_KEY" \
"https://tariffsapi.com/api/v1/tariffs/timeline?hts=0000.00.00.00&origin=VN&since=2026-01-01"
{
"hts": "0000.00.00.00",
"resolved_hts": "0000.00.00.00",
"origin": "VN",
"since": "2026-01-01",
"events": [
{
"date": "2026-02-24",
"date_basis": "effective_date",
"layer": "chapter_99_measure",
"event": "measure_started",
"scheduled": false,
"program": "section_122",
"chapter_99_code": "9903.xx.xx",
"applies_to": { "country_scope": "exclude", "countries": [] },
"rate_on_record": { "rate_type": "ad_valorem", "percent": 10.0, "per_unit": null, "unit": null },
"source": { "authority": "USITC Harmonized Tariff Schedule, Chapter 99 subchapter III", "url": "https://hts.usitc.gov/...", "release": null }
}
],
"undated": [
{
"layer": "chapter_99_exemption",
"missing": "start_date",
"program": "section_122",
"exempting_chapter_99_code": "9903.xx.xx",
"suppressed_chapter_99_code": "9903.xx.xx",
"listed_in_release": "2026HTSRev21"
}
],
"today": {
"as_of": "2026-01-01",
"relieved": [
{ "program": "section_122", "chapter_99_code": "9903.xx.xx", "exempting_chapter_99_code": "9903.xx.xx", "reason": "..." }
]
},
"coverage": {
"base_rate": { "served": false },
"chapter_99": { "rate_changes_versioned": false, "undated_measures": 0, "undated_exemptions": 1 },
"limitations": [ { "code": "chapter_99_rate_changes_not_versioned", "message": "..." } ]
}
}
/api/v1/tariffs/by_hts/:hts_number
Get base duties and additional measures for a single HTS code. Returns detailed duty information including all rate types. Each additional measure carries the coarse program and, where the heading maps, program_detail — the same finer cut /resolve emits, so a 9903.05 forced-labor duty is distinguishable from a China list duty.
Query Parameters
| Parameter | Type | Description |
|---|---|---|
origin |
string | ISO country code for filtering additional duties |
as_of |
date | Date for filtering additional duties (default: today) |
include_unknown_effective_dates |
boolean | Include duties with unknown dates (default: true) |
Example Request
const axios = require('axios');
const htsNumber = '8448.51.10.00';
const response = await axios.get(
`https://tariffsapi.com/api/v1/tariffs/by_hts/${htsNumber}`,
{
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
},
params: {
origin: 'CN',
include_unknown_effective_dates: true
}
}
);
console.log(response.data);
import requests
hts_number = '8448.51.10.00'
response = requests.get(
f'https://tariffsapi.com/api/v1/tariffs/by_hts/{hts_number}',
headers={'Authorization': 'Bearer YOUR_API_KEY'},
params={
'origin': 'CN',
'include_unknown_effective_dates': True
}
)
print(response.json())
require 'net/http'
require 'json'
hts_number = '8448.51.10.00'
params = {
origin: 'CN',
include_unknown_effective_dates: true
}
query_string = URI.encode_www_form(params)
uri = URI("https://tariffsapi.com/api/v1/tariffs/by_hts/#{hts_number}?#{query_string}")
request = Net::HTTP::Get.new(uri)
request['Authorization'] = 'Bearer YOUR_API_KEY'
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
http.request(request)
end
puts JSON.parse(response.body)
Note: The response includes detailed information about base duties, additional measures, and provides full transparency about data sources and inference confidence levels.