NAV
python shell

Introduction

Welcome to the Indian Pincode API. There are some API’s for Indian Pincodes, but nothing is very extensive and contains many options. So, I have tried to create a new API for this. This API can be used for both commercial and non-commercial purposes. If you have any questions, please mail me at [email protected]

Base API URL is https://pincode.saratchandra.in/api/pincode/`

Endpoints

Get all offices under a certain Pincode

import requests

resp = requests.get("https://pincode.saratchandra.in/api/pincode/500022")
print(resp.json())
curl "https://pincode.saratchandra.in/api/pincode/500022"

The above command returns JSON structured like this:

{
    "status": 200,
    "data": [
        {
            "circle_name": "Andhra Pradesh",
            "delivery_status": "Delivery",
            "district": "Hyderabad",
            "division_name": "Hyderabad City",
            "id": 4686,
            "office_name": "Central Secretariat S.O",
            "pincode": "500022",
            "region_name": "Hyderabad City",
            "state_name": "TELANGANA",
            "taluk": "Khairatabad"
        }
    ]
}

HTTP Request

GET https://pincode.saratchandra.in/api/pincode/:pincode

Query Parameters

Parameter Type Description
pincode int The pincode for which you need addresses.

All the data is contained in data key.

Response Parameters

Key Type Description
circle_name string Circle Name
delivery_status string Delivery status of posts
district string District
division_name string Division Name
office_name string Office Name
pincode string PinCode
region_name string Region Name
state_name string State Name
Taluk string Taluk this address belongs to

Get all the addresses in a city( office name)

import requests

payload = {"city": "Palasa"}
resp = requests.get("https://pincode.saratchandra.in/api/pincode/",
                    params=payload)
print(resp.json())
curl "https://pincode.saratchandra.in/api/pincode?city=Palasa"

The above command returns JSON structured like this:

{
    "data": [
        {
            "circle_name": "Andhra Pradesh",
            "delivery_status": "Delivery",
            "district": "Srikakulam",
            "division_name": "Srikakulam",
            "id": 15513,
            "office_name": "Palasa S.O",
            "pincode": "532221",
            "region_name": "Visakhapatnam",
            "state_name": "ANDHRA PRADESH",
            "taluk": "Palasa Mandal"
        },
        {
            "circle_name": "Odisha",
            "delivery_status": "Delivery",
            "district": "Jagatsinghapur",
            "division_name": "Cuttack South",
            "id": 95536,
            "office_name": "Palasa B.O",
            "pincode": "754103",
            "region_name": "Bhubaneswar HQ",
            "state_name": "ODISHA",
            "taluk": "Jagatsinghapur"
        }
    ],
    "status": 200
}

This endpoint retrieves all the addresses which match the office name, even though they belong to different states or districts.

HTTP Request

GET https://pincode.saratchandra.in/api/pincode?city=<city>

URL Parameters

Parameter Description Type
city The name of the city string

Get all the addresses in a city( office name) belonging to a district

import requests

payload = {"city": "Palasa", "district": "Srikakulam"}
resp = requests.get("https://pincode.saratchandra.in/api/pincode/",
                    params=payload)
print(resp.json())
curl "https://pincode.saratchandra.in/api/pincode?city=Palasa&district=Srikakulam"

The above command returns JSON structured like this:

{
    "data": [
        {
            "circle_name": "Andhra Pradesh",
            "delivery_status": "Delivery",
            "district": "Srikakulam",
            "division_name": "Srikakulam",
            "id": 15513,
            "office_name": "Palasa S.O",
            "pincode": "532221",
            "region_name": "Visakhapatnam",
            "state_name": "ANDHRA PRADESH",
            "taluk": "Palasa Mandal"
        }
    ],
    "status": 200
}

This endpoint retrieves all the addresses which match the office name belonging to the particular district. There may be multiple addresses matching, which is generally rare.

HTTP Request

GET https://pincode.saratchandra.in/api/pincode?city=<city>&district=<district>

URL Parameters

Parameter Description Type
city The name of the city string
district Name of district starting with a capital letter string

Errors

These are the error codes used by this API.

Error Code Meaning
400 Bad Request – Your request sucks
404 Not Found – The specified request could not be found
405 Method Not Allowed – You tried to access a request with an invalid method
500 Internal Server Error – We had a problem with our server. Try again later.
503 Service Unavailable – We’re temporarially offline for maintanance. Please try again later.