API documentation

API Error Codes

Understand what an API error means and whether to correct, wait or retry the request.

Error response format

API errors use application/problem+json. The HTTP status gives the broad failure type, while the code field is intended for stable programmatic handling.

{
  "type": "https://api.pincodeapi.in/problems/pincode-not-found",
  "title": "PIN code not found",
  "status": 404,
  "detail": "No postal record was found for the requested PIN code.",
  "instance": "/api/v1/pincode/999999",
  "code": "PINCODE_NOT_FOUND",
  "request_id": "example-request-id"
}

Use the HTTP status or stable code rather than matching the wording of title or detail.

HTTPError codeWhat to do
400INVALID_PINCODECorrect the PIN format before trying again.
404PINCODE_NOT_FOUNDCheck the PIN. Do not retry the same unchanged request repeatedly.
400INVALID_QUERYCorrect the search query.
405METHOD_NOT_ALLOWEDUse the documented GET method.
429RATE_LIMITEDWait before sending more requests and follow Retry-After when supplied.
404ENDPOINT_NOT_FOUNDCheck the /api/v1 base URL and endpoint path.
500INTERNAL_ERRORUse a small, bounded retry strategy.
503SERVICE_UNAVAILABLETry again later with backoff.