Pincode Lookup (India)

The Pincode Lookup API identifies the Indian pincode corresponding to a given drop location (latitude and longitude).

Drop Pincode Lookup API

Allowed HTTP Methods

  • POST

URL

base_url -https://hld.clickpost.in

<baseURL>/api/v1/geospatial/fetch_pincode

URL Query Parameters

ParameterTypeRequiredDescription
keyStringYesClickPost API key

Request Body Parameters

ParameterTypeRequiredDescription
drop_latitudedoubleYesLatitude of the drop location.
Should be a valid India latitude.
drop_longitudedoubleYesLongitude of the drop location.
Should be a valid India longitude.

Sample API cURL

curl --location '<base_url>/api/v1/geospatial/fetch_pincode?key=<API_KEY>' \
--header 'Content-Type: application/json' \
--data '{
    "drop_latitude":28.382072, 
    "drop_longitude":77.201517
}'

Request JSON Format

Field NameData TypeDescriptionValue Constraints
drop_latitudedoubleLatitude of the drop location for which the corresponding Indian pincode needs to be fetched.cannot be null
drop_longitudedoubleLongitude of the drop location for which the corresponding Indian pincode needs to be fetched.cannot be null

Response JSON Format

Field NameData TypeDescriptionValue Constraints
metaJSON ObjectMetadata about the request, such as status code and message describing the result. Refer to Possible Meta Statuses section below.cannot be null
resultJSON ObjectResult containing the pincode corresponding to the provided drop location.Can be null in case of error

meta object fields

Field NameData TypeDescriptionValue Constraints
messagestringHuman-readable message describing the error.can be null or empty
statusintegercontains the status code as per response messagecannot be null
successbooleanContains boolean value true request succeeded or false request failedcannot be null

result object fields

Field NameData TypeDescriptionValue Constraints
drop_pincodeintegerIndian pincode corresponding to the provided drop_latitude and drop_longitude.Cannot be null

Possible Meta Statuses

HTTP Status Codemeta.statusmeta.message
200200Request is executed successfully
4004001Invalid request json
4004003Invalid or missing request
403403Access is not allowed
404404Pincode Details not found in system
4044007API Not Found
500500Something went wrong in Clickpost server

Example Responses

Success Response

When the provided latitude and longitude correspond to a valid location in India and a pincode is available for the location.

{
    "result": {
        "drop_pincode": 121004
    },
    "meta": {
        "status": 200,
        "success": true,
        "message": "Request is executed successfully"
    }
}

Error Response

When the request body is invalid or required latitude/longitude parameters are missing.

{
    "result": null,
    "meta": {
        "status": 404,
        "success": false,
        "message": "Pincode details not found in system for lat : 28.382072, long : 71.201517"
    }
}

Did this page help you?