Advanced DigiPIN API (India)
Overview
The Advanced DigiPIN Distance API calculates the distance between two locations using DigiPINs, GPS coordinates, or a combination of both. In addition to calculating the distance, the API resolves each location into detailed postal information, including the corresponding PIN code, post office, postal division, region, and circle.
The API supports flexible input combinations, allowing each point to be identified either by a DigiPIN or by latitude and longitude coordinates. It also determines whether a location lies outside India or near an international border, making it suitable for logistics, location intelligence, address verification, and geospatial analysis.
Use Cases
- Calculate the distance between two DigiPIN locations.
- Calculate the distance between a DigiPIN and GPS coordinates.
- Convert DigiPINs into geographic coordinates and postal information.
- Determine whether a location lies outside India or near an international border.
- Support logistics, delivery planning, address verification, and risk assessment.
Endpoint
POST /api/v3/digipin-to-pincode
Headers
Header | Required | Description |
|---|---|---|
Authorization | Yes | Bearer token/API authorization token |
Content-Type | Yes | application/json |
Supported Request Formats
Option 1: DigiPIN to DigiPIN
Request Body
Field | Type | Required | Description |
|---|---|---|---|
digipin1 | String | Yes | DigiPIN for Point 1 |
digipin2 | String | Yes | DigiPIN for Point 2 |
Sample Request
{
"digipin1": "F32-456-789T",
"digipin2": "4FK-595-8823"
}Option 2: DigiPIN to Coordinates
Request Body
Field | Type | Required | Description |
|---|---|---|---|
digipin1 | String | Yes | DigiPIN for Point 1 |
latitude2 | Number | Yes | Latitude for Point 2 |
longitude2 | Number | Yes | Longitude for Point 2 |
Sample Request
{
"digipin1": "F32-456-789T",
"latitude2": 19.0760,
"longitude2": 72.8777
}Request Validation Rules
For each point (Point 1 and Point 2), provide either:
- DigiPIN OR
- Latitude and Longitude
Do not provide both DigiPIN and coordinates for the same point.
Example of an invalid request:
{
"digipin1": "F32-456-789T",
"digipin2": "4FK-595-8823",
"latitude2": 19.0760,
"longitude2": 72.8777
}Response:
{
"result": {},
"reason": "Bad Request: If digipin is provided, coordinates should not be provided for the same point",
"code": "E001"
}Response
Field | Type | Description |
|---|---|---|
result | Object | API result |
result.point1 | Object | Details for Point 1 |
result.point2 | Object | Details for Point 2 |
result.point1.digipin | String | DigiPIN of the resolved location |
result.point1.latitude | Number | Latitude |
result.point1.longitude | Number | Longitude |
result.point1.pincode | String | Indian PIN code (if available) |
result.point1.officeName | String | Post Office name |
result.point1.division | String | Postal Division |
result.point1.region | String | Postal Region |
result.point1.circle | String | Postal Circle |
result.point1.internationalBorder | Boolean | Indicates if the location is near an international border |
result.point1.borderState | String | Border state (if applicable) |
result.point1.borderCountry | String | Border country (if applicable) |
result.point1.outsideIndia | Boolean | Indicates whether the location is outside India |
result.point2 | Object | Same structure as Point 1 |
result.distanceKm | String | Distance between the two points in kilometers |
reason | String | API response message |
code | String | API response code |
Sample Response
{
"result": {
"point1": {
"digipin": "F32-456-789T",
"latitude": 35.31604194641113,
"longitude": 67.12093925476074,
"pincode": "",
"officeName": "",
"division": "",
"region": "",
"circle": "",
"internationalBorder": false,
"borderState": "",
"borderCountry": "",
"outsideIndia": true
},
"point2": {
"digipin": "4FK-595-8823",
"latitude": 19.07598304748535,
"longitude": 72.87770652770996,
"pincode": "400070",
"officeName": "Kurla West SO",
"division": "Mumbai City North East",
"region": "Mumbai",
"circle": "Maharashtra",
"internationalBorder": false,
"borderState": "",
"borderCountry": "",
"outsideIndia": false
},
"distanceKm": "1892.4"
},
"reason": "Request Successful",
"code": "S001"
}Response Codes
Code | Description |
|---|---|
S001 | Request Successful |
E001 | Invalid request. DigiPIN and coordinates cannot both be provided for the same point. |