Working code to verify an Indian GST number (GSTIN) with the gstinapi.in REST API: legal name, trade name, Active or Cancelled status, taxpayer type, registration date and address, live from the GST network.
Examples in Python, Node.js, PHP, Java, Go, C# and curl, plus an offline GSTIN check-digit validator in each language.
Sign up at gstinapi.in/register and create a key on the API keys page. Every account gets up to 100 free lookups, and the credits never expire. No credit card.
Replace gak_your_key_here in the examples with your key (better: read it from
an environment variable).
Free sandbox: 00AAAAA0000A1ZT returns a fixed test record with any valid
key and never uses a credit, so you can build the whole integration for free.
GET https://gstinapi.in/v1/gstin/{gstin}
x-api-key: <your key>
Response (200):
{
"success": true,
"gstin": "33AAACC1206D1ZN",
"data": {
"legal_name": "CENTRAL WAREHOUSING CORPORATION",
"trade_name": "CENTRAL WAREHOUSING CORPORATION",
"status": "Active",
"taxpayer_type": "Regular",
"registration_date": "2017-07-01",
"address": "No.4, North Avenue, Saidapet, Chennai"
},
"credits_remaining": 487,
"free_remaining": 97,
"response_ms": 312
}The record is under data. Status codes: 400 bad format (not charged),
401 bad key, 402 out of credits, 404 not registered (not charged),
429 rate limit, 502 GST network unavailable (retry with backoff).
| Language | Lookup | Offline check-digit validator |
|---|---|---|
| Python | python python/with_package.py (pip install gstinapi) or python python/with_requests.py |
python python/gstin_checksum.py |
| Node.js | node nodejs/with-package.mjs (npm install gstinapi) or node nodejs/with-fetch.mjs |
node nodejs/gstin-checksum.mjs |
| PHP | php php/lookup.php |
php php/gstin_checksum.php |
| Java 11+ | java java/GstinLookup.java |
java java/GstinChecksum.java |
| Go | cd go/lookup && go run . |
cd go/checksum && go run . |
| C# (.NET 8) | cd csharp/Lookup && dotnet run |
cd csharp/Checksum && dotnet run |
| curl | sh curl/lookup.sh |
python/with_retries.py and nodejs/with-retries.mjs show the retry policy:
retry only 429 and 502, with backoff.
- Return filing history (GSTR-1, GSTR-3B):
GET /v1/gstin/{gstin}/returns - Monthly or quarterly (QRMP) filer:
GET /v1/gstin/{gstin}/filing-preference - Everything in one call:
GET /v1/gstin/{gstin}/complete - All GSTINs under a PAN:
GET /v1/pan/{pan}/gstins - HSN / SAC code lookup:
GET /v1/hsn/{code} - E-way bill and e-invoice generation
Full reference: API docs · OpenAPI spec · Postman collection · Language guides
- Node.js:
gstinapion npm - Python:
gstinapion PyPI - No code: Free GST number search and bulk Excel check
MIT. Results come from the GST network at the time of the call; verify independently before decisions with legal or tax consequences. gstinapi.in is not affiliated with the Government of India.