TariffAPI
TariffAPI is a JSON API for HS codes, national tariff lines, and duty rates for the United States, the European Union, and the United Kingdom. It returns the rate, source, version, effective date, and match level in one response.
Base URLs
Direct:
https://api.matakupanlabs.com
RapidAPI:
https://tariffapi.p.rapidapi.com
Authentication
RapidAPI
Send the RapidAPI key and host headers:
curl --request GET \
--url 'https://tariffapi.p.rapidapi.com/v1/tariff?hs=61091000&destination=US' \
--header 'X-RapidAPI-Key: YOUR_RAPIDAPI_KEY' \
--header 'X-RapidAPI-Host: tariffapi.p.rapidapi.com'
Direct API
Send the key issued by Matakupan Labs:
curl --request GET \
--url 'https://api.matakupanlabs.com/v1/tariff?hs=61091000&destination=US' \
--header 'X-API-Key: YOUR_API_KEY'
Do not put API keys in browser code, mobile clients, or public repositories.
Endpoints
| Method | Path | Purpose |
|---|---|---|
| GET | /v1/hs/{code} | List jurisdiction records for a 6, 8, or 10 digit HS code |
| GET | /v1/search?q=... | Search tariff descriptions |
| GET | /v1/tariff?hs=...&destination=... | Get one destination-specific tariff line |
HS lookup
curl --request GET \
--url 'https://tariffapi.p.rapidapi.com/v1/hs/610910' \
--header 'X-RapidAPI-Key: YOUR_RAPIDAPI_KEY' \
--header 'X-RapidAPI-Host: tariffapi.p.rapidapi.com'
Parameters:
code, path, required. Exactly 6, 8, or 10 digits.
A response can contain jurisdictions, national_lines, match_level, and coverage_gaps.
Search
curl --request GET \
--url 'https://tariffapi.p.rapidapi.com/v1/search?q=coffee&limit=5' \
--header 'X-RapidAPI-Key: YOUR_RAPIDAPI_KEY' \
--header 'X-RapidAPI-Host: tariffapi.p.rapidapi.com'
Parameters:
q, query, required. Description text.limit, query, optional. Default 20, maximum 50.
Tariff lookup
curl --request GET \
--url 'https://tariffapi.p.rapidapi.com/v1/tariff?hs=61091000&destination=US' \
--header 'X-RapidAPI-Key: YOUR_RAPIDAPI_KEY' \
--header 'X-RapidAPI-Host: tariffapi.p.rapidapi.com'
Parameters:
hs, query, required. 6, 8, or 10 digits.destination, query, required.US,EU, orUK.
Example response excerpt:
{
"data": {
"hs6": "610910",
"requested_code": "61091000",
"destination": "US",
"national_code": "61091000",
"description": "Of cotton",
"duty_rate": "16.5%",
"duty_pct": 16.5,
"source": "USITC HTS 2026",
"source_url": "https://hts.usitc.gov/",
"version": "2026-11-25",
"match_level": "national_8",
"rate_type": "MFN",
"effective_date": "2026-01-01",
"qualifier": ""
},
"meta": {
"request_id": "example",
"disclaimer": "Independent data product from Matakupan Labs. Not legal advice.",
"generated_at": "2026-11-28T00:00:00+00:00"
}
}
Match levels
national_8: exact 8 digit national line.national_10: exact 10 digit national line.hs8: 8 digit fallback.hs6: HS6 parent rate.hs6_representative: the HS6 rate varies across children. Use an 8 or 10 digit code.
Errors
Errors use a JSON body with a detail.code and detail.message.
| HTTP | Code | Meaning |
|---|---|---|
| 400 | invalid_hs_code | Code is not exactly 6, 8, or 10 digits |
| 400 | invalid_destination | Destination is not US, EU, or UK |
| 401 | api_key_required | No API key supplied |
| 401 | invalid_api_key | API key is invalid |
| 403 | api_key_revoked | API key was revoked |
| 404 | hs_not_found | Code is not present in the public dataset |
| 404 | coverage_gap | The HS6 parent is missing; use the 8 or 10 digit national code |
| 404 | tariff_not_found | No destination tariff row for the HS6 code |
| 429 | quota_exceeded | Monthly quota exhausted |
Plans
RapidAPI:
- Basic: USD 0 per month, 500 requests per month.
- Pro: USD 49 per month, 10,000 requests per month.
Overage is blocked. Quota headers may include X-Quota-Limit, X-Quota-Remaining, and X-Quota-Used.
Coverage and limitations
Public coverage is the United States, the European Union, and the United Kingdom. Indonesia is not part of the public beta.
Sources:
- US: USITC HTS 2026
- EU: TARIC 2026-11
- UK: UK Trade Tariff 2026-11-25
TariffAPI is an independent data product. It is not affiliated with any customs authority and does not provide legal, customs, or tax advice. Rates and classifications can change. Always verify the official source before making a customs decision.
Support
Email: fauzi@matakupanlabs.com
Sample and schema: https://github.com/FauziMatakupan/tariffapi-sample
Terms: https://tariffapi.dev/terms Privacy: https://tariffapi.dev/privacy Website: https://tariffapi.dev/
Versioning
The current API version is 2026-11. Breaking changes will be introduced under a new version path.