ExportSonar Pro — $49/mo: daily rate checks on up to 100 watched HS codes (free accounts watch 5) and a rate-change feed with the old rate, new rate and USITC source. Checkout in USDT (TRC20) — no card payments.

Get Pro via USDT Start free

API Reference

No signup for read-only endpoints

Programmatic access to US tariff rates and HS-code data. All endpoints are live in production under the base URL prefix https://exportsonar.com/api/v1/ — an API namespace, not a browsable page; call a concrete endpoint such as https://exportsonar.com/api/v1/health. Every example value below is derived from the current HTS dataset and is re-executed against the deployed API by this site’s contract gate.

Data vintage: 2026-11-06 · 23,193 tariff lines across 96 data-bearing chapters · interactive OpenAPI spec at /api/docs

Data source notice: distribution of Colombia's DIAN «Directorio de Importadores» is withdrawn — reuse of the register is PROHIBITED by the publisher's own terms (https://www.dian.gov.co/Paginas/Privacidad.aspx, read 2026-11-07), which grant no licence of any kind and bar use of the contents for private or for-profit services. The endpoint that served it is not listed among the operations below, because an operation this page lists is one the service can serve. Every other endpoint on this page is unaffected.

Authentication & quotas

ModeHeaderQuota
Anonymous—Unlimited, no signup
Metered (paid)X-API-Key: <key>Prepaid credits, $0.06 per call list rate — $0.05/call via the $10 credit pack (save ~17%)

The rate endpoints (/api/v1/tariff, /lookup, /remedies, /health) serve anonymous callers without a key. A metered call needs an X-API-Key and debits prepaid credits; the rate endpoints have no identity requirement.

A metered rate call debits exactly one credit, and every tariff response carries credits_remaining (an integer for keyed callers, null for anonymous ones). Errors: 401 INVALID_API_KEY, 402 INSUFFICIENT_CREDITS.

The 402 body is also a recovery surface: links to pricing/signup/ checkout, an instant top-up deep link, and a subscribe_hint object that names the standing email-capture endpoint (POST /api/v1/subscribe, field email). Fields:

FieldMeaning
erroralways INSUFFICIENT_CREDITS
messagehuman-readable line; safe to render verbatim
capture_emailtrue — the surface wants an email
subscribe_hint{method, url, field}: POST the address to url as {field}
pricing_url / signup_url / checkout_urlrecovery links for this visitor
upgrade_urldirect deep link to the paid tier
unlock_url, unlock_messageinstant top-up ($10 / 200 credits) + its label
unlock_free_url, unlock_free_messagethe no-payment alternative + its label
crypto_pay_url, crypto_api_urlthe USDT-TRC20 rail that needs no card

Prepaid metering is self-serve: Buy 200 credits — $10 — that bridge answers HTTP 302 into the live pay page (/pay/credits-200/). One credit per successful metered rate call; credits never expire, and they buy rate calls only.

GET /api/v1/health

Liveness probe with dataset dimensions and per-source data freshness. No parameters, no auth. status is ok or degraded; inputs names the required data files the tariff chain opens and lists any that are missing on this host (inputs.missing). A degraded status still answers HTTP 200 — it reports an incomplete deployment rather than pretending to be a dead API — and it is the machine-readable signal that origin-parametrised tariff calls will answer 503 until the feed is repaired.

curl https://exportsonar.com/api/v1/health
# => {
#      "ok": "...",
#      "status": "...",
#      "rows": 23193,
#      "chapters": 96,
#      "data_vintage": {
#        "...": "per-source as-of/status blocks"
#      },
#      "freshness": {
#        "...": "per-source verdict: ok|failed|unknown|stale, plus offenders and the declared partials"
#      },
#      "alerts": {
#        "...": "patrol-scan freshness: status, ok, last_scan_utc, scan_age_hours, scan_cadence_hours, budget_hours, ledger_rows, feed_entries, state_present"
#      },
#      "inputs": {
#        "ok": true,
#        "required": 12,
#        "missing": [],
#        "unreadable": [],
#        "present": [
#          {
#            "...": "the required input filenames present on this host"
#          }
#        ]
#      }
#    }

GET /api/v1/tariff

Duty estimate for one HTS line. Query parameters:

ParamRequiredNotes
hsyesdotted or bare; 8-digit base lines auto-fall-back to the 10-digit statistical suffix
originyesISO country of origin (upper-cased server-side; unknown codes simply match no preferential/301 layer)
valueyescustoms value in USD; must be a finite number > 0
qtynoquantity for specific duties; must be finite and ≥ 0 (0 is accepted, negative is rejected)
unitnounit qualifier for qty (lower-cased server-side); requires.unit_options lists the accepted spellings
destnodestination jurisdiction as an ISO 3166-1 alpha-2 code. This API prices one destination jurisdiction (the United States); dest=US is the priced case: every duty figure is the same as if you omitted it, and the only difference is that jurisdiction.requested echoes US rather than null. Any other well-formed code is answered with jurisdiction.priced_for_requested: false and notice_code: DEST_NOT_PRICED — the US figures are still returned, and the body says they are US figures rather than silently substituting them. A malformed value is 400 INVALID_DEST
curl "https://exportsonar.com/api/v1/tariff?hs=0101.30.00.00&origin=CN&value=1000"
# => {
#      "query": {
#        "hs": "0101.30.00.00",
#        "hs_normalized": "0101.30.00.00",
#        "origin": "CN",
#        "value": 1000.0,
#        "qty": null,
#        "unit": null
#      },
#      "match": {
#        "hts": "0101.30.00.00",
#        "description": "Asses",
#        "unit": "No."
#      },
#      "rate": {
#        "basis": "percent",
#        "status": "computed",
#        "automatable": true,
#        "duty_form": "~ad_valorem|specific|compound|free|unparsed (rates.duty_form; the same classifier the census uses)",
#        "requires": null,
#        "requires_quantity": false,
#        "quantity_basis": null,
#        "ad_valorem_part": {
#          "pct": 6.8,
#          "usd": 68.0
#        },
#        "general": "6.8%",
#        "column1": "~the Column 1 general cell, as published",
#        "column2": "~the Column 2 cell, or the empty string when the schedule carries none for this line",
#        "rate_column": "...",
#        "base_rate_basis": "~why that column applies (e.g. column_1_ntr)",
#        "base_duty_pct": 6.8,
#        "ad_valorem_pct": 6.8,
#        "specific": null,
#        "duty_usd": 268.0,
#        "note": "~Column 1 provenance + which layers were folded in",
#        "base_duty_usd": 68.0,
#        "surcharge_usd": 200.0,
#        "surcharge_ad_valorem_pct": 20.0,
#        "surcharge_label": "~name of the surcharge that produced it",
#        "total_duty_usd": 268.0
#      },
#      "credits_remaining": null,
#      "policy_layers": [
#        {
#          "...": "one sourced layer per duty that applies"
#        }
#      ],
#      "landed_cost": {
#        "complete": false,
#        "total_usd": null,
#        "components_subtotal_usd": 303.83,
#        "duty_mpf_hmf_usd": 303.83,
#        "duty_usd": 268.0,
#        "mpf_usd": 34.58,
#        "hmf_usd": 1.25,
#        "freight_usd": 0.0,
#        "insurance_usd": 0.0,
#        "missing": [
#          {
#            "...": "inputs the caller still owes (e.g. freight_usd)"
#          }
#        ],
#        "components": [
#          {
#            "...": "one {key, label, amount_usd, provided, detail, source} per entry charge"
#          }
#        ],
#        "notes": [
#          {
#            "...": "what this total does NOT include"
#          }
#        ],
#        "identity": "total_usd = duty_usd + mpf_usd + hmf_usd + freight_usd + insurance_usd (tolerance 0.02)",
#        "schedule_identity": "duty_mpf_hmf_usd = duty_usd + mpf_usd + hmf_usd (tolerance 0.02) -- the charges the schedule imposes at entry, excluding any freight or insurance the caller supplied",
#        "scope": "Estimated US federal duty and entry fees, plus the freight and insurance you supplied. The goods value is not included; neither are brokerage, bonds, drayage, AD/CVD cash deposits or state and local charges."
#      },
#      "coverage": {
#        "...": "what the total does NOT include"
#      },
#      "jurisdiction": {
#        "served": "US",
#        "served_name": "United States",
#        "requested": null,
#        "priced_for_requested": true,
#        "priced_destinations": [
#          "US"
#        ],
#        "basis": "~the schedule and measure families this answer prices",
#        "rate_column_basis": {
#          "applied_column": "...",
#          "reason": "~why that column applies",
#          "column1": "~the Column 1 general cell",
#          "column2": "~the Column 2 cell, or null",
#          "column2_pct": "...",
#          "column2_origins": "...",
#          "rule": "~the General Note 3 sentence this rule was read from",
#          "source_url": "...",
#          "retrieved_at": "..."
#        }
#      },
#      "data_vintage": {
#        "...": "per-source as-of/status blocks"
#      },
#      "ch99_clock": {
#        "...": "which Chapter 99 measures are in force for this entry date, per heading family"
#      },
#      "void_layers": [
#        {
#          "...": "one entry per layer that is NOT in the total, with the authority that ended it"
#        }
#      ],
#      "authority_summary": {
#        "...": "census of the layer authorities: in force / expired / void / uncertain"
#      },
#      "resolution": {
#        "typed": "0101.30.00.00",
#        "level": "line",
#        "how": "~exact|bare -- which index the typed code matched",
#        "matched": "0101.30.00.00",
#        "ambiguous": false,
#        "n_candidates": 1,
#        "truncated": false,
#        "candidate_level": "line",
#        "candidates": [
#          {
#            "hts": "0101.30.00.00",
#            "description": "Asses"
#          }
#        ]
#      }
#    }

Sketch convention: a "..." key marks content elided from the sketch (the elided shape is named in its value). Everything else is reproduced verbatim by a live call.

The worked numbers above are the live answer for that line and origin: duty_usd is the Column 1 duty (68.0) plus the Section 301 additional duty (200.0 at 20.0% of value). Change origin and the surcharge disappears with the layer.

trade_remedy is appended only when a Chapter 99 trade-remedy provision matches the line; the array carries the provision code, action heading and its source. The rate block always carries these fields:

FieldMeaning
basisfree | percent | specific | compound | unparsed | chapter99_provision — how the Column 1 text parsed
statuscomputed (a dollar figure is claimed) | free | requires_quantity | not_automatable (cross-reference / prose text)
automatableboolean shorthand for status != not_automatable
requiresnull, or {quantity, unit, unit_options, reason} when a specific/compound line still needs a qty
duty_formad_valorem | specific | compound | free | unparsed — the canonical four-way classifier; the same function feeds the duty-form census, so the two cannot disagree about a line
requires_quantityboolean shorthand for status == requires_quantity; the one flag a client must branch on to avoid printing a dollar figure it does not have
quantity_basiswhat a quantity would be measured in on this line (null when the line is purely ad valorem)
ad_valorem_partthe percent-of-value half priced on your value. On a compound line this is computable now while the per-unit half still waits for a weight, so the honest “not computable” does not hide the part that is
generalthe raw Column 1 general-rate text from the HTS
ad_valorem_pctnumeric ad valorem part, or null on a non-ad-valorem line
specific{amount_per_unit, per} on specific/compound lines, else null
base_duty_usdColumn 1 general duty alone (USD)
surcharge_usdadditive origin duties folded in (Section 301, Chapter 99 origin measures, and the IEEPA / reciprocal country blocks), USD
surcharge_ad_valorem_pcteffective additional percentage of customs value
duty_usd / total_duty_usdbase + surcharge (the two are equal by contract); null whenever no honest total can be claimed
noteprovenance prose: which rate was applied and which layers were folded in
not_automatable_reasonpresent only when status == not_automatable (e.g. cross_reference)

Every priced answer also carries a jurisdiction block, which is the machine-readable statement of which destination jurisdiction the figures belong to. This API prices one destination jurisdiction — the United States, from the USITC HTS plus US Chapter 99 measures — so a request that names any other destination is answered with the US figures and with priced_for_requested: false:

FieldMeaning
servedthe destination jurisdiction whose schedule priced this answer (always US on this deployment)
served_namethat jurisdiction in words
requestedthe dest the caller sent, upper-cased, or null when none was sent
priced_for_requestedtrue when the figures belong to the requested destination (which includes the no-dest case)
priced_destinationsevery destination this deployment can price; the list is the machine-readable form of “one jurisdiction”
basiswhich schedule and measure families the figures come from
notice_codepresent only when priced_for_requested is false: DEST_NOT_PRICED
noticea sentence naming the requested destination, safe to render verbatim; present on the same condition as notice_code

Why this exists: a destination parameter that is accepted and then dropped is worse than one that is refused, because the caller cannot tell the difference between a priced answer and a substituted one. Publishing the served jurisdiction in the body means a client can branch on notice_code instead of parsing prose, and a reader can never mistake a US duty figure for a landed cost somewhere else. Adding a second destination is a data decision (its own schedule, its own source URL and as-of stamp), not a change to this contract.

Errors: 400 MISSING_PARAM, 400 INVALID_VALUE, 400 INVALID_DEST (a dest that is not an ISO 3166-1 alpha-2 code — note that a valid but unpriced code is a 200 with DEST_NOT_PRICED, not an error), 404 HTS_NOT_FOUND, 503 INPUT_UNAVAILABLE (a required data input is missing on this host — the body names it in missing[], and the lookup is refused rather than answered with a partial rate), plus the auth errors above. A cross- reference or prose rate is never guessed at: you get status: not_automatable and duty_usd: null instead of a number.

POST /api/v1/tariff/batch

Bulk resolve up to 200 HTS lines in one request, paced at 30/minute. Each row is resolved by the same handler as the single GET, so a row can never disagree with the corresponding single call. No credential is needed for an upload of up to 10 rows; a larger upload is part of a paid plan — a Pro session or a live X-API-Key both lift one request to the 200-row ceiling, and a key additionally debits one credit per successfully resolved row. Over the free budget the route refuses the WHOLE request before pricing any row (401 IDENTITY_REQUIRED with no session, 403 PRO_REQUIRED on a free account), so no partial answer and no charge is ever produced.

curl -X POST https://exportsonar.com/api/v1/tariff/batch \
  -H "Content-Type: application/json" \
  -d '{"items": [{"hs": "0101.30.00.00", "origin": "CN", "value": 1000}]}'
# => {
#      "count": 1,
#      "results": [
#        {
#          "index": 0,
#          "ok": true,
#          "status": 200,
#          "result": {
#            "...": "the single-GET response body"
#          }
#        }
#      ]
#    }

Request-level rejections (whole request, never partial):

HTTPCodeMeaning
400PAYLOAD_NOT_OBJECTbody is not a JSON object
400ITEMS_LIST_REQUIREDitems missing or not a list
400EMPTY_ITEMSitems is empty
400TOO_MANY_ITEMSover 200 items — the whole request is rejected, nothing is partially processed (body adds max_items and received)
401IDENTITY_REQUIREDover 10 rows with no session: the free row budget needs no credential, a larger upload does (body adds max_rows_free, max_rows_pro, received)
403PRO_REQUIREDover 10 rows on a signed-in non-paid account (same body fields as the 401)
400BODY_TOO_LARGErequest body over 64 KiB
413PAYLOAD_TOO_LARGErequest body over the 256 KiB transport cap — refused by the input guard before this route runs (the 64 KiB cap above is the route's own, measured 2026-10-29: both are reachable)
429RATE_LIMITEDover 30 batch requests/minute from one caller

Per-row failures ride inside the 200 response and mirror single-call semantics — one failing row never affects its siblings:

Row-level codeMeaning
ITEM_NOT_OBJECTa row is not an object
MISSING_PARAM / INVALID_VALUE / HTS_NOT_FOUND / INVALID_API_KEY / INSUFFICIENT_CREDITSexactly what the single GET would have answered for that row

GET /api/v1/tariff/reverse

A Pro capability, with a free daily trial. The inverse of the duty calculation: give it the amount on a broker’s entry summary and it returns the declared customs value that produces that amount on the HTS line you name — or the interval of values that do, or an explicit verdict saying no value can. Every figure comes from the live forward calculation, so the inverse cannot disagree with GET /api/v1/tariff.

Parameters: hs (required), origin (required, ISO-2), paid (required, the amount in USD, ≥ 0), basis (optional, one of duty — the default, Column 1 plus the origin additional duties — schedule = duty + MPF + HMF, mpf, or hmf), and qty/unit (accepted for symmetry with the forward route; a per-unit line is answered as unsolvable regardless).

Permission ladder (measured against the shipped app, 2026-11-10): a Pro session or a live Pro X-API-Key → 200 with no trial ceiling — the plan is the budget. Without one the inverse is a free trial of 3 checks per day: the first 3 answer 200 with a trial block that counts the remainder down, and the next answers 429 TRIAL_QUOTA_EXCEEDED with a Retry-After header and the reset instant in trial.reset_at. Every refusal carries feature: reverse-duty and the recovery links (upgrade_url, pricing_url, signup_url, login_url), and names what stays free: the forward calculator is unlimited and needs no account. An X-API-Key that is presented but not live is refused 401 INVALID_API_KEY rather than being treated as an anonymous caller, so a mistyped key never spends one of the free checks.

statusvalue_usdWhat the body carries
solveda numberthe value, plus value_interval (the band the cent-rounded charge cannot narrow past) and tolerance.meets=true
intervalnullthe band only: a statutory clamp is in force (clamp.fee + clamp.bound), or the rounding is coarser than the 0.5% contract, or the charge rounds to zero at every small value. No midpoint is published — it would be a guess presented as a measurement
unsolvablenullunsolvable.reason (a stable token), unsolvable.detail (a sentence), and for a pure per-unit line unsolvable.implied_quantity — the quantity the charge does imply, which is the answer to the question the bill actually raises

Every response also carries pricing (the rate stack that was " inverted: layers, effective_ad_valorem_pct, fees with each fee’s statutory floor and ceiling as read " from the dataset) and forward (the forward answer the published " value was re-run through and confirmed to reproduce, to the cent).

unsolvable.reason is a token, not prose — branch on it: specific_rate, compound_rate, amount_below_minimum, amount_above_maximum, amount_independent_of_value, not_machine_readable, no_such_charge.

Errors: 400 MISSING_PARAM, 400 DUPLICATE_PARAM (each parameter may be given once), 400 INVALID_BASIS (body adds basis_help), 400 INVALID_VALUE (the paid parameter is not a finite number ≥ 0), 404 HTS_NOT_FOUND and 400 INVALID_ORIGIN — the last two passed through from the forward route, so both surfaces refuse identically. 401 INVALID_API_KEY when an X-API-Key was presented and is not live, 429 TRIAL_QUOTA_EXCEEDED when the day’s free checks are spent (body adds the trial block and the Retry-After header), and 503 TRIAL_METER_UNAVAILABLE when the trial cannot be counted — the check is then refused rather than served uncounted. 503 FORWARD_UNAVAILABLE when a deployment has no pricing handler wired and the inverse therefore cannot be taken.

GET /api/v1/citation/export

Requires a Pro session. The evidence package behind the layered duty answer: for one HTS line, one origin and one customs value it returns every duty layer with its printed page, its printed line, the verbatim USITC sentence that imposes it, its amount and the official URL of the source text — as JSON, as CSV, or as a self-contained printable HTML document you can attach to an entry file.

Parameters: hs (required), origin (required, ISO 3166-1 alpha-2), value (required, the customs value in USD, ≥ 0) and format (json — the default — csv or html). Every rate, every layer and the headline total come from the same handler that answers GET /api/v1/tariff, so a citation report cannot disagree with the calculator it cites. The six columns on every cited row are heading, note, printed_page, line_start, amount_usd, official_url.

The permission ladder below is measured, not typed: it is what this deployment answered for one request per identity on 2026-11-09T04:06:22Z, recorded by scripts/citation_export_sample.py (the repository’s own harness — useful to you only as the provenance of these numbers).

CallerHTTPError codeWhat it gets
Anonymous (no es_sess cookie)401IDENTITY_REQUIREDrefused before a parameter is parsed
Signed in, plan free403PRO_REQUIREDrefused; the layers, headings and rates stay free on /api/v1/tariff
Signed in, plan pro200—the report: six columns on every cited row, reconciliation.balanced: true, reconciliation.delta_usd: 0

The refusal bodies name the free tier explicitly, because a wall that does not say what still works reads as “the product was switched off”. Anonymous caller, verbatim (from the same artifact):

{
  "authenticate": {
    "login_url": "/login/?src=citation-export",
    "session_cookie": "es_sess"
  },
  "checkout_url": "/pay/credits-200/?src=citation-export",
  "error": "IDENTITY_REQUIRED",
  "feature": "citation-export",
  "free_tier": {
    "forward_calculator": "/api/v1/tariff",
    "layers_in_free_response": true,
    "message": "every layer, heading and rate stays in the free API response; only the printed-page export is gated",
    "metered": false
  },
  "login_url": "/login/?src=citation-export",
  "message": "The layered citation export is part of Pro. Sign in if you already have an account, or create a free one — the calculator (value in, duty and every layer out) is free and unlimited and needs no account at all.",
  "plan": "none",
  "pricing_url": "/pricing?src=citation-export",
  "signed_in": false,
  "signup_url": "/signup/?src=citation-export",
  "upgrade_url": "/pay/pro/?src=citation-export"
}

Formats for a Pro session (media type and disposition header, both read from the recorded responses; a missing header is shown as such rather than invented):

formatHTTPContent-TypeContent-Disposition
json200application/json— (header not set)
csv200text/csv; charset=utf-8attachment; filename="citation-8517-62-00_CN_10000.csv"
html200text/html; charset=utf-8attachment; filename="citation-8517-62-00_CN_10000.html"

Reproduce it yourself — the measurement commands, then the request itself (this block scrolls horizontally rather than soft-wrapping: a shell command that wraps mid-URL cannot be copied):

# measure all three identities against this tree's own app
python3 scripts/citation_export_sample.py
# re-measure; rc 1 if the page's numbers went stale
python3 scripts/citation_export_sample.py --check
# the request itself, as a Pro session -- replace the cookie value
curl -b 'es_sess=<session-token>' \
     -o citation.csv \
     'https://exportsonar.com/api/v1/citation/export?hs=8517.62.00&origin=CN&value=10000&format=csv'

Errors: 400 MISSING_PARAM / 400 DUPLICATE_PARAM / 400 INVALID_VALUE / 400 INVALID_FORMAT for the parameters above; 401 IDENTITY_REQUIRED and 403 PRO_REQUIRED for the two refusals (both carry the recovery links and the free-tier sentence); the forward route’s own rejections (404 HTS_NOT_FOUND, 400 INVALID_ORIGIN, 503 INPUT_UNAVAILABLE) pass through unchanged, so both surfaces refuse identically; and 503 PRIMARY_TEXT_UNAVAILABLE when this deployment is missing its pinned primary text — the export then refuses rather than inventing a page number.

GET /api/v1/lookup

Prefix-first HS-code and description search. Parameters: q (required, non-blank), limit (optional integer, clamped to 1–100, default 10; a non-integer value is a 400 INVALID_VALUE).

curl "https://exportsonar.com/api/v1/lookup?q=asses&limit=3"
# => {
#      "q": "asses",
#      "count": 3,
#      "results": [
#        {
#          "...": "up to `limit` rows, each {hts, description}"
#        }
#      ],
#      "data_vintage": {
#        "...": "per-source as-of/status blocks"
#      }
#    }

Error: 400 MISSING_PARAM when q is blank, 400 INVALID_VALUE when limit is not an integer.

GET /api/v1/hs/describe

Product description in, candidate HS headings out. This is the endpoint behind the HS code finder: it searches the HTS vocabulary for the content words of a plain-English description and returns ranked candidate headings, each with its Column  1 general rate, special-programme column and Column 2 rate so one call answers “which code is this and what does it cost” — and, for every candidate, the CBP rulings that have classified that heading before, so the ranking can be checked rather than taken on faith.

Parameters: q (required, the product description, at most 256 characters), k (optional integer, 1–10, default 3). Anonymous, no key, no account.

The example below is the live response to that exact request, captured from this build’s own dataset and reproduced by scripts/api_docs_sample_gate.py; every value is a shipped one, including the ruling numbers, their dates and their URLs. Only latency_ms is elided (it is a measurement of the call, not part of the contract).

curl "https://exportsonar.com/api/v1/hs/describe?q=brass+ball+valve&k=3"
# => {
#      "query": "brass ball valve",
#      "candidates": [
#        {
#          "hs4": "8481",
#          "hs6": "848180",
#          "hts": "8481.80.90.05",
#          "description": "Solenoid valves",
#          "heading_description": "Taps, cocks, valves and similar appliances, for pipes, boiler shells, tanks, vats or the like, including pressure-reducing valves and thermostatically controlled valves; parts thereof:",
#          "chapter": "84",
#          "chapter_title": "Machinery and mechanical appliances, boilers, nuclear reactors; parts thereof",
#          "general": "2%",
#          "special": "Free (A*,AU,B,BH,CL,CO,D,E,IL,JO,KR,MA,OM,P,PA,PE,S,SG)",
#          "column2": "35%",
#          "unit": "No.",
#          "score": 265.006,
#          "matched_terms": [
#            "ball",
#            "valve"
#          ],
#          "justification": {
#            "ruling_ids": [
#              "N334695",
#              "N301840",
#              "N013732",
#              "R02050",
#              "853125"
#            ],
#            "ruling_links": [
#              {
#                "id": "N334695",
#                "url": "https://rulings.cbp.gov/ruling/N334695",
#                "date": "2023-08-31"
#              },
#              {
#                "id": "N301840",
#                "url": "https://rulings.cbp.gov/ruling/N301840",
#                "date": "2018-12-13"
#              },
#              {
#                "id": "N013732",
#                "url": "https://rulings.cbp.gov/ruling/N013732",
#                "date": "2007-07-17"
#              },
#              {
#                "id": "R02050",
#                "url": "https://rulings.cbp.gov/ruling/R02050",
#                "date": "2005-06-23"
#              },
#              {
#                "id": "853125",
#                "url": "https://rulings.cbp.gov/ruling/853125",
#                "date": "1990-06-28"
#              }
#            ],
#            "ruling_urls_missing": 0,
#            "ruling_reason": "RULINGS_CITED_FOR_HS6",
#            "ruling_key": "848180",
#            "rulings_available": 5,
#            "rulings_revoked_excluded": 0
#          },
#          "confidence": 0.533
#        },
#        {
#          "hs4": "7325",
#          "hs6": "732510",
#          "hts": "7325.10.00.30",
#          "description": "Valve and service boxes",
#          "heading_description": "Other cast articles of iron or steel:",
#          "chapter": "73",
#          "chapter_title": "Iron or steel articles",
#          "general": "Free",
#          "special": "",
#          "column2": "10%",
#          "unit": "kg",
#          "score": 87.98,
#          "matched_terms": [
#            "ball",
#            "valve"
#          ],
#          "justification": {
#            "ruling_ids": [],
#            "ruling_links": [],
#            "ruling_urls_missing": 0,
#            "ruling_reason": "NO_RULING_FOR_HS6",
#            "ruling_key": "732510",
#            "rulings_available": 0,
#            "rulings_revoked_excluded": 0
#          },
#          "confidence": 0.177
#        },
#        {
#          "hs4": "8482",
#          "hs6": "848299",
#          "hts": "8482.99.05.00",
#          "description": "For ball bearings",
#          "heading_description": "Ball or roller bearings, and parts thereof:",
#          "chapter": "84",
#          "chapter_title": "Machinery and mechanical appliances, boilers, nuclear reactors; parts thereof",
#          "general": "9.9%",
#          "special": "Free (A+,AU,B,BH,CL,CO,D,E,IL,JO,KR,MA,OM,P,PA,PE,S,SG)",
#          "column2": "67%",
#          "unit": "No.; kg",
#          "score": 65.984,
#          "matched_terms": [
#            "ball"
#          ],
#          "justification": {
#            "ruling_ids": [
#              "N357169",
#              "N085238"
#            ],
#            "ruling_links": [
#              {
#                "id": "N357169",
#                "url": "https://rulings.cbp.gov/ruling/N357169",
#                "date": "2026-01-14"
#              },
#              {
#                "id": "N085238",
#                "url": "https://rulings.cbp.gov/ruling/N085238",
#                "date": "2009-12-11"
#              }
#            ],
#            "ruling_urls_missing": 0,
#            "ruling_reason": "RULINGS_CITED_FOR_HS6",
#            "ruling_key": "848299",
#            "rulings_available": 2,
#            "rulings_revoked_excluded": 0
#          },
#          "confidence": 0.1327
#        }
#      ],
#      "k": 3,
#      "declined": false,
#      "coverage": {
#        "known": [
#          "brass",
#          "ball",
#          "valve"
#        ],
#        "unknown": [],
#        "ratio": 1.0,
#        "head_known": true
#      },
#      "confidence": 0.533,
#      "confidence_basis": {
#        "share": 0.5184,
#        "excess_share": 0.398,
#        "lead": 0.668,
#        "window": 5,
#        "families_matched": 28,
#        "threshold": 0.15,
#        "product_support": true,
#        "family_lines": 70,
#        "breadth": 1.0,
#        "shape": 0.533
#      },
#      "abstain": false,
#      "abstain_reason": null,
#      "min_confidence": null,
#      "candidates_filtered": 0,
#      "latency_ms": "...",
#      "index_version": "hts-2026-11-06T00:27:04-1228",
#      "index_source": "https://hts.usitc.gov/reststop/exportList?from=0100&to=9999&format=JSON&styles=false",
#      "disclaimer": "Candidate headings from a keyword search over the USITC Harmonized Tariff Schedule. Not a customs classification ruling; verify with a licensed broker or CBP before entry."
#    }

Each candidate row carries hs4, hs6, hts, description, heading_description, chapter, chapter_title, general, special, column2, unit, score, matched_terms, justification, confidence. Inside justification: ruling_ids, ruling_links, ruling_urls_missing, ruling_reason, ruling_key, rulings_available, rulings_revoked_excluded.

matched_terms is the vocabulary that matched the family, not words taken from the cited line: the top row above is heading 8481 and reads “Solenoid valves”, while matched_terms says ball because other lines under 8481 are ball-type valves. The rates, the hts code and the description always belong to the line quoted; the matched terms say why that family ranked.

ruling_ids are the CBP rulings citing that HS6 family, newest first, capped at 5. ruling_links carries the same entries in the same order, each with the dataset’s own url (resolvable on rulings.cbp.gov, never synthesised) and the ruling’s date; ruling_urls_missing counts entries whose record had no URL. ruling_key is the HS6 the lookup was keyed on, rulings_available how many live rulings that key holds and rulings_revoked_excluded how many were dropped as revoked. ruling_reason names the state: RULINGS_CITED_FOR_HS6 when ids are present, and NO_RULING_FOR_HS6, RULINGS_ALL_REVOKED or RULING_SOURCE_UNAVAILABLE when the list is empty — an empty array is never returned without one of those four words.

confidence (0–1) and abstain decide whether the answer is stood behind. confidence_basis publishes every input to the score (share, excess_share, lead, window, families_matched, threshold, product_support, family_lines, breadth, shape) including the threshold it is compared against (0.15). Every candidate row carries its own confidence too — the top row’s is the same number as the top-level one, and each lower row carries confidence × row score / top score, so a row with half the match evidence shows half the confidence rather than a lookalike number on a second scale.

min_confidence (optional, 0–1) lets the caller set their own bar. When it is given, no row below it is returned: the rows are dropped (never re-ordered, re-scored or padded), candidates_filtered says how many went, and if the top row does not clear the bar the response abstains with BELOW_CALLER_THRESHOLD instead of shipping an answer under a bar it failed. Omitted, it filters nothing — the response echoes min_confidence: null so “no bar was applied” is distinguishable from “the bar passed everything”. A value outside 0–1 answers 400 INVALID_VALUE; it is never silently ignored. The tool’s own verdict outranks the caller’s bar: when the answer already abstains on its own scale, that reason is kept and BELOW_CALLER_THRESHOLD does not fire.

The abstention shapes are distinct on purpose: declined: true with an empty candidates list (reason NO_SCHEDULE_VOCABULARY or HEAD_NOUN_UNKNOWN) — the schedule’s vocabulary cannot see the query, and saying so is more useful than a confident wrong heading; abstain: true with NO_PRODUCT_IN_QUERY — the query names no product at all: category words (item) and material words with no product noun (steel, cotton) both land here; abstain: true with LOW_CONFIDENCE or AMBIGUOUS_FAMILY — candidates exist but the ranking (or the line inside a single broad family) cannot be separated, so the candidates are returned and flagged rather than dropped or presented as certain; and abstain: true with BELOW_CALLER_THRESHOLD — your own min_confidence is higher than this answer’s evidence, which is a different obstacle and a different next action (lower the bar, or read the candidates the response still returns) from the tool being unsure. coverage (known, unknown, ratio, head_known) names which of the query’s words were recognised, so a thin match is visible before the numbers are. The response carries its own disclaimer field — a candidate list is a search result, not a customs classification ruling.

NO_SCORED_MATCH is a defensive branch this dataset cannot reach: every vocabulary term carries a non-empty posting list, so a query that survives the vocabulary gate always scores at least one line or heading. The state is kept, and named rather than thrown, so a dataset with a vocabulary/posting mismatch still reports why it declined instead of returning a bare empty list — but it is not part of the contract a caller can observe on this deployment.

Errors: 400 MISSING_PARAM (blank q), 400 INVALID_VALUE (query over 256 characters, k outside 1–10, or min_confidence outside 0–1), and 503 INDEX_UNAVAILABLE when this deployment cannot build its index — a loud refusal rather than an empty list that would read as “no such product”.

Withdrawn: the named-importer register

Withdrawn: reuse is PROHIBITED by the publisher. The route answers 503 DIAN_DISTRIBUTION_WITHDRAWN and serves no named row, because the publisher of Colombia's DIAN «Directorio de Importadores» grants no licence of any kind over the contents (terms read 2026-11-07: https://www.dian.gov.co/Paginas/Privacidad.aspx). This page publishes no contract, no example request and no row budget for it, because none of them can be served; the operator re-opens only if the publisher's terms themselves change. A client integrating against this register should expect the 503.

This page therefore publishes no contract, no example request and no row budget for that register: none of them can be served. A client still holding the old path receives 503 DIAN_DISTRIBUTION_WITHDRAWN with retryable: false, no records and no count, and retrying does not change the answer. The rate endpoints above are unaffected.

GET /api/v1/usage

Balance and recent metered calls for one key. Requires X-API-Key; anonymous callers get 401 INVALID_API_KEY. credits is the prepaid balance left on the key (200 right after a $10 pack, one debited per metered call); recent_usage rows carry {ts, key_prefix, endpoint, credits}.

curl -H "X-API-Key: $EXPORTSONAR_KEY" https://exportsonar.com/api/v1/usage
# => {
#      "ok": true,
#      "key_prefix": "~key prefix shown once at issuance",
#      "plan": "credits-200",
#      "credits": 200,
#      "recent_usage": [
#        {
#          "...": "metered calls, newest last"
#        }
#      ]
#    }

GET /api/v1/healthz

Ops liveness probe for monitoring: HTTP 200 with {status, build_utc, checks{sitemap, funnel_ledger}}, where each check states its own ok and a measurement detail. Sends Cache-Control: no-store. No auth, no dataset read.

GET /api/v1/remedies

Trade-remedy association for an HTS code or family: ?hs= takes a 4-, 6-, 8- or 10-digit code or prefix and answers {query, family, query_granularity, matched_granularities, count, results} with the AD/CVD and Chapter 99 cases whose scope references it. Pass the code you already hold: an 8- or 10-digit code is matched at the depth the index holds it, so it still reaches a case filed against its 6-digit subheading — and every result states which depth it matched at (match_granularity, matched_key), so you can tell “this order names my exact line” from “this order names my subheading”. A code no case covers is 200 with count: 0, not a refusal. A missing or unusable hs code is 400 BAD_HS. A missing or corrupt source degrades loudly to HTTP 503 rather than an empty list.

GET /api/v1/trade-flow

What a 6-digit HS code actually imported, and from where. Parameters: hs (required, exactly six digits), month (optional YYYY-MM; omitted means the latest indexed month — 2026-08, 2026-09), flow (optional; only imports is indexed, and any other value is refused with 400 FLOW_NOT_AVAILABLE rather than answered with an empty set).

curl "https://exportsonar.com/api/v1/trade-flow?hs=847130&month=2026-09"
# => {
#      "ok": true,
#      "found": true,
#      "query": {
#        "hs6": "847130",
#        "month": "2026-09",
#        "flow": "imports",
#        "month_defaulted": false
#      },
#      "period": "2026-09",
#      "flow": "imports",
#      "hs6": "847130",
#      "description": "...",
#      "total_usd": "...",
#      "origin_total_usd": "...",
#      "origin_count": "...",
#      "origin_countries": [
#        {
#          "...": "the largest origins, ranked"
#        }
#      ],
#      "origin_detail": {
#        "available": false,
#        "shown": 5,
#        "total_count": "...",
#        "hidden_count": "...",
#        "hidden_usd": "...",
#        "hidden_share": "...",
#        "reason": "pro_only",
#        "...": "the sentence naming how many countries and how much is withheld"
#      },
#      "tier": "anonymous",
#      "hs10_count": "...",
#      "quantity": {
#        "...": "value, unit, status, upstream fields, note"
#      },
#      "coverage": {
#        "status": "...",
#        "pending_chapters": "...",
#        "partial_chapters": "...",
#        "note": "..."
#      },
#      "freshness": {
#        "data_month": "...",
#        "month_end": "...",
#        "as_of": "...",
#        "age_days": "...",
#        "source_fetched_at_utc": "...",
#        "pipeline_lag_days": "...",
#        "is_latest_available": "...",
#        "available_months": "..."
#      },
#      "index": {
#        "...": "schema, month total, conservation verdict, artifact sha256"
#      },
#      "attribution": {
#        "...": "source, upstream URL, licence, terms URL, when the terms were read"
#      },
#      "upgrade": {
#        "...": "the Pro links, the withheld counts, what stays free"
#      }
#    }

The free answer is the total, the 5 largest origin countries and the exact number of countries with recorded imports. The rest of the dimension is Pro. Nothing is hidden by omission: a non-paid body carries origin_detail.available: false, how many countries are withheld, their combined USD, and the upgrade links, so a buyer can see the size of what they are not seeing.

Three absences are different facts and are answered differently: reason: hs6_not_in_month (the month is complete and this code traded nothing), reason: chapter_not_yet_fetched (a collection gap — explicitly not evidence of no trade), and 404 MONTH_NOT_AVAILABLE with available_months (the endpoint never substitutes a month you did not ask for).

GET /api/v1/trade-flow/origins.csv

Requires a Pro session. The same table, every origin country, as CSV — columns hs6, month, cty_code, country, imports_usd, share, served as an attachment.

Permission ladder (enforced by the same ruling that decides the JSON body above): no es_sess cookie → 401 IDENTITY_REQUIRED; signed in on a non-Pro plan → 403 PRO_REQUIRED; Pro → 200 text/csv. Both refusals carry the recovery links and name what stays free: the JSON answer above, for any code, with no account at all.

# the export itself, as a Pro session -- replace the cookie value;
# an anonymous caller gets 401 IDENTITY_REQUIRED (see the ladder above)
curl -b 'es_sess=<session-token>' \
     -o origins.csv \
     'https://exportsonar.com/api/v1/trade-flow/origins.csv?hs=847130&month=2026-09'

Every response also pins its provenance in attribution (source name, upstream URL, licence sentence, terms URL and when those terms were read) and its age in freshness, so a figure quoted from this endpoint can be traced back to the Census release it came from.

GET /api/v1/nonus-tariff

The import duty a non-US destination applies to an HS code — the most-favoured-nation rate, from a sourced table covering 154 destinations under 128 tariff schedules (AE, AL, AM, AO, AR, AU, AZ, BD, BF, BH, BI, BJ, BM, BN, BO, BR, BW, BZ, CA, CF, CG, CH, CI, CL, CM, CN, CO, CR, CU, CV, DM, DO, DZ, EC, EU, FJ, GA, GB, GD, GH, GI, GM, GN, GQ, GT, GW, GY, HK, HN, ID, IN, IS, JM, JO, JP, KE, KH, KI, KN, KR, KW, KZ, LA, LC, LK, LR, LS, MA, MD, ME, MG, MK, ML, MM, MN, MO, MR, MS, MU, MV, MX, MY, MZ, NA, NE, NG, NI, NO, NP, NZ, OM, PA, PE, PF, PG, PH, PK, PW, PY, QA, RW, SA, SB, SC, SG, SL, SN, SO, SR, SZ, TD, TG, TH, TO, TR, TT, TW, TZ, UA, UG, UY, VC, VE, VN, VU, ZA, ZM, ZW) and 708,790 HS6 headings. No API key and no credit is consumed.

It is a separate operation from GET /api/v1/tariff on purpose. That endpoint is a USITC HTS engine whose whole contract — the Chapter 99 assembly, the jurisdiction block, the credit meter — is built around one schedule. Asking it for a non-US destination answers the US figure plus notice_code: DEST_NOT_PRICED, which is honest but is not this answer. Here nothing is priced unless this table priced it.

Parameters

ParameterRequiredMeaning
destyesISO 3166-1 alpha-2 destination. A malformed code is 400 INVALID_DEST; a well-formed code this table does not hold is 404 DEST_NOT_COVERED, never another country's rate
hsyes6 to 10 digits, dots allowed. A ten-digit code resolves to its six-digit parent and the response names it in hs6_used. Shorter than six digits is 400 HS_TOO_SHORT
valuenoInvoice value, any currency; the duty amount comes back in the same unit as duty_amount. Must be a finite number ≥ 0; anything else is 400 INVALID_VALUE

Example

curl -s "https://exportsonar.com/api/v1/nonus-tariff?dest=DE&hs=6109100000&value=1000"
# => {
#      "status": "ok",
#      "dest": "DE", "jurisdiction": "EU", "hs6_used": "610910",
#      "duty_pct": 12.0, "duty_amount": 120.0,
#      "precision": "hs10_anchor",
#      "rate_basis": "MFN (most-favoured-nation) customs duty only ...",
#      "...": "see the field table below for every key"
#    }

Response fields (a priced answer)

FieldMeaning
statusok when a rate was priced; a named refusal code otherwise (table below)
duty_pctthe MFN duty rate. Present on every answer and null on every refusal: a client that does body.get("duty_pct", 0) therefore cannot silently price an unpriced shipment at zero
duty_amountvalue × rate, or null when no value was sent or no rate was priced
precisionhs10_anchor (the published rate for that exact ten-digit line, from the hand-checked anchor set) or hs6_average (the simple average of the ad-valorem lines under the HS6 heading). The two tiers are never blended
hs6_used, hs_digits, hs_inputthe heading the answer was keyed on, how many digits were sent, and what was sent — so a caller can see the resolution instead of inferring it
jurisdiction, priced_viathe tariff schedule that priced it (an EU member state is priced by the Common Customs Tariff, so jurisdiction is EU) and, when those differ, the reporter whose row supplied the figure
granularity_notepresent on HS6-average answers: the value is an average over the lines under that heading, not one ten-digit line's rate
vintage, extracted_atthe source's TIME_PERIOD and the extraction timestamp of the row behind this answer
sourcethe record (or anchor) this figure came from, with its own provenance
rate_basisthe scope statement, in words, of what the figure does and does not include. It is returned with every answer, including refusals
coveragethe table's own census: jurisdictions, headings per jurisdiction, the source endpoint and the attribution note

Refusals: every one of them is a named status, never a zero

HTTPstatusWhat it means and why it is a refusal
200oka rate was priced; read duty_pct
404NON_AD_VALOREM_ONLYevery MFN line under this heading is specific or compound (11,267 of 708,790 headings are in this class). The source reports 0 for them, which means no ad-valorem rate exists, not duty-free; the response carries the line counts in source_obs and no number
404DEST_NOT_COVEREDthis table holds no schedule for that destination. It does not substitute a neighbouring country's rate and does not fall back to the US tariff
404HS_NOT_IN_TABLEthe heading is absent from that destination's table. An absent row is not a zero rate
400HS_TOO_SHORTfewer than six digits: HS6 is the shortest key the source publishes
400MISSING_PARAM / INVALID_DEST / INVALID_HS / INVALID_VALUEthe request itself is malformed; the body names the parameter in param and carries a message

Two limits of this dataset, stated where a client will read them

It is a 2023 snapshot. The source publishes tariff data by TIME_PERIOD and 2023 is the newest year it returns (verified 2026-11-15 against the WITS API: 2022 and 2023 answer with data, 2024 and 2025 answer NoRecordsFound), so every rate here describes 2023 — it is not "the current rate". MFN rates move slowly, which makes this a sound input for an estimate, a benchmark or a sanity check, and the response names the vintage on every answer instead of implying a currency the data does not have.

It prices ad valorem duty only. VAT, excise, anti-dumping and countervailing duties, tariff quotas, preferential-origin treatment and freight all sit outside the figure. If your goods qualify under a trade agreement the rate actually assessed can be lower than the MFN rate returned here.

POST /api/v1/subscribe

The email-capture endpoint named by every 402 subscribe_hint. Body {"email": "..."}:

curl -X POST https://exportsonar.com/api/v1/subscribe \
  -H "Content-Type: application/json" \
  -d '{"email": "you@example.com"}'
# => {
#      "ok": true,
#      "status": "pending",
#      "dup": false
#    }

Errors: 400 INVALID_EMAIL (malformed address), 400 with the validator’s code for a malformed body. Double opt-in: the address only counts as a confirmed lead after the mailed confirmation link is followed.

POST /api/v1/notify-me

Single-opt-in lead capture for tool pages: body {"email": "...", "context": ""} (only email is required) → {"ok": true, "dup": false}, or {"ok": true, "dup": true} for an address already on the list. Errors: 400 INVALID_EMAIL, 400 UNKNOWN_FIELD:<name> for any unexpected field.

GET /api/v1/checkout/{plan}

The payment bridge behind every buy button. plan is one of pro or credits-200. A configured plan answers 302 straight into the payable page and books a checkout_view funnel row; an unconfigured one serves an honest interim page instead of a dead end.

The bridge is the one endpoint that is both a JSON operation and a link a person clicks, so a rejection has two documented answers — same status code, chosen by Accept (measured 2026-10-29):

ClientSlugStatusBody
API client (Accept: application/json, or no Accept)malformed404{"error":"UNKNOWN_PLAN"}
API clientwell-formed, not a live plan400{"error":"UNKNOWN_PLAN"}
browser (Accept names text/html)either404 / 400the human page: what the plan situation is, and the way back to pricing
eithera payment link pointing back at our own hand-off500page for a browser, {"error":"CHECKOUT_MISCONFIGURED"} for an API client — not retryable by design

Code examples — curl, Python & Node

The same duty estimate in three languages, all against the live production base URL. Every one of them works with an anonymous (free) request; add your X-API-Key header to receive metered responses with an integer credits_remaining. Each snippet is executed against the deployed API by the site’s own contract gate, so the printed line is the line you will see.

Python (stdlib only)

import json
from urllib.parse import urlencode
from urllib.request import urlopen

BASE = "https://exportsonar.com"
params = urlencode({"hs": "0101.30.00.00", "origin": "CN", "value": "1000"})
with urlopen(f"{BASE}/api/v1/tariff?{params}") as resp:
    data = json.load(resp)

rate = data["rate"]
print(rate["basis"], rate["duty_usd"])
# => percent 268.0

Node.js (18+, fetch built in)

const BASE = "https://exportsonar.com";
const params = new URLSearchParams({
  hs: "0101.30.00.00", origin: "CN", value: "1000",
});
// Anonymous requests need no header: only send the key when it is set.
const headers = process.env.EXPORTSONAR_KEY
  ? { "X-API-Key": process.env.EXPORTSONAR_KEY } : {};
const resp = await fetch(`${BASE}/api/v1/tariff?${params}`, { headers });
if (!resp.ok) throw new Error(`API ${resp.status}`);
const data = await resp.json();
console.log(data.rate.basis, data.rate.duty_usd);
// => percent 268

curl (metered variant)

curl -H "X-API-Key: $EXPORTSONAR_KEY" "https://exportsonar.com/api/v1/tariff?hs=0101.30.00.00&origin=CN&value=1000"
# => {
#      "query": {
#        "hs": "0101.30.00.00",
#        "...": "full query block"
#      },
#      "match": {
#        "...": "the resolved HTS line"
#      },
#      "rate": {
#        "basis": "percent",
#        "duty_usd": 268.0,
#        "base_duty_usd": 68.0,
#        "surcharge_usd": 200.0,
#        "...": "full rate block"
#      },
#      "credits_remaining": 199,
#      "policy_layers": [
#        {
#          "...": "sourced duty layers"
#        }
#      ],
#      "landed_cost": {
#        "...": "full landed-cost block (see above)"
#      },
#      "coverage": {
#        "...": "what the total excludes"
#      },
#      "jurisdiction": {
#        "...": "which destination the figures are for"
#      },
#      "data_vintage": {
#        "...": "per-source as-of/status blocks"
#      },
#      "ch99_clock": {
#        "...": "which Chapter 99 measures are in force for this entry date"
#      },
#      "void_layers": [
#        {
#          "...": "layers that are NOT in the total, with the authority that ended them"
#        }
#      ],
#      "authority_summary": {
#        "...": "census of the layer authorities"
#      },
#      "resolution": {
#        "...": "which line the typed code resolved to, and every other code it covers"
#      }
#    }

A freshly bought 200-credit key shows credits_remaining: 199 after one metered call, which is what the sketch above records.

Error codes

Every rejection uses one JSON body shape, {"error": "CODE"}, with the codes below — including the transport-level ones a caller meets before any route runs: an unknown path (404 NOT_FOUND), a verb the route does not serve (405 METHOD_NOT_ALLOWED), a body over the cap (413 PAYLOAD_TOO_LARGE). Batch row failures and the 402 recovery surface add fields; those are listed with their endpoint.

There is one documented exception, because the checkout bridge is also a link a person clicks: a request whose Accept names text/html (every browser navigation) gets a human page with a way back to pricing, while the same URL with Accept: application/json — or with no Accept at all — gets the envelope. The status code is the same on both planes, and a 5xx keeps its 5xx status either way.

HTTPCodeMeaning
400MISSING_PARAMa required query parameter is absent or blank
400INVALID_VALUEvalue is not a finite number > 0; qty is negative or not a number; limit is not an integer
400INVALID_ORIGINorigin is not an ISO 3166-1 alpha-2 country code (the body adds param and message)
400INVALID_DESTdest is not an ISO 3166-1 alpha-2 destination code (the body adds param and message). A valid destination this deployment cannot price is not an error: it answers 200 with jurisdiction.notice_code: DEST_NOT_PRICED
400INVALID_EMAIL/api/v1/subscribe or /api/v1/notify-me received a malformed address
400UNKNOWN_FIELD:<name>/api/v1/notify-me was sent a field it does not accept
400BAD_HS/api/v1/remedies was called without a usable hs code
400PAYLOAD_NOT_OBJECT / ITEMS_LIST_REQUIRED / EMPTY_ITEMS / TOO_MANY_ITEMS / BODY_TOO_LARGEbatch request rejected as a whole; nothing partially processed
400UNKNOWN_PLANwell-formed plan slug that is not a live plan on the checkout bridge (a browser navigating there gets the HTML page instead)
401INVALID_API_KEYunknown or malformed X-API-Key (also what an anonymous caller gets from /api/v1/usage)
402INSUFFICIENT_CREDITSmetered balance exhausted; body adds pricing/signup/checkout links, an instant top-up link and a subscribe_hint for email capture
404HTS_NOT_FOUNDno HTS line matches after suffix fallback
404UNKNOWN_PLANmalformed plan slug on the checkout bridge (accepted charset [a-z0-9][a-z0-9-]{0,31})
404NOT_FOUNDno route serves this path under /api/
405METHOD_NOT_ALLOWEDthe route does not serve this verb; the Allow header still lists the verbs it does
413PAYLOAD_TOO_LARGErequest body over the transport cap (256 KiB) — refused before any route or parser sees the bytes
429RATE_LIMITEDover 30 batch requests/minute from one caller, or over the per-address budget of another write route
500INTERNAL_ERRORan unhandled fault. The body adds ref (quote it in a report) and retryable: true, and the response carries Retry-After: 30 — safe to retry
500CHECKOUT_MISCONFIGUREDthe checkout bridge refuses a payment link that points back at our own hand-off. retryable is absent on purpose: retrying cannot help until the link is fixed
503INPUT_UNAVAILABLEa required data input is missing on this host — the body names it in missing[] and adds a message; the answer is refused rather than computed from a partial feed

API FAQ

Do I need an account?

No — anonymous access is unlimited and signup-free; a key only adds metering.

What does it cost?

$0.06 per successful call (list rate) — $0.05/call via the $10 credit pack; anonymous calls are free.

Unknown HS code?

404 HTS_NOT_FOUND, after automatic 8→10 digit suffix fallback.

Is Section 301 included?

Yes, for enumerated origins: rate.duty_usd is the Column 1 duty plus the Section 301 additional duty, split out as base_duty_usd / surcharge_usd, with the parsed layers under policy_layers.

Data provenance?

Official USITC Harmonized Tariff Schedule export plus Chapter 99 remedy provisions; each layer carries its own source URL and as-of stamp.

Frequently asked questions

At a glance

Is the ExportSonar API really free?

Partly, by endpoint family. The rate endpoints — tariff, HS-code lookup, trade remedies, health — are free and unlimited without signup: no key, no quota counter. The named-importer register is not served at all: it is withdrawn from distribution (503 DIAN_DISTRIBUTION_WITHDRAWN) because DIAN grants no licence to redistribute the directory, and this page publishes no contract for it. Metered rate access is optional: an X-API-Key debits the USD 0.06 list rate ($0.05 via the $10 credit pack) from prepaid credits.

What data does the tariff API return?

Ten-digit HTS lines with their Column 1 general rates — 23,193 lines across 96 data-bearing chapters in the November 6, 2026 USITC export — plus matching Chapter 99 trade-remedy layers, so a single lookup returns the stacked effective rate rather than just the statutory base. Example values in the docs are generated from the live dataset, not mocked.

What are the API rate limits?

Anonymous callers get unlimited requests on the rate endpoints within normal fair-use bounds — no signup step, no quota counter. The withdrawn importer register is the exception: it answers 503 DIAN_DISTRIBUTION_WITHDRAWN to every caller with no rows and no budget to spend, so there is no allowance to document for it and no account that would raise one. Wire monitoring against the /health endpoint first: it reports liveness without consuming anything.

Where is the interactive API specification?

Swagger UI at /api/docs renders the machine-readable document at /openapi.json, which lists exactly the public operations this page documents — the internal auth, account, webhook and payment routes are withheld from it by an allowlist in the application itself. It covers the November 6, 2026 dataset vintage: 23,193 lines across 96 data-bearing chapters.

Primary sources: USITC Harmonized Tariff Schedule · 19 CFR Part 152 — Customs valuation (eCFR) — republished with provenance by exportsonar.com

Frequently asked questions

What happens when I query an HS code that does not exist?

The API answers HTTP 404 with the machine-readable code HTS_NOT_FOUND. Eight-digit base lines automatically fall back to their ten-digit statistical suffix.

Where does the tariff data come from?

Rates are imported from the official USITC Harmonized Tariff Schedule export and combined with Chapter 99 trade-remedy provisions. The underlying HTS dataset was refreshed 2026-11-06.