The same engine behind the Airlift USA tariff simulator is open over plain HTTP. Estimate U.S. import duty, the Merchandise Processing Fee, the Harbor Maintenance Fee and landed cost from an HTS code, a country of origin and a customs value. No key, no signup.
Prefer not to write any code? Drop the widget below onto your own site with two lines of HTML.
Try it
This is the shipped widget, loaded from /widget/tariff-widget.js and calling the live API β the same file and the same endpoint your embed will use.
Embed the widget
Paste this where you want the calculator to appear. It is dependency-free, renders inside a Shadow DOM so it cannot collide with your styles, and weighs about 6 KB gzipped.
Pre-selects the country of origin by ISO 2-letter code, e.g. IN.
data-value
Pre-fills the customs value in USD.
data-entry-date
Pre-fills the entry date as YYYY-MM-DD. Defaults to today.
data-transport-mode
ocean (default), air, truck, rail or mail. Only vessel arrivals pay the Harbor Maintenance Fee.
Nothing is calculated until a visitor presses the button, so an embed costs you no API calls on page load. Add the class airlift-tariff-widget to more than one element to put several instances on a page. If the API is unreachable or you hit the rate limit, the widget keeps the form filled in, explains what happened, and links through to the full simulator rather than going blank.
Endpoints
Base URL https://api.myairliftusa.com/api/tariff. Everything is JSON, and CORS is open, so browser clients work without a proxy. Send X-Airlift-Client: your-app/1.0 to identify your integration; it is logged, never required, and does not change your limit.
POST/api/tariff/calculate
Estimates duty, customs fees and landed cost for one HTS code, country of origin and customs value.
Reports which rule set and schedule edition answered you. Compare measures_version against the value inside a cached calculation to know when to recompute.
Quantity in unit. Only matters for specific (per-unit) rates.
unit
string
No
Unit of quantity, e.g. kg or No.
entry_date
string
No
YYYY-MM-DD, defaults to today. Rates are dated, so this changes the answer.
transport_mode
string
No
ocean (default), air, truck, rail, mail.
usmca_qualifying
boolean
No
Goods of Canada or Mexico meeting USMCA rules of origin.
us_content_share
number
No
0β1 share of U.S. content in a USMCA-qualifying vehicle.
fta_qualifying
boolean
No
Whether a preferential claim will be made when the origin is eligible. Defaults to true.
civil_aircraft
boolean
No
Entered under the civil-aircraft certification (General Note 6).
Reading the response
breakdown.tariff_components[] is the duty stack: one row per measure applied β the Column 1 General, Special or Column 2 base rate, then any Chapter 99 additional-duty lines β each with its own hts_code, description, rate and duty_amount. The top-level duty_amount is their sum. mpf and hmf are the two statutory customs fees, and landed_cost is value plus duty plus those fees. assumptions[] lists everything the engine had to assume β show it to your users alongside the number.
Error codes
Status
When
Body
400 Bad Request
Malformed JSON, or a request that fails validation: bad HTS format, unknown country, non-positive value, unparseable entry_date.
Plain text
404 Not Found
The HTS code is not in the current schedule.
Plain text: HTS code not found
429 Too Many Requests
You are over the rate limit. Read Retry-After and back off for at least that many seconds.
JSON: {"error":"rate limit exceeded"}
500 Internal Server Error
A server or upstream failure. Retry with backoff.
Plain text
Only the 429 body is JSON; the rest are plain text. Read the status code rather than parsing the body.
Rate limits
Limits are per client IP, enforced with a token bucket. Your address is the first hop of X-Forwarded-For when present, otherwise the socket address.
Every response carries X-RateLimit-Limit and X-RateLimit-Remaining. When the bucket empties you get 429 with a Retry-After header in whole seconds and {"error":"rate limit exceeded"}. Back off for at least that long. CORS preflights are not charged.
Cache aggressively. /countries and /version change a handful of times a year, and a calculation for the same hts_code, origin_country and entry_date is stable until the schedule moves β which measures_version tells you about. If you need more headroom than this, talk to us rather than working around the limit.
Attribution
The API is free, and attribution is what it costs. Any public-facing use of the API or the widget must carry a visible credit that links back to the simulator:
Powered by <a href="https://airliftusa.com/tariff-simulator">Airlift USA Tariff Simulator</a>
The widget renders that line itself, on every embed, and there is no option to turn it off. If you are calling the API directly, put the same credit next to the numbers you display.
Methodology and changes
Additional-duty logic follows the tariff schedule's Chapter 99 text, and is validated against broker-filed entry summaries and Census records of the duty CBP actually collects. The Chapter 99 lines you see in breakdown.tariff_components[] are the ones brokers file.
entry_date selects the regime in force on that date, so changing it can legitimately change the result. Every calculation carries the measures_version that produced it, and GET /api/tariff/version reports the rule set, the USITC schedule edition currently loaded, and the build of the running engine. Compare the version in a cached result against the live one to know when to recompute.
Terms
Figures are estimates for planning purposes only, provided as is and without warranty of any kind, express or implied.
U.S. Customs and Border Protection determines the final duty owed on any entry. Classification remains the importer's responsibility.
Duty rates, exclusions and additional-duty programs change frequently. A result is a snapshot of the rule set named in measures_version, not a quotation.
Anti-dumping and countervailing duties, excise taxes, quota and admissibility holds are out of scope. So are freight, insurance and brokerage charges.
Nothing returned by this API is customs, legal or tax advice.
Airlift USA arranges customs clearance through our licensed broker network. Before you rely on a number for an actual entry, have it checked with us.
Related
Tariff simulator β the full calculator, with import statistics and worked examples.