Free Indian Pincode API

Welcome to the easiest way to find Indian postal codes and post office details. Whether you are building an app, a website, or just need accurate delivery information, our free API gives you instant access to the complete database of post offices across India.

Base URL: https://api.pincodeapi.in/api/v1

Where Does the Data Come From?

We use official data from the India Post, clean it up, and organize it into simple JSON data so it’s super easy for you to use. You can trust that the zip codes, districts, and states are perfectly accurate and up to date for your school projects or business apps.

How People Use This API (Examples):

How to Get Data (API Endpoints)

Think of an 'endpoint' like a specific web address you visit to get a certain piece of information. Just use a standard web link (a GET request) to perform a post office search, and our server will send the results right back to you!

GET /api/v1/pincode/{pincode}

Get a list of all post offices that share a specific 6-digit postal code.

curl https://api.pincodeapi.in/api/v1/pincode/110001
Live Test
GET /api/v1/state/{statename}

Get a list of all post offices located inside a specific Indian state (like Delhi or Maharashtra).

curl https://api.pincodeapi.in/api/v1/state/Delhi
Live Test
GET /api/v1/district/{districtname}

Get a list of all post offices located inside a specific district.

curl https://api.pincodeapi.in/api/v1/district/New%20Delhi
Live Test
GET /api/v1/search?q={query}

Type in any name, and we will do a fast state and district lookup across all office names and pincodes. This is perfect for building search bars!

curl "https://api.pincodeapi.in/api/v1/search?q=Connaught Place"
Live Test

Understanding the Data You Get Back

When you ask our free pincode api for information, it sends back a clear list of details. Here is exactly what each piece of information means:

Field Type Description
idIntegerUnique internal primary key.
officenameStringThe exact registered name of the post office.
pincodeStringThe 6-digit postal code.
officetypeStringOffice category (e.g., PO, BO, HO, SO).
deliveryString"Delivery" or "Non Delivery".
districtStringThe geographical district.
statenameStringThe geographical state.
latitudeFloat/NullGPS Latitude coordinate.
longitudeFloat/NullGPS Longitude coordinate.

Page Limits and Speed Rules

Breaking Results into Pages

If you search for a big state, you might get thousands of results! To keep things running fast for everyone, we break large lists into smaller 'pages'.

curl "https://api.pincodeapi.in/api/v1/state/Uttar Pradesh?page=2&limit=50"

Fair Usage Rules (Rate Limits)

To make sure our server never slows down, we allow each user to make 60 requests every minute. If you ask for too much too fast, we will temporarily pause your access to protect the system.

Also, if you ask for the exact same thing twice in a row, our system remembers your last answer and gives it to you instantly from memory. This saves internet bandwidth and makes your app feel incredibly fast!

Handling Errors Safely

Sometimes things go wrong—like searching for a zip code that doesn't exist. When that happens, we send back a simple message explaining exactly what went wrong so you can fix it easily.

{ "status": "error", "error": { "code": 404, "type": "EndpointNotFound", "message": "The requested endpoint does not exist." } }
Code What it means
200 OKEverything worked perfectly!
304 Not ModifiedYou already have the latest data, so we didn't send it again.
400 Bad RequestThere was a typo in your request, like asking for page 1000.
404 Not FoundWe couldn't find what you were looking for.
405 Method Not AllowedYou tried to send data to us, but this API is only for reading data.
429 Too Many RequestsYou asked for data too fast! Please wait a minute and try again.
500 Server ErrorOops! Something broke on our computer servers.

Code Examples

Connecting your app to our data is incredibly easy. Pick your favorite programming language below to see how to write the code.

import requests url = "https://api.pincodeapi.in/api/v1/pincode/110001" response = requests.get(url) if response.status_code == 200: data = response.json() print(f"Found {len(data['data'])} post offices!") for office in data['data']: print(f"- {office['officename']} ({office['officetype']})") else: print(f"Error: {response.status_code}")
const url = "https://api.pincodeapi.in/api/v1/pincode/110001"; fetch(url) .then(response => response.json()) .then(data => { if (data.status === "success") { console.log(`Found ${data.data.length} post offices!`); data.data.forEach(office => { console.log(`- ${office.officename} (${office.officetype})`); }); } else { console.error(data.error.message); } }) .catch(error => console.error('Fetch error:', error));
<?php $url = "https://api.pincodeapi.in/api/v1/pincode/110001"; $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); $httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); if ($httpcode === 200) { $data = json_decode($response, true); echo "Found " . count($data['data']) . " post offices!\n"; foreach ($data['data'] as $office) { echo "- {$office['officename']} ({$office['officetype']})\n"; } } else { echo "Error: HTTP $httpcode\n"; } ?>
# Fetch data for a pincode and pipe to jq for pretty printing curl -s "https://api.pincodeapi.in/api/v1/pincode/110001" | jq '.'
package main import ( "encoding/json" "fmt" "io" "net/http" ) type APIResponse struct { Status string `json:"status"` Data []struct { OfficeName string `json:"officename"` OfficeType string `json:"officetype"` } `json:"data"` } func main() { resp, err := http.Get("https://api.pincodeapi.in/api/v1/pincode/110001") if err != nil || resp.StatusCode != 200 { fmt.Println("Error fetching data") return } defer resp.Body.Close() body, _ := io.ReadAll(resp.Body) var result APIResponse json.Unmarshal(body, &result) fmt.Printf("Found %d post offices!\n", len(result.Data)) }

Frequently Asked Questions

Is this Pincode API actually free?

Yes! It is completely free for everyone to use, whether you are a student learning to code or a business building an app. Just remember to stay under the 60 requests per minute rule.

What format does the data come in?

All of our answers are formatted as simple JSON data. We do not support older formats like XML or CSV directly from the link.

Can I use this directly in a website without a backend?

Absolutely! We have an open CORS policy, which is a fancy way of saying that your website's JavaScript (like React or standard HTML) is allowed to talk to our server directly without any security blocks.