API documentation

API Endpoints

Request examples for the public V1 API.

Public V1 endpoints

The examples below use the current public base URL https://api.pincodeapi.in/api/v1. All shown routes are read-only GET requests.

PurposeEndpoint
PIN code lookupGET /pincode/{pincode}
State lookupGET /state/{state}
District lookupGET /district/{district}
Post office searchGET /search?q={query}
Health checkGET /health

PIN code lookup

GET https://api.pincodeapi.in/api/v1/pincode/751001

A successful PIN lookup returns a success flag, a data object with the requested PIN and its post_offices, and request information in meta. One PIN code can be linked to several post offices.

State lookup

GET https://api.pincodeapi.in/api/v1/state/Odisha

Use the state or Union Territory name in the path. URL-encode spaces and other reserved characters when required.

District lookup

GET https://api.pincodeapi.in/api/v1/district/Khordha

Use the district name in the path. A district name is not the same as a city name, and this website does not treat district as city.

GET https://api.pincodeapi.in/api/v1/search?q=Bhubaneswar&limit=20&offset=0

Use q for the search text, limit to control the maximum number of results, and offset to continue through a larger result set. Search can return more than one match, so check the office name, PIN code, district and state before using a result.

Health check

GET https://api.pincodeapi.in/api/v1/health

The API root at https://api.pincodeapi.in/ publishes the current API path, documentation URL, health path and V1 service metadata.

API discovery

{
  "success": true,
  "data": {
    "api": "/api/v1",
    "documentation_url": "https://pincodeapi.in/docs/",
    "health": "/api/v1/health",
    "service": "PincodeAPI.in",
    "website": "https://pincodeapi.in/"
  },
  "meta": {
    "api_version": "v1"
  }
}

Use the discovery document to confirm the public API path and documentation location. Request-specific metadata such as release and request identifiers can change and should not be hard-coded by clients.

OpenAPI

Use the OpenAPI JSON or OpenAPI YAML for a machine-readable description of the public routes documented on this website.