India API

Docs › Money and business

Format checks API

Check the format of a GSTIN, PAN or IFSC.

Structural checks only: character pattern, state code and, for GSTIN, the check character. Nothing is looked up with a government system, and these values are never written to the request log.

Base URL https://api.dharun.devNo API key600 requests a minuteThis page as Markdown

Check an identifier's format

GET/v1/validate/{kind}/{value}

What you send here is never written to the log, and the answer is not cached.

ParameterDescription
kindpath, requiredWhich identifier. One of: gstin, pan, ifsc.
valuepath, requiredThe identifier to check.

curl

curl "https://api.dharun.dev/v1/validate/gstin/27AAPFU0939F1ZV"

JavaScript

const response = await fetch("https://api.dharun.dev/v1/validate/gstin/27AAPFU0939F1ZV");
const body = await response.json();
if (!response.ok) throw new Error(body.error.message);
console.log(body.data);

Python

import requests

response = requests.get("https://api.dharun.dev/v1/validate/gstin/27AAPFU0939F1ZV", timeout=10)
body = response.json()
if not response.ok:
    raise RuntimeError(body["error"]["message"])
print(body["data"])

Response

{
  "data": {
    "kind": "gstin",
    "normalized": "27AAPFU0939F1ZV",
    "valid": true,
    "parts": {
      "entityNumber": "1",
      "holderType": "Firm or Limited Liability Partnership",
      "pan": "AAPFU0939F",
      "state": "Maharashtra",
      "stateCode": "27"
    }
  },
  "meta": {
    "note": "This checks the format only. It does not confirm that the identifier was ever issued."
  }
}

Guides

Check a GSTIN or PAN before you save it

Show the bank and branch for an IFSC code

Using an AI assistant? Connect the MCP server and it can call this API by itself.