# 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.dev`. No API key needed for most endpoints; a free key (https://api.dharun.dev/keys) raises the limits, and the model endpoints marked below will need one. Answers are JSON, `{ "data": ..., "meta": { ... } }`, and errors are `{ "error": { "code", "message" } }` with a matching HTTP status. Rate limit: 600 units a minute per address without a key, 3000 per key; the `RateLimit-*` headers say what is left.

## 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 is never written to the log, and the answer is not cached.

Parameters:

- `format` (query): Default json; csv with a CSV body. One of: json, ndjson, csv.
- `kind` (query): With a CSV body: the lookup, such as pincode or ifsc.
- `column` (query): With a CSV body: the header of the column holding the values.

Example: `POST` https://api.dharun.dev/v1/batch?utm_medium=docs-md

Example body (invoice.json):

```json
{
  "kind": "pincode",
  "values": ["637001", "600001", "110001"]
}
```

Response, with lists and long text shortened:

```json
{
  "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."
  }
}
```
