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
Import
@dlminds/gstin-api
Requires
Node 18+, no dependencies

Try it before installing anything

npx @dlminds/gstin-api explain 27AAACR5055K1Z7
Node.js package reference

Python

pip install gstin-toolkit
Import
gstin_api
Requires
Python 3.9+, no dependencies

Try it before installing anything

pipx run --spec gstin-toolkit gstin-api explain 27AAACR5055K1Z7
Python package reference

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
The offline layer is the whole library for a form field. The online layer is the whole library for vendor onboarding.

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

Yes — @dlminds/gstin-api on npm. It is written in TypeScript, ships ESM and CommonJS builds with type declarations, has zero runtime dependencies, targets Node 18 and above, and is MIT licensed. Install it with npm install @dlminds/gstin-api.
Yes — gstin-toolkit on PyPI. It has zero dependencies, supports Python 3.9 and above, and ships a py.typed marker so mypy and Pyright read its annotations. Install it with pip install gstin-toolkit and import it as gstin_api.
Because the distribution name gstin-api was already taken on PyPI when the library was released. The distribution on the index is gstin-toolkit; the module inside it is gstin_api. Run pip install gstin-toolkit, then write from gstin_api import is_valid_gstin.
Not for the offline half. Format checks, the modulus-36 check digit, state codes, the embedded PAN and the SGST/UTGST question all run locally with no key, no network call and no quota. You only need a key — and a credit — to ask the government register who is behind a number and whether the registration is still active.
Both are MIT licensed with the source on GitHub. The offline validation is free forever with no account. Only live register lookups consume credits, at Rs 0.50 each, dropping to Rs 0.40 at 2,500 credits or more.
Yes, by construction. Both are tested against the same shared corpus of GSTINs in tests/fixtures/gstins.json, so a number classified as valid by one is classified as valid by the other. The method names are transliterated to each language convention — isValidGstin in Node, is_valid_gstin in Python — but the answers do not diverge.

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.