Developer Documentation
API Reference
Integrate tariff data into your applications. All endpoints return JSON and require Bearer token authentication.
Authentication
All API requests require a valid API key sent in the Authorization header. Generate API keys from your dashboard.
HTTP Header
Authorization: Bearer tc_live_a1b2c3d4...Base URL
URL
https://tariffcenter.aiRate Limits
| Plan | Per Minute | Monthly |
|---|---|---|
| free | 10/min | 100 |
| essential | 30/min | 2,000 |
| starter | 60/min | 10,000 |
| pro | 120/min | 50,000 |
| business | 300/min | 200,000 |
Rate limit headers are included in every response: X-RateLimit-Limit, X-RateLimit-Remaining, Retry-After.
Endpoints
POST
/api/v1/searchSearch Products
Semantic search across all HTS codes by product description.
Example Request
cURL
curl -X POST https://tariffcenter.ai/api/v1/search \
-H "Authorization: Bearer tc_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"query":"stainless steel kitchen knife","limit":5}'Python
import requests
resp = requests.post(
"https://tariffcenter.ai/api/v1/search",
headers={"Authorization": "Bearer tc_live_YOUR_KEY"},
json={
"query": "stainless steel kitchen knife",
"limit": 5
},
)
data = resp.json()
print(data)JavaScript
const resp = await fetch("https://tariffcenter.ai/api/v1/search", {
method: "POST",
headers: {
"Authorization": "Bearer tc_live_YOUR_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({"query":"stainless steel kitchen knife","limit":5}),
});
const data = await resp.json();
console.log(data);TypeScript
const resp = await fetch("https://tariffcenter.ai/api/v1/search", {
method: "POST",
headers: {
Authorization: "Bearer tc_live_YOUR_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({"query":"stainless steel kitchen knife","limit":5}),
});
interface ApiResponse<T> {
success: boolean;
data: T;
meta: { request_id: string; rate_limit: { limit: number; remaining: number; reset: string } };
}
const { data, meta } = (await resp.json()) as ApiResponse<Record<string, unknown>>;POST
/api/v1/classifyClassify / Lookup HS Code
Retrieve full details for a specific HTS code including duty rates.
Example Request
cURL
curl -X POST https://tariffcenter.ai/api/v1/classify \
-H "Authorization: Bearer tc_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"hs_code":"8211.91.25"}'Python
import requests
resp = requests.post(
"https://tariffcenter.ai/api/v1/classify",
headers={"Authorization": "Bearer tc_live_YOUR_KEY"},
json={
"hs_code": "8211.91.25"
},
)
data = resp.json()
print(data)JavaScript
const resp = await fetch("https://tariffcenter.ai/api/v1/classify", {
method: "POST",
headers: {
"Authorization": "Bearer tc_live_YOUR_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({"hs_code":"8211.91.25"}),
});
const data = await resp.json();
console.log(data);TypeScript
const resp = await fetch("https://tariffcenter.ai/api/v1/classify", {
method: "POST",
headers: {
Authorization: "Bearer tc_live_YOUR_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({"hs_code":"8211.91.25"}),
});
interface ApiResponse<T> {
success: boolean;
data: T;
meta: { request_id: string; rate_limit: { limit: number; remaining: number; reset: string } };
}
const { data, meta } = (await resp.json()) as ApiResponse<Record<string, unknown>>;POST
/api/v1/ratesGet Tariff Rate
Get the effective tariff rate for an HS code imported from a specific country.
Example Request
cURL
curl -X POST https://tariffcenter.ai/api/v1/rates \
-H "Authorization: Bearer tc_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"hs_code":"8211.91.25","country_code":"CN"}'Python
import requests
resp = requests.post(
"https://tariffcenter.ai/api/v1/rates",
headers={"Authorization": "Bearer tc_live_YOUR_KEY"},
json={
"hs_code": "8211.91.25",
"country_code": "CN"
},
)
data = resp.json()
print(data)JavaScript
const resp = await fetch("https://tariffcenter.ai/api/v1/rates", {
method: "POST",
headers: {
"Authorization": "Bearer tc_live_YOUR_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({"hs_code":"8211.91.25","country_code":"CN"}),
});
const data = await resp.json();
console.log(data);TypeScript
const resp = await fetch("https://tariffcenter.ai/api/v1/rates", {
method: "POST",
headers: {
Authorization: "Bearer tc_live_YOUR_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({"hs_code":"8211.91.25","country_code":"CN"}),
});
interface ApiResponse<T> {
success: boolean;
data: T;
meta: { request_id: string; rate_limit: { limit: number; remaining: number; reset: string } };
}
const { data, meta } = (await resp.json()) as ApiResponse<Record<string, unknown>>;POST
/api/v1/landed-costCalculate Landed Cost
Compute total landed cost including all duties and surcharges.
Example Request
cURL
curl -X POST https://tariffcenter.ai/api/v1/landed-cost \
-H "Authorization: Bearer tc_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"hs_code":"8211.91.25","country_code":"CN","declared_value":10000,"quantity":1}'Python
import requests
resp = requests.post(
"https://tariffcenter.ai/api/v1/landed-cost",
headers={"Authorization": "Bearer tc_live_YOUR_KEY"},
json={
"hs_code": "8211.91.25",
"country_code": "CN",
"declared_value": 10000,
"quantity": 1
},
)
data = resp.json()
print(data)JavaScript
const resp = await fetch("https://tariffcenter.ai/api/v1/landed-cost", {
method: "POST",
headers: {
"Authorization": "Bearer tc_live_YOUR_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({"hs_code":"8211.91.25","country_code":"CN","declared_value":10000,"quantity":1}),
});
const data = await resp.json();
console.log(data);TypeScript
const resp = await fetch("https://tariffcenter.ai/api/v1/landed-cost", {
method: "POST",
headers: {
Authorization: "Bearer tc_live_YOUR_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({"hs_code":"8211.91.25","country_code":"CN","declared_value":10000,"quantity":1}),
});
interface ApiResponse<T> {
success: boolean;
data: T;
meta: { request_id: string; rate_limit: { limit: number; remaining: number; reset: string } };
}
const { data, meta } = (await resp.json()) as ApiResponse<Record<string, unknown>>;POST
/api/v1/policySearch Policy Documents
Semantic search across tariff policy documents, executive orders, and notices.
Example Request
cURL
curl -X POST https://tariffcenter.ai/api/v1/policy \
-H "Authorization: Bearer tc_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"query":"China Section 301 exclusions"}'Python
import requests
resp = requests.post(
"https://tariffcenter.ai/api/v1/policy",
headers={"Authorization": "Bearer tc_live_YOUR_KEY"},
json={
"query": "China Section 301 exclusions"
},
)
data = resp.json()
print(data)JavaScript
const resp = await fetch("https://tariffcenter.ai/api/v1/policy", {
method: "POST",
headers: {
"Authorization": "Bearer tc_live_YOUR_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({"query":"China Section 301 exclusions"}),
});
const data = await resp.json();
console.log(data);TypeScript
const resp = await fetch("https://tariffcenter.ai/api/v1/policy", {
method: "POST",
headers: {
Authorization: "Bearer tc_live_YOUR_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({"query":"China Section 301 exclusions"}),
});
interface ApiResponse<T> {
success: boolean;
data: T;
meta: { request_id: string; rate_limit: { limit: number; remaining: number; reset: string } };
}
const { data, meta } = (await resp.json()) as ApiResponse<Record<string, unknown>>;Response Format
Success (200)
JSON
{
"success": true,
"data": {
"...": "..."
},
"meta": {
"request_id": "550e8400-e29b-41d4-a716-446655440000",
"rate_limit": {
"limit": 60,
"remaining": 59,
"reset": "2026-03-01T00:00:00.000Z"
},
"api_calls": {
"used": 42,
"monthly_limit": 10000
}
}
}Error (4xx/5xx)
JSON
{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "hs_code is required"
}
}Error Codes
| Code | HTTP | Description |
|---|---|---|
| UNAUTHORIZED | 401 | Missing or invalid API key |
| VALIDATION_ERROR | 400 | Invalid request parameters |
| NOT_FOUND | 404 | Resource not found |
| RATE_LIMITED | 429 | Per-minute rate limit exceeded |
| MONTHLY_LIMIT_EXCEEDED | 429 | Monthly API call limit reached |
| IP_BLOCKED | 403 | IP address blocked due to abuse |
| PAYLOAD_TOO_LARGE | 413 | Request body exceeds 100KB |
| BAD_REQUEST | 400 | Invalid or empty JSON body |