India Pincode API

India Postal Pincode API

What is Pin Code API and its use?

Using this Pincode API (Application Programming Interface) you can get the information about postal address, City name, District name and State name for specific pin code which you can call inside your application to get result. Using this postal pin code api, you can also get city name from pin code api by making a simple GET request. You can use it in your application to validate city and state in your web form free of cost.

1. Get City Name/Area Name from pin code.

You can begin by making a GET request to the API endpoint. The endpoints for this activity are

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.

You can pass in the desired postal code as a query parameter in the format "pincode=XXXXXX".
For example, to retrieve information about the postal code 201301, you can make a GET request to

https://www.postpincode.in/api/getPostalArea.php?pincode=201301".

You will get a response the list of area belongs to that pincode in JSON format as below.

[ { "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" } ]

3. Get City Name from pin code API.

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" } ]


API Request Limit:

There is no limit in number of API Call, however more than 1000 request per day considered to be commercial use. Contact us form to increase limit.

FAQ.

Q. Why my area not showing any pincode in getPostalCode API?

This is because your area in not listed in pincode database. The database is a list of post office address in India. If there is no post office in your area then it will not show any result. Try to enter your post office’s area name to get the pincode. You can also try the city name or district name to get list of post offices in JSON format.

Q. How to get City name from pincode API?

You can use https://www.postpincode.in/api/getCityName.php?pincode=201301 API to get city name from Pin code. Call this URL and enter pincode and get result in JSON. You can use this to validate pincode to city api in your APP.

Q. How to get pincode api free?

We provide pincode api free of cost. You can use our api for free however for large commercial use we can provide API for very nominal price.

PHP Code sample to get address from Pincode using post office api

//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 address from Pincode

/****** 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}.")

Disclaimer

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

Subscribe to Our newsletter to get updates on site and other useful information