HSN / SAC Code API for developers
Find the right HSN or SAC code for a product or service, and look up any code — as JSON.
The HSN / SAC Code API searches the official GST HSN (goods) and SAC (services) list by product or service words, and returns the full details of any 2, 4, 6 or 8-digit code: description, level, chapter, section, parent codes, sub-codes and the 4 or 6 digits to print on GST invoices. It covers 22,000+ codes from the GST portal master list — the same data behind this website. GST rates are not included, because they change by notification and often depend on conditions.
Get a free API key on RapidAPI →
What you can build with it
- Suggest HSN codes while a user adds products in a billing or invoicing app
- Validate HSN/SAC codes on invoices and e-way bills
- Show the 4 or 6 digits a business must print, based on turnover
- Map an e-commerce catalogue to HSN codes
Endpoints
Base URL: https://india-hsn-sac-code-api.p.rapidapi.com. Every request needs your X-RapidAPI-Key and X-RapidAPI-Host headers, which RapidAPI gives you when you subscribe (the free plan needs no card).
| Method | Path | Returns |
|---|---|---|
| GET | /search?q=led lamp&type=hsn&limit=25 | Codes whose description contains all the words; type (hsn or sac) and limit are optional |
| GET | /code/{code} | Details, parents and sub-codes for one HSN/SAC code (400 for a bad format, 404 if not in the list) |
| GET | /chapters | All 2-digit chapters with their section |
Example request
cURL
curl "https://india-hsn-sac-code-api.p.rapidapi.com/search?q=led%20lamp&limit=2" \
-H "X-RapidAPI-Key: YOUR_RAPIDAPI_KEY" \
-H "X-RapidAPI-Host: india-hsn-sac-code-api.p.rapidapi.com"
JavaScript (fetch)
const res = await fetch('https://india-hsn-sac-code-api.p.rapidapi.com/search?q=led%20lamp&limit=2', {
headers: {
'X-RapidAPI-Key': process.env.RAPIDAPI_KEY,
'X-RapidAPI-Host': 'india-hsn-sac-code-api.p.rapidapi.com'
}
});
const json = await res.json();
console.log(json.data);
Python (requests)
import requests
res = requests.get(
"https://india-hsn-sac-code-api.p.rapidapi.com/search?q=led%20lamp&limit=2",
headers={"X-RapidAPI-Key": "YOUR_RAPIDAPI_KEY", "X-RapidAPI-Host": "india-hsn-sac-code-api.p.rapidapi.com"},
)
print(res.json()["data"])
Response
{
"ok": true,
"query": "led lamp",
"matched_as": null,
"total": 4,
"count": 2,
"data": [
{
"code": "853952",
"type": "HSN",
"level": "Sub-heading",
"description": "Light-emitting diode (LED) lamps"
},
{
"code": "85395000",
"type": "HSN",
"level": "Tariff item",
"description": "Light-emitting diode (LED) lamps"
}
],
"meta": {
"source": "GST portal HSN/SAC master list (CBIC)",
"data_version": "GST portal HSN_SAC master, April 2026",
"note": "GST rates are not included; check the CBIC rate notifications."
}
}
Errors come back as JSON too: {"ok":false,"error":"..."} with status 400 (bad input) or 404 (not found).
Plans
| Plan | Price a month | Requests a month |
|---|---|---|
| Basic | Free | 100 |
| Pro | $5 | 10,000 |
| Ultra | $15 | 1,00,000 |
| Mega | $49 | 10,00,000 |
Billing, keys and usage are handled by RapidAPI. Get a free API key on RapidAPI →
Data
GST portal HSN/SAC master list (via the open-source gst-master-data dataset, MIT licence). Data version: GST portal HSN_SAC master, April 2026. The API is served from Cloudflare's edge network.
Frequently asked questions
Is the HSN code API free?
Yes. The Basic plan on RapidAPI is free for 100 requests a month. Paid plans start at $5 a month for 10,000 requests.
Can I search HSN codes by product name?
Yes. GET /search?q=cotton shirt returns the codes whose description contains every word. Everyday words such as laptop, fridge or TV are mapped to the official tariff wording when nothing matches directly.
Does the API return GST rates?
No. GST rates change by notification and often depend on conditions, so the API returns codes and descriptions only. Check the CBIC rate notifications for rates.
Does it include SAC codes for services?
Yes. SAC codes (chapter 99) are in the same API; add type=sac to a search to get services only.