GST API client libraries
Two official, MIT-licensed, zero-dependency clients for the GSTIN API GST verification service — one for Node.js and TypeScript, one for Python. Both validate a GST number offline for free, and both call the live register when you need to know who is actually behind it.
Install
Pick your language. The two libraries have the same shape on purpose: the same two layers, the same error taxonomy, and the same command-line tool.
Node.js & TypeScript
npm install @dlminds/gstin-api
- Registry
- @dlminds/gstin-api on npm
- Import
@dlminds/gstin-api- Requires
- Node 18+, no dependencies
- Source
- GitHub, MIT
Try it before installing anything
npx @dlminds/gstin-api explain 27AAACR5055K1Z7
Python
pip install gstin-toolkit
- Registry
- gstin-toolkit on PyPI
- Import
gstin_api- Requires
- Python 3.9+, no dependencies
- Source
- GitHub, MIT
Try it before installing anything
pipx run --spec gstin-toolkit gstin-api explain 27AAACR5055K1Z7
Two layers, and most projects need one
Every GST API SDK question eventually reduces to this distinction. Validation is arithmetic you can do on your own machine. Verification is a question only the government register can answer, and it is the only half that costs anything.
| Layer | What it answers | Network | API key | Cost |
|---|---|---|---|---|
| Offline | Is this string a well-formed GSTIN? Which state, which PAN, which entity type? SGST or UTGST? | No | No | Free, unlimited |
| Online | Who is behind this GSTIN, and is the registration still active today? | Yes | Yes | 1 credit per lookup |
A cancelled GSTIN passes every offline check ever written, because checksums do not expire. That single fact is why the online layer exists — and why validation and verification are not synonyms.
The same program, twice
Side by side, so a team running Python on the back end and Node on the edge can read one and understand both.
Node.js & TypeScript
import { isValidGstin, parseGstin, GstinApiClient } from '@dlminds/gstin-api';
isValidGstin('27AAACR5055K1Z7'); // true — format + check digit, offline
parseGstin('27AAACR5055K1Z7').state; // 'Maharashtra'
// Reads GSTINAPI_API_KEY from the environment. One credit per lookup.
const taxpayer = await new GstinApiClient().lookup('27AAACR5055K1Z7');
taxpayer?.legalName; // 'RELIANCE INDUSTRIES LIMITED'
taxpayer?.isActive; // true — the thing a checksum cannot tell you
// null instead of an object means no registration exists. That is not billed.
Python
from gstin_api import is_valid_gstin, parse_gstin, GstinApiClient
is_valid_gstin("27AAACR5055K1Z7") # True — format + check digit, offline
parse_gstin("27AAACR5055K1Z7").state # 'Maharashtra'
# Reads GSTINAPI_API_KEY from the environment. One credit per lookup.
taxpayer = GstinApiClient().lookup("27AAACR5055K1Z7")
taxpayer.legal_name # 'RELIANCE INDUSTRIES LIMITED'
taxpayer.status # 'Active' — what a checksum cannot tell you
# None instead of an object means no registration exists. That is not billed.
Both ship a command-line tool for the times a script is more than you want to write — pipe a CSV column through it and get a verdict per row. The full surface is in the API documentation, and the raw endpoints are described by the OpenAPI spec.
Frequently asked questions
Offline is free. The register needs a key.
Sign up for 20 free credits and point either library at a real GSTIN — no card required.