Docs / Developer tools

Batch lookups API

Up to 1,000 lookups in one request.

Pincodes, IFSC codes, banks, phone numbers, RTO codes, HSN codes, companies, states, airports, stations, GSTIN and PAN checks and number to words, many at once. Each answer is exactly what the lookup's own endpoint returns, in the order sent. Ten lookups cost one unit of the rate limit. What you send is never logged.

Base URL https://api.dharun.devNo key needed for most600 units a minute, 3000 with a free keyThis page as Markdown

Many lookups in one request

POST/v1/batch

Answers { data: [{kind, value, status, data or error}], meta }. With format=ndjson, one JSON line per answer instead. Send a CSV file as text/csv with kind (and column, the header of the column holding the values; by default the column named like the kind) to get the same file back with each answer's fields added as columns: a spreadsheet of pincodes comes back with district and state.

Send: JSON: {"kind": "pincode", "values": [...]} for one kind, or {"lookups": [{"kind": "ifsc", "value": "..."}, ...]} for a mix. Kinds: airport, bank, company, gstin, hsn, ifsc, ifsc-format, pan, phone, pincode, rto, state, station, words. Or a CSV file (text/csv) to enrich.

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

ParameterDescription
formatqueryDefault json; csv with a CSV body. One of: json, ndjson, csv.
kindqueryWith a CSV body: the lookup, such as pincode or ifsc.
columnqueryWith a CSV body: the header of the column holding the values.

curl

curl -H "Content-Type: application/json" --data '{
  "kind": "pincode",
  "values": ["637001", "600001", "110001"]
}' "https://api.dharun.dev/v1/batch?utm_medium=docs"

JavaScript

const response = await fetch("https://api.dharun.dev/v1/batch?utm_medium=docs", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
  "kind": "pincode",
  "values": ["637001", "600001", "110001"]
}),
});
const body = await response.json();
if (!response.ok) throw new Error(body.error.message);
console.log(body.data);

Python

import requests

response = requests.post("https://api.dharun.dev/v1/batch?utm_medium=docs", data="{\n  \"kind\": \"pincode\",\n  \"values\": [\"637001\", \"600001\", \"110001\"]\n}", headers={"Content-Type": "application/json"}, timeout=60)
body = response.json()
if not response.ok:
    raise RuntimeError(body["error"]["message"])
print(body["data"])

invoice.json

{
  "kind": "pincode",
  "values": ["637001", "600001", "110001"]
}
Try it here

Change the values and send the request from your browser. Needs JavaScript.

Response, with lists and long text shortened

{
  "data": [
    {
      "kind": "pincode",
      "value": "637001",
      "status": 200,
      "data": {
        "pincode": "637001",
        "district": "Namakkal",
        "stateCode": "TN",
        "state": "Tamil Nadu",
        "offices": [
          {
            "name": "Namakkal H.O",
            "type": "Head Office",
            "delivery": true,
            "division": "Namakkal",
            "region": "Western Region, Coimbatore",
            "circle": "Tamilnadu",
            "district": "Namakkal",
            "stateCode": "TN",
            "state": "Tamil Nadu",
            "latitude": 11.2155833,
            "longitude": 78.1702778
          },
          {
            "name": "Namakkal Bazaar S.O",
            "type": "Post Office",
            "delivery": false,
            "division": "Namakkal",
            "region": "Western Region, Coimbatore",
            "circle": "Tamilnadu",
            "district": "Namakkal",
            "stateCode": "TN",
            "state": "Tamil Nadu",
            "latitude": 11.2240556,
            "longitude": 78.1703333
          },
          {
            "name": "Namakkal Fort S.O",
            "type": "Post Office",
            "delivery": false,
            "division": "Namakkal",
            "region": "Western Region, Coimbatore",
            "circle": "Tamilnadu",
            "district": "Namakkal",
            "stateCode": "TN",
            "state": "Tamil Nadu",
            "latitude": 11.238,
            "longitude": 78.166
          }
        ]
      }
    },
    {
      "kind": "pincode",
      "value": "600001",
      "status": 200,
      "data": {
        "pincode": "600001",
        "district": "Chennai",
        "stateCode": "TN",
        "state": "Tamil Nadu",
        "offices": [
          {
            "name": "Chennai G.P.O.",
            "type": "Head Office",
            "delivery": true,
            "division": "Chennai Gpo",
            "region": "Chennai City",
            "circle": "Tamilnadu",
            "district": "Chennai",
            "stateCode": "TN",
            "state": "Tamil Nadu",
            "latitude": 13.0929722,
            "longitude": 80.2915
          },
          {
            "name": "Flower Bazaar",
            "type": "Post Office",
            "delivery": false,
            "division": "Chennai City North",
            "region": "Chennai City",
            "circle": "Tamilnadu",
            "district": "Chennai",
            "stateCode": "TN",
            "state": "Tamil Nadu",
            "latitude": 13.0914444,
            "longitude": 80.2922777
          },
          {
            "name": "Govt Stanley Hospital S.O",
            "type": "Post Office",
            "delivery": false,
            "division": "Chennai City North",
            "region": "Chennai City",
            "circle": "Tamilnadu",
            "district": "Chennai",
            "stateCode": "TN",
            "state": "Tamil Nadu",
            "latitude": 13.1051667,
            "longitude": 80.2837778
          }
        ]
      }
    },
    {
      "kind": "pincode",
      "value": "110001",
      "status": 200,
      "data": {
        "pincode": "110001",
        "district": "New Delhi",
        "stateCode": "DL",
        "state": "Delhi",
        "offices": [
          {
            "name": "New Delhi GPO",
            "type": "Head Office",
            "delivery": true,
            "division": "New Delhi Gpo",
            "region": "Divreportingcircle",
            "circle": "Delhi",
            "district": "New Delhi",
            "stateCode": "DL",
            "state": "Delhi",
            "latitude": 28.6327,
            "longitude": 77.2233
          },
          {
            "name": "Sansad Marg HO",
            "type": "Head Office",
            "delivery": false,
            "division": "New Delhi Central",
            "region": "Divreportingcircle",
            "circle": "Delhi",
            "district": "New Delhi",
            "stateCode": "DL",
            "state": "Delhi",
            "latitude": 28.6225833,
            "longitude": 77.2127222
          },
          {
            "name": "Baroda House SO",
            "type": "Post Office",
            "delivery": false,
            "division": "New Delhi Central",
            "region": "Divreportingcircle",
            "circle": "Delhi",
            "district": "New Delhi",
            "stateCode": "DL",
            "state": "Delhi",
            "latitude": 28.6174167,
            "longitude": 77.2129167
          }
        ]
      }
    }
  ],
  "meta": {
    "total": 3,
    "note": "Each answer is what its own endpoint returns for that value, in the order sent. Ten lookups cost one unit of the rate limit."
  }
}

Using an AI assistant? Connect the MCP server and it can call this API by itself. Want every endpoint on one bench? Open the playground.