https://www.postpincode.in/api/getPostalArea.php to get location and state from pincode. https://www.postpincode.in/api/getPostalCode.php to pincode from nearest post office location. https://www.postpincode.in/api/getCityName.php to get Ciry name and district name from Pincode.
https://www.postpincode.in/api/getPostalArea.php?pincode=201301".
[
{
"Pincode":"201301",
"PostOfficeAddress":"Noida HO",
"District":"GAUTAM BUDDHA NAGAR",
"State":"UTTAR PRADESH"
},
{
"Pincode":"201301",
"PostOfficeAddress":"Sec 16 Noida SO",
"District":"GAUTAM BUDDHA NAGAR",
"State":"UTTAR PRADESH"
},
{
"Pincode":"201301",
"PostOfficeAddress":"Sec 27 Noida SO",
"District":"GAUTAM BUDDHA NAGAR",
"State":"UTTAR PRADESH"
}
]
To get pincode you can pass in the desired area name as a query parameter in the format "area='area name'". if area not found try nearest post office area name or city name to list pincode belongs to city/area.`
API URL: https://www.postpincode.in/api/getPostalCode.php?area='Sec 16'
JSON Response:
[
{
"Pincode":"201301",
"PostOfficeAddress":"Sec 16 Noida SO",
"District":"GAUTAM BUDDHA NAGAR",
"State":"UTTAR PRADESH"
}
]
You can get City name from Pin code by using below API. Use This API to validate in Web form or Mobile APP. Enter the pincode in parameter and get the result with City and district name in JSON format.
API URL: https://www.postpincode.in/api/getCityName.php?pincode=201301
You can pass in the desired pincode and get the city name as a query parameter in the format "pincode=201201" where 201301 is your pinoode. and get city name in JSON response as below.
JSON Response:
[
{
"Pincode":"201301",
"City":"Noida",
"District":"Gautam Buddha Nagar",
"State":"Uttar Pradesh"
}
]
//PHP Code to generate area based on Pincode. Add PHP tag in code.
$pincode = $_GET['pincode'];
$url = "https://www.postpincode.in/api/getPostalArea.php?pincode=" . $pincode;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($ch);
$result = json_decode($response);
curl_close($ch);
print_r($result);
// End of PHP Code
/****** Python Code sample ****************/
import requests
def get_area_from_pincode(pincode):
url = f"https://www.postpincode.in/api/getPostalArea.php?pincode={pincode}"
response = requests.get(url)
data = response.json()
if data["status"] == "success":
return data["area"]
else:
return None
pincode = "123456"
area = get_area_from_pincode(pincode)
if area:
print(f"The area for pincode {pincode} is {area}.")
else:
print(f"No area found for pincode {pincode}.")
The pin code informations which is provided here sourced from official website of Indaa Postal website. We have just represented it differently for easy to use for our visitor. The data last updated 10 Nov 2022. Anyone can take the information for free, still we do not guarantee its correctness for legal purposes. You should cross verify it from Indian postal website before using any legal documents or any other purposes. We are not responsible for any damage or loss incur due this information.
Subscribe to Our newsletter to get updates on site and other useful information