# India Pincode Lookup API: Bulk Postal Code Details (`jayraj0975/india-pincode-bulk-lookup`) Actor

Look up many Indian pincodes at once: post offices, district, state, delivery status. Built on public postal data. Pay per result.

- **URL**: https://apify.com/jayraj0975/india-pincode-bulk-lookup.md
- **Developed by:** [Jay Gaikwad](https://apify.com/jayraj0975) (community)
- **Categories:** Business, Agents
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$2.00 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## India PIN Code Bulk Lookup

Look up Indian PIN codes in bulk and get the post-office records returned by the source for each PIN as structured JSON: post office name, branch type, delivery status, district, division, region, state, circle, block, and country.

Source: [api.postalpincode.in](https://api.postalpincode.in) — a third-party public API that returns post-office records associated with Indian PIN codes (unofficial; not operated by India Post).

### What it does

- Accepts up to **500 PIN codes** per run.
- Validates each PIN code as exactly 6 digits (no leading zero) before any network call.
- For each valid PIN, fetches `https://api.postalpincode.in/pincode/<pin>` (polite: ~1 request per second) and pushes **one dataset row per post office** returned.
- PIN codes that fail validation, have no records, or hit a network error are returned as a single `found=false` row with a clear `reason` — no empty rows, no silent drops.
- If the API response shape changes (e.g. missing `Status`, non-array `PostOffice`, mismatched PIN, missing `Name`), the run **fails loudly** with a `LayoutChangedError` instead of pushing bad data.

### Input

| Field | Type | Required | Description |
|---|---|---|---|
| `pincodes` | array of strings | yes | Up to 500 Indian PIN codes, each 6 digits. Ints/floats are coerced; duplicates are removed; invalid values are reported back as `found=false` rows. |

Example:

```json
{
  "pincodes": ["411001", "110001", "560001", "99999"]
}
```

### Output sample

Example record (illustrative; values vary):

```json
{
  "pincode": "411001",
  "found": true,
  "name": "Pune",
  "branchType": "Head Post Office",
  "deliveryStatus": "Delivery",
  "district": "Pune",
  "division": "Pune City East",
  "region": "Pune",
  "state": "Maharashtra",
  "circle": "Maharashtra",
  "block": "Pune City",
  "country": "India",
  "scrapedAt": "2025-01-01T00:00:00Z"
}
```

Invalid input produces (illustrative; values vary):

```json
{
  "pincode": "99999",
  "found": false,
  "reason": "Invalid PIN code: must be exactly 6 digits, no leading zero.",
  "scrapedAt": "2025-01-01T00:00:00Z"
}
```

### Pricing

**$2 per 1,000 results** (Apify default pay-per-result on dataset items). Every row pushed to the dataset counts as one billed result — **including `found=false` rows** for invalid input, no records, or network errors.

### Limits

- Max **500 PIN codes** per run (extra entries are truncated with a warning).
- Polite rate limit: ~1 request per second to the public API.
- Public data only. No login, no captchas, no personal data.
- Data source terms: this Actor relies on `api.postalpincode.in`. No usage terms are referenced by the source; the endpoint's terms are set by its operator and could not be verified here. Please check the endpoint's terms before commercial redistribution or high-volume use.

### Disclaimer

This is an **unofficial** Actor and is **not affiliated with India Post**. It uses a third-party public API (`api.postalpincode.in`) that returns post-office records associated with Indian PIN codes. Availability, completeness, and correctness of the data are **not guaranteed** — the data is provided **as-is**, and no guarantee of accuracy, completeness, or availability is made. Do not rely on this for postal, legal, or delivery-critical decisions without verifying against official India Post sources.

This Actor is not affiliated with, endorsed by, or supported by India Post, the Department of Posts, or the Government of India. Upstream terms are set by `api.postalpincode.in`; please confirm the endpoint's usage terms before high-volume use.

# Actor input Schema

## `pincodes` (type: `array`):

Up to 500 Indian PIN codes (6 digits each). Example: \["411001", "110001", "560001"]. Invalid entries are returned as found=false items with a reason.

## Actor input object example

```json
{
  "pincodes": [
    "411001",
    "110001",
    "560001"
  ]
}
```

# Actor output Schema

## `results` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "pincodes": [
        "411001",
        "110001",
        "560001"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("jayraj0975/india-pincode-bulk-lookup").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "pincodes": [
        "411001",
        "110001",
        "560001",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("jayraj0975/india-pincode-bulk-lookup").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "pincodes": [
    "411001",
    "110001",
    "560001"
  ]
}' |
apify call jayraj0975/india-pincode-bulk-lookup --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,jayraj0975/india-pincode-bulk-lookup"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/3QXBLNwrYKNCrs598/builds/dcYh3gefbwnmZ7pHl/openapi.json
