Skip to content

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.ai

Rate Limits

PlanPer MinuteMonthly
free10/min100
essential30/min2,000
starter60/min10,000
pro120/min50,000
business300/min200,000

Rate limit headers are included in every response: X-RateLimit-Limit, X-RateLimit-Remaining, Retry-After.

Endpoints

POST/api/v1/classify

Classify / 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/rates

Get 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-cost

Calculate 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/policy

Search 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

CodeHTTPDescription
UNAUTHORIZED401Missing or invalid API key
VALIDATION_ERROR400Invalid request parameters
NOT_FOUND404Resource not found
RATE_LIMITED429Per-minute rate limit exceeded
MONTHLY_LIMIT_EXCEEDED429Monthly API call limit reached
IP_BLOCKED403IP address blocked due to abuse
PAYLOAD_TOO_LARGE413Request body exceeds 100KB
BAD_REQUEST400Invalid or empty JSON body