indian-post
v1.2.1
Published
Postal PIN Code API allows developers to get details of Post Office by searching Postal PIN Code
Downloads
12
Readme
Postal Data Library
Postal PIN Code API allows developers to get details of Post Office by searching Postal PIN Code
Features of this library
- Postal PIN Code API returns the response in JSON format.
- "Status" field in response is set to SUCCESS or ERROR, "Message" field will return message against the request
- "PostOffice" field will return data.
How to use
Let's see about js code:
let { postalData } = require('indian-post')
postalData.getPostData(400017).then(function (res) {
console.log('Post office data', res)
})
Response For Valid PIN Codes:
{
"Message": "Number of Post office(s) found: 2",
"Status": "Success",
"PostOffice": [
{
"Name": "Dharavi",
"Description": "",
"BranchType": "Sub Post Office",
"DeliveryStatus": "Delivery",
"Taluk": "Mumbai",
"Circle": "Mumbai",
"District": "Mumbai",
"Division": "Mumbai West",
"Region": "Mumbai",
"State": "Maharashtra",
"Country": "India"
}
]
}
Response For Invalid PIN Codes or Error messages:
{
"Message":"No records found",
"Status":"Error",
"PostOffice":null
}