API Documentation
Programmatically calculate import tariffs with our powerful API.
Introduction
The Tariff Calculator API provides a simple and effective way to integrate international trade tariff calculations for goods imported into the United States into your applications. This service is exclusively available to our Business Plan subscribers.
With this API, you can automate tariff lookups, estimate landing costs, and build powerful logistics tools.
Authentication
API access is authenticated using an API Key. Each Business Plan user is provided with a unique API key.
You must include your API Key in the X-API-Key header of your request:
X-API-Key: YOUR_UNIQUE_API_KEYAPI Endpoint
All calculations are performed via a single endpoint:
/api/business/calculateRequest Body
The request body must be a JSON object with the following parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
hsCode | String | Yes | A 10-digit Harmonized System (HS) code. |
value | Number | Yes | The total value of the goods in USD. |
country | String | No | The 2-letter ISO code for the country of origin (e.g., "CN", "VN"). Defaults to "CN". |
entryDate | String | No | The estimated entry date in "yyyy-MM-dd" format. Defaults to the current date. |
transport | String | No | The mode of transport. Can be "OCEAN", "AIR", "RAIL", or "TRUCK". Defaults to "OCEAN". |
unitOfMeasures | Object | Conditional | Required if the tariff for the HS code is based on units. E.g., { "KG": 100 }. |
additionalFields | Object | No | Metal composition, user-selected tariff provisions, and other condition inputs. See additional fields below. |
Additional Fields — Tariff Conditions
Many HS codes require additional input fields for accurate duty calculation. This includes Section 232 tariffs (steel, aluminum, copper), US Content provisions (for goods with American-made components), and other special programs. Always provide these fields via the additionalFields parameter.
Important: When required fields are missing, the API now returns isIncomplete: true and an excludedCandidates array listing which tariff codes were skipped and why. Always check isIncomplete in every response — it covers ALL tariff provisions generically, not just Section 232.
Use /api/tariff/info to inspect the inputs that may affect a given HS code:
User-selected tariff provisions
Some tariff provisions depend on facts that only you can confirm. The calculation response includes userSelectionCandidates, each with a code, label, and description. The same list is available from GET /api/tariff/info with hsCode, entryDate, and country query parameters. Review the provision before selecting it; its presence does not mean your goods qualify.
To apply a qualifying provision, send its code in additionalFields.CHOSEN_HTS_CODES with the boolean value true. Use false to explicitly decline it. An omitted code is treated as unselected. An unselected optional provision does not set isIncomplete.
{
"hsCode": "6301400020",
"value": 1000,
"country": "CN",
"entryDate": "2026-09-22",
"additionalFields": {
"CHOSEN_HTS_CODES": { "99030591": true }
}
}GET /api/tariff/info
Returns tariff metadata for an HS code, including metal profiles and user selection candidates.
/api/tariff/info?hsCode=7326901000The response includes a metalProfiles field when Section 232 fields are needed:
{
"metalProfiles": {
"STEEL": {
"label": "Steel / Iron",
"fields": ["STEEL_PERCENTAGE", "STEEL_COUNTRY_OF_POUR"]
},
"ALUMINUM": {
"label": "Aluminum",
"fields": ["ALUMINUM_COUNTRY_OF_SMELT"]
}
}
}When metalProfiles is present, include the corresponding fields in your additionalFields:
additionalFields Reference
| Field | Type | Profile | Description |
|---|---|---|---|
STEEL_PERCENTAGE | Number | STEEL | Percentage of steel/iron in the product (0–100). |
STEEL_COUNTRY_OF_POUR | String | STEEL | 2-letter ISO code of the country where the steel was poured/melted. Defaults to country if steel > 0. |
ALUMINUM_PERCENTAGE | Number | ALUMINUM | Percentage of aluminum in the product (0–100). |
ALUMINUM_COUNTRY_OF_SMELT | String | ALUMINUM | 2-letter ISO code of the country where the aluminum was smelted. Defaults to country if aluminum > 0. |
COPPER_PERCENTAGE | Number | COPPER | Percentage of copper in the product (0–100). |
COPPER_WEIGHT_PERCENTAGE | Number | METAL_WEIGHTS | Copper weight percentage (0–100). Used for certain composite metal articles. |
US_CONTENT_PERCENTAGE | Number | US_CONTENT | Percentage of US-origin content in the product (0–100). |
CHOSEN_HTS_CODES | Object | USER_SELECTION | Map of candidate HTS codes to booleans. Set a code to true only after confirming the provision applies. |
Without these fields, Section 232 tariffs will not be applied!
If your HS code has metalProfiles in the /api/tariff/info response but you don't provide additionalFields, the calculation result will be incomplete — missing additional steel/aluminum/copper duties.
Always check isIncomplete in the API response. When true, the excludedCandidates array lists which tariff codes were skipped and what fields were missing. This warning system is generic — it works for any future tariff provisions, not just Section 232.
Steel Example (7326.90.1000 from Ukraine, 50% steel)
curl -X POST 'https://tariff.synnaxstudio.com/api/business/calculate' \
-H 'Content-Type: application/json' \
-H 'X-API-Key: YOUR_UNIQUE_API_KEY' \
-d '{
"hsCode": "7326901000",
"value": 10000,
"country": "UA",
"transport": "OCEAN",
"additionalFields": {
"STEEL_PERCENTAGE": 50,
"STEEL_COUNTRY_OF_POUR": "UA"
}
}'cURL Example
curl -X POST 'https://tariff.synnaxstudio.com/api/business/calculate' \
-H 'Content-Type: application/json' \
-H 'X-API-Key: YOUR_UNIQUE_API_KEY' \
-d '{
"hsCode": "6201201120",
"value": 15000,
"country": "VN",
"entryDate": "2025-08-15",
"transport": "OCEAN",
"unitOfMeasures": {
"KG": 100
},
"additionalFields": {
"STEEL_PERCENTAGE": 0,
"ALUMINUM_PERCENTAGE": 0,
"COPPER_PERCENTAGE": 0,
"US_CONTENT_PERCENTAGE": 0
}
}'Response Format
Success Response (200 OK)
A successful request will return a JSON object with the calculated duties.
{
"totalDuty": "3986",
"dutyRate": "0.26573333333333333333",
"hmf": "18.75",
"mpf": "51.96",
"duties": [
{
"hscode": "99030125",
"value": "1500",
"fullDescription": "Articles the product of any country, except for products described in headings 9903.01.26–9903.01.33, 9903.02.02–9903.02.91, 9903.96.01, and 9903.96.02, and except as provided for in headings 9903.01.34 and 9903.02.01, as provided for in subdivision (v) of U.S. note 2 to this subchapter",
"label": "IEEPA Reciprocal All Country 10%",
"rateDescription": "The duty provided in the applicable subheading + 10%"
},
{
"hscode": "6201201120",
"value": "2486",
"fullDescription": "Men's or boys' overcoats, carcoats, capes, cloaks, anoraks (including ski jackets), windbreakers and similar articles (including padded, sleeveless jackets), other than those of heading 6203: > Of wool or fine animal hair: > Overcoats, carcoats, capes, cloaks and similar coats: > Boys' (434)",
"label": "",
"rateDescription": "41¢/kg + 16.3%"
}
],
"isIncomplete": false,
"excludedCandidates": [],
"userSelectionCandidates": [
{
"code": "99030130",
"label": "IEEPA Reciprocal Donation Exclusion",
"description": "Articles that are donations, by persons subject to the jurisdiction of the United States, such as food, clothing, and medicine, intended to be used to relieve human suffering, as provided for in subdivision (v)(ii) of U.S. note 2 to this subchapter"
}
]
}Field Descriptions:
| Field | Type | Description |
|---|---|---|
totalDuty | String | Null | The total calculated tariff amount in USD. When isIncomplete is true, one or more duty lines were excluded, so this figure may be understated — always check isIncomplete and excludedCandidates. |
dutyRate | String | Null | The effective duty rate as a decimal (totalDuty / value). Equally understated when isIncomplete is true. |
hmf | String | Null | Harbor Maintenance Fee. Only applicable for ‘OCEAN‘ transport, otherwise null. |
mpf | String | Null | Merchandise Processing Fee. Returns null if the shipment is exempt (e.g., due to a special trade agreement). |
duties | Array | An array of objects detailing each component of the tariff. See table below. |
isIncomplete | Boolean | New: true when one or more tariff codes were silently skipped because required input fields (such as metal composition) were not provided. The result may be significantly understated. Always check this field. |
excludedCandidates | Array | New: List of tariff codes that were excluded from the calculation due to missing input fields. Each entry contains code, description, missingField, profile, and profileLabel. Empty when all required fields are provided. |
userSelectionCandidates | Array | Optional provisions for this HS code and date/country. Each entry has code, label, and description. Send a confirmed code in additionalFields.CHOSEN_HTS_CODES to recalculate. |
Duties Object Structure:
| Field | Type | Description |
|---|---|---|
hscode | String | The HS code for this specific duty component. |
value | String | Null | The calculated value for this duty component. |
fullDescription | String | The official description of the HS code. |
label | String | The name of the tariff or program being applied (e.g., "Normal Trade Relations"). |
rateDescription | String | A human-readable description of the rate (e.g., "1.0%"). |
Error Responses
If an error occurs, the API will return a non-200 status code and a JSON body with an error field.
| Status Code | Meaning | Reason |
|---|---|---|
400 | Bad Request | A required parameter is missing or has an invalid format (e.g., an invalid HS code). |
The HS code requires a unit of measure, but it was not provided in the unitOfMeasures object. | ||
| The request specifies a restricted country of origin (e.g., Russia, Belarus, Cuba, North Korea). | ||
401 | Unauthorized | The API Key is missing or invalid. |
403 | Forbidden | The user is not a Business Plan subscriber. |
404 | Not Found | The provided HS code could not be found. |
429 | Too Many Requests | The user has exceeded their monthly API quota. |
500 | Internal Server Error | An unexpected error occurred on the server. |
Example: Unit of Measure Required (400)
{
"error": "Unit of measure is required for this HS Code.",
"unit_requirement": {
"required": true,
"unit": "KG",
"available": ["DOZ", "KG"]
}
}This error occurs when an HS code requires a unit of measure that was not provided. To resolve it:
- Inspect the error for the
unit_requirementobject. - Use the unit from the
unitfield (e.g., "KG"). - Add it to the
unitOfMeasuresparameter in your next call.
Example: Quota Exceeded (429)
{
"error": "Monthly API quota exceeded. Limit: 2500 calls per period.",
"period_start": "2024-08-10T00:00:00.000Z",
"period_end": "2024-09-09T23:59:59.999Z"
}API Quota
Business Plan subscribers are entitled to 2,500 API calls per monthly billing cycle. Your usage resets at the beginning of each cycle, which is based on your original subscription date. You can monitor your current usage on the API Usage page.