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

  1. Create a free key above. It starts with cc_live_.
  2. Send it in an Authorization: Bearer header on every request.
  3. Call GET /api/v1/hsn/85171300 for a rate stack, or POST /api/v1/calculate for landed cost.
Shell
export CUSTOMS_API_KEY="cc_live_your_key_here"

curl "https://customs.vijayebhava.com/api/v1/hsn/85171300" \
  -H "Authorization: Bearer $CUSTOMS_API_KEY"
Base URL 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:

HTTP headers
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

MethodPathQuotaPurpose
GET/api/v1/hsn/{code}1 callRate stack and preferential rates for an 8-digit code
POST/api/v1/calculate1 callLanded cost for an HSN, origin and CIF value
GET/api/v1/search?q=FreeCode + description only, no rates
GET/api/v1/metaFreeDataset version, agreements and countries
GET/api/v1/usageFreeCurrent month's usage and reset date
POST/api/v1/signupFreeCreate 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.

Request
curl "https://customs.vijayebhava.com/api/v1/hsn/85171300" \
  -H "Authorization: Bearer $CUSTOMS_API_KEY"
200 response (abridged)
{
  "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.

Request
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}'
200 response
{
  "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 }
}
JavaScript
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);
Python
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"])

Conventions

Response shape and units

  • Every success response wraps its payload in data; optional context lives in meta.
  • Rates are percentages, not fractions. 15 means 15%.
  • All money amounts are Indian rupees, rounded to two decimals.
  • cif must be greater than zero and is treated as the assessable value.
  • Every billable response includes a quota object with limit, used, remaining, period and resetsOn.

Quota and plans

10 calls free every month

Free
₹0
  • 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
Paid · ₹99/month
Unlimitedfair use
  • 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:

429 response
{
  "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"
  }
}
StatusCodeMeaning
400invalid_hsnCode is not exactly 8 digits
400invalid_cifAssessable value missing, zero or not a number
400invalid_querySearch term shorter than 2 or longer than 80 characters
400unknown_originCountry or agreement is not mapped
401missing_api_key / invalid_api_keyNo key or an unrecognised key
403key_disabledKey was revoked
404hsn_not_foundCode is not in the dataset
409email_registeredThat email already has a key
413payload_too_largeBody is over 8 KB
429quota_exceededMonthly billable calls used up
429rate_limitedToo 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.