- 10 billable calls per IST calendar month
- Unlimited free HSN search
- All 14,416 lines and 20 agreements
- Resets on the 1st at midnight IST
CustomsCalc API · v1
Indian duty rates,
inside your application.
One REST API for 14,416 eight-digit HSN lines: BCD, SWS, AIDC, cess, IGST and preferential rates under 20 trade agreements. Search is free; rate lookups and calculations use a monthly quota.
- 10free calls / month
- 20trade agreements
- JSONREST + CORS
Quickstart
Your first request in a minute
- Create a free key above. It starts with
cc_live_. - Send it in an
Authorization: Bearerheader on every request. - Call
GET /api/v1/hsn/85171300for a rate stack, orPOST /api/v1/calculatefor landed cost.
export CUSTOMS_API_KEY="cc_live_your_key_here"
curl "https://customs.vijayebhava.com/api/v1/hsn/85171300" \
-H "Authorization: Bearer $CUSTOMS_API_KEY"
https://customs.vijayebhava.com. All API responses are JSON and are sent with
Cache-Control: no-store. CORS is open so browser clients can call the API
directly, but never embed a key in a public web page.
Authentication
Hashed keys, bearer auth
Keys are generated once, stored as a SHA-256 hash, and never returned again. Send the plaintext key on every request using either header:
Authorization: Bearer cc_live_xxxxxxxxxxxxxxxxxxxxxxxx
# or
X-API-Key: cc_live_xxxxxxxxxxxxxxxxxxxxxxxx
A missing or unknown key returns 401 missing_api_key or
401 invalid_api_key. A revoked key returns 403 key_disabled.
Keys are rate-limited per minute as well as monthly.
Endpoints
Reference
| Method | Path | Quota | Purpose |
|---|---|---|---|
| GET | /api/v1/hsn/{code} | 1 call | Rate stack and preferential rates for an 8-digit code |
| POST | /api/v1/calculate | 1 call | Landed cost for an HSN, origin and CIF value |
| GET | /api/v1/search?q= | Free | Code + description only, no rates |
| GET | /api/v1/meta | Free | Dataset version, agreements and countries |
| GET | /api/v1/usage | Free | Current month's usage and reset date |
| POST | /api/v1/signup | Free | Create a key from an email address |
Search results never include duty rates. Only a lookup or calculation returns rates and consumes quota.
GET /api/v1/hsn/{code}
One tariff line
Returns statutory and effective BCD, SWS as a percentage of BCD, AIDC, cess, IGST and the rate for each agreement column. The code must be the full 8 digits.
curl "https://customs.vijayebhava.com/api/v1/hsn/85171300" \
-H "Authorization: Bearer $CUSTOMS_API_KEY"
{
"data": {
"hsn": "85171300",
"description": "Smartphones",
"chapter": 85,
"rates": {
"bcdStatutory": 20,
"bcdEffective": 15,
"aidc": 0,
"swsOfBcd": 10,
"igst": 18,
"cess": 0
},
"preferentialRates": {
"MFN": 15,
"AIFTA": 0,
"UAE_CEPA": 15,
"Japan_CEPA": 0,
"Korea_CEPA": 0,
"Australia_ECTA": 0
},
"flag": 0,
"flagLabel": "Line-level CBIC rate",
"quota": {
"plan": "free",
"limit": 10,
"used": 1,
"remaining": 9,
"period": "2026-11",
"resetsOn": "2026-12-01"
}
},
"meta": { "indicative": true }
}
preferentialRates contains every modelled agreement. The
MFN value repeats rates.bcdEffective. AIDC is
populated only for gold and silver; anti-dumping and safeguard duties are excluded.
POST /api/v1/calculate
Landed cost
Send hsn, cif and an optional
country. The country can be a name such as
Japan, an ISO code such as JPN, an agreement
column such as AIFTA, or omitted for MFN.
curl -X POST "https://customs.vijayebhava.com/api/v1/calculate" \
-H "Authorization: Bearer $CUSTOMS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"hsn":"85171300","country":"Japan","cif":100000}'
{
"data": {
"hsn": "85171300",
"description": "Smartphones",
"origin": {
"country": "Japan",
"iso": "JPN",
"agreement": "Japan_CEPA",
"agreementName": "India-Japan CEPA",
"modelled": true
},
"cif": 100000,
"rates": {
"bcdStatutory": 20,
"bcdEffective": 15,
"appliedBcd": 0,
"preferential": 0,
"swsOfBcd": 10,
"igst": 18,
"aidc": 0,
"cess": 0
},
"amounts": {
"bcd": 0,
"sws": 0,
"aidc": 0,
"cess": 0,
"igst": 18000,
"totalDuty": 18000,
"landedCost": 118000
},
"effectiveDutyPct": 18,
"dutyExclIgstPct": 0,
"prefApplied": true,
"prefSaving": 19470,
"mfnLandedCost": 137470,
"flag": 0,
"flagLabel": "Line-level CBIC rate",
"quota": { "plan": "free", "limit": 10, "used": 2, "remaining": 8, "period": "2026-11", "resetsOn": "2026-12-01" }
},
"meta": { "indicative": true }
}
const res = await fetch("https://customs.vijayebhava.com/api/v1/calculate", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.CUSTOMS_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({ hsn: "85171300", country: "Japan", cif: 100000 }),
});
const { data, error } = await res.json();
if (error) throw new Error(`${error.code}: ${error.message}`);
console.log(data.amounts.landedCost, data.quota.remaining);
import os
import requests
res = requests.post(
"https://customs.vijayebhava.com/api/v1/calculate",
headers={"Authorization": f"Bearer {os.environ['CUSTOMS_API_KEY']}"},
json={"hsn": "85171300", "country": "Japan", "cif": 100000},
timeout=15,
)
res.raise_for_status()
print(res.json()["data"]["amounts"]["landedCost"])
GET /api/v1/search
Find a code without spending quota
Search by 2–8 digit code prefix or by words in the description. It returns at most 25 results and never includes rates, so lookup is free for every signed-in key.
curl "https://customs.vijayebhava.com/api/v1/search?q=smartphone&limit=5" \
-H "Authorization: Bearer $CUSTOMS_API_KEY"
{
"data": {
"query": "smartphone",
"results": [
{ "code": "85171300", "description": "Smartphones" }
]
},
"meta": { "count": 1, "note": "Search is free and does not use quota." }
}
Conventions
Response shape and units
- Every success response wraps its payload in
data; optional context lives inmeta. - Rates are percentages, not fractions.
15means 15%. - All money amounts are Indian rupees, rounded to two decimals.
cifmust be greater than zero and is treated as the assessable value.- Every billable response includes a
quotaobject withlimit,used,remaining,periodandresetsOn.
Quota and plans
10 calls free every month
- No monthly cap for normal workloads
- Higher per-minute limits
- Same endpoints and response format
- Activation is handled manually after launch
A rate lookup (/hsn) and a calculation each count as one
billable call. Search, metadata and usage checks are always free.
The website calculator has a separate limit of five calculations per
day, tracked by an anonymous cookie and IP.
Errors
JSON errors, stable codes
Failures use an envelope with a machine-readable code and a human message:
{
"error": {
"code": "quota_exceeded",
"message": "The free API plan includes 10 billable calls per month. Upgrade to continue.",
"docs": "https://customs.vijayebhava.com/api-docs/",
"plan": "free",
"limit": 10,
"used": 10,
"period": "2026-11",
"resetsOn": "2026-12-01"
}
}
| Status | Code | Meaning |
|---|---|---|
| 400 | invalid_hsn | Code is not exactly 8 digits |
| 400 | invalid_cif | Assessable value missing, zero or not a number |
| 400 | invalid_query | Search term shorter than 2 or longer than 80 characters |
| 400 | unknown_origin | Country or agreement is not mapped |
| 401 | missing_api_key / invalid_api_key | No key or an unrecognised key |
| 403 | key_disabled | Key was revoked |
| 404 | hsn_not_found | Code is not in the dataset |
| 409 | email_registered | That email already has a key |
| 413 | payload_too_large | Body is over 8 KB |
| 429 | quota_exceeded | Monthly billable calls used up |
| 429 | rate_limited | Too many requests in a short window |
Data coverage
What the numbers include
- 11,906 of 14,416 codes carry a line-level statutory BCD from the CBIC working-tariff PDFs as on 30.06.2025. The rest are dataset-only and flagged.
- 144 compound or specific-duty parses are approximate and flagged.
- Effective BCD differs from statutory BCD only on curated high-volume lines.
- AIDC is populated only for gold and silver.
- Mauritius, Chile, Mercosur, APTA and GSTP are limited PTAs shown at MFN.
- The UAE CEPA column uses 533 curated line-level rates.
Rates are indicative and not legal or customs advice. Anti-dumping duty, safeguard duty, tariff-rate quotas, specific duties, valuation adjustments and origin verification are excluded. Confirm every rate on ICEGATE before filing a Bill of Entry.
Rules and limits
Fair use
- One key per email. Signup is limited to three keys per IP per day.
- Search is capped at 300 requests per hour per key and 25 results per request.
- Lookups are capped at 120 per minute and calculations at 60 per minute.
- Do not resell the raw dataset, bulk-download descriptions, or share a key between unrelated applications.
- Keys can be revoked or rotated by the operator at any time.