The Tariff API provides programmatic access to TariffBase tariff rate data, enabling you to integrate customs duty lookups directly into your internal systems -- such as ERP platforms, customs management software, supply chain tools, or e-commerce pricing engines.
Plan requirement: API access is available exclusively on the Professional plan.
Security: Treat your API token like a password. Do not expose it in client-side code, public repositories, or shared documents. If your token is compromised, contact support to have it regenerated.
All API requests must include your token in the Authorization header:
Authorization: Token your-api-token-here
Requests without a valid token will receive a 401 Unauthorized response.
Retrieve tariff rates for a specific product code between two trading partners.
Endpoint:
GET https://www.tariffbase.io/api/v1/tariff-rate/
| Parameter | Type | Required | Description |
|---|---|---|---|
code |
string | Yes | The HS code or national tariff code (e.g., 8703, 02013006, 870380) |
country |
string | Yes | The importing (destination) country code: CN, EU, or US |
partner |
string | Yes | The exporting (origin) country code (e.g., CN, US, DE, JP) |
cURL:
curl -X GET "https://www.tariffbase.io/api/v1/tariff-rate/?code=8703&partner=CN&country=US" \
-H "Authorization: Token your-api-token-here"
Python:
import requests
url = "https://www.tariffbase.io/api/v1/tariff-rate/"
headers = {"Authorization": "Token your-api-token-here"}
params = {
"code": "8703",
"partner": "CN",
"country": "US"
}
response = requests.get(url, headers=headers, params=params)
data = response.json()
print(data)
JavaScript (Node.js):
const response = await fetch(
"https://www.tariffbase.io/api/v1/tariff-rate/?code=8703&partner=CN&country=US",
{
headers: { "Authorization": "Token your-api-token-here" }
}
);
const data = await response.json();
console.log(data);
{
"code": "8703",
"description": "Motor cars and other motor vehicles",
"country": "US",
"partner": "CN",
"rates": [
{
"regime": "MFN",
"rate": "2.5%",
"notes": "Most Favored Nation rate"
},
{
"regime": "Additional-CHN-2024",
"rate": "+100%",
"notes": "Section 301 additional tariff"
}
],
"last_updated": "2025-01-15"
}
| Field | Type | Description |
|---|---|---|
code |
string | The queried tariff code |
description |
string | Product description from the tariff schedule |
country |
string | The importing country code |
partner |
string | The exporting country code |
rates |
array | List of applicable tariff regimes and their rates |
rates[].regime |
string | Name of the tariff regime (e.g., MFN, Section 301) |
rates[].rate |
string | The tariff rate as a percentage |
rates[].notes |
string | Additional context about the rate |
last_updated |
string | Date when the data was last refreshed (YYYY-MM-DD) |
To ensure platform stability and fair usage, the API enforces the following limits:
| Plan | Rate Limit |
|---|---|
| Professional | 10 requests per minute |
When you exceed the rate limit, the API returns a 429 Too Many Requests response. Wait before making additional requests. The response headers include information about when you can retry.
For applications that need to make frequent queries:
429 response, wait progressively longer before retrying.| Status Code | Description |
|---|---|
200 |
Success -- Request completed, data returned |
400 |
Bad Request -- Missing or invalid parameters |
401 |
Unauthorized -- Invalid or missing API token |
403 |
Forbidden -- API access not enabled for your subscription plan |
404 |
Not Found -- No tariff data found for the specified parameters |
429 |
Too Many Requests -- Rate limit exceeded |
500 |
Internal Server Error -- Contact support if this persists |
{
"error": "Invalid country code",
"message": "The country parameter must be one of: CN, EU, US",
"status": 400
}
| Error | Cause | Solution |
|---|---|---|
Invalid country code |
The country parameter is not CN, EU, or US |
Use one of the three supported country codes |
Missing required parameter |
A required parameter was omitted | Ensure code, country, and partner are all included |
No tariff data found |
The combination of code, country, and partner has no matching data | Verify the HS code exists in the destination country's schedule |
API access not enabled |
Your plan does not include API access | Upgrade to the Professional plan |
| Code | Market |
|---|---|
US |
United States |
EU |
European Union (all 27 member states) |
CN |
China |
The partner parameter accepts standard ISO country codes for any country. The availability of specific origin-destination rate data depends on the trade relationships and regimes in the destination country's schedule.