Postal Code API

The Postal Code API returns the city and state for a given postal code (pincode). It’s useful for validating user input, auto-filling address forms, or verifying delivery coverage.

πŸ”‘ Authentication

  • All requests must include your API key.
  • Header Example:
  • Authorization: X-Authorization-Token (Get your token HERE)

🌐 Endpoint

  • GET /v4/pincode
  • Base URL: https://apihub.latlong.ai/v4/pincode

πŸ“₯ Request Parameters

ParameterTypeRequiredDescription
pincodeStringYes6-digit postal code

πŸ“€ Sample Request


  curl --location β€˜https://apihub.latlong.ai/v4/pincode.json?pincode=560019'  

πŸ“¦ Sample Response

{ 

  "code": 1001, 

  "status": "success", 

  "data": [ 

    { 

      "geoid": null, 

      "district": "Bangalore", 

      "state": "Karnataka", 

      "pincode": "560019", 

      "office_name": "Gaviopuram Extension", 

      "office_type": "S.O", 

      "latitude": 12.947128, 

      "longitude": 77.562411, 

      "gca": "Bengaluru City" 

    } 

  ] 

}  

🧠 Features

  • ⚑

    Fetch city and state by entering just a 6-digit pincode

  • πŸ“

    Ideal for e-commerce, logistics, and address form validation

  • πŸ—Ί

    ️ Fast and lightweight response structure

⚠️ Errors

Status CodeMessageDescription
400Missing required parametersWhen query is not provided
401UnauthorizedAPI key missing or invalid
404Not foundNo location found for the given pincode
500Internal Server ErrorSomething went wrong on our side

Best Practices

  • Validate the pincode format before sending the request
  • Use in autocomplete forms to auto-populate city/state fields
  • Store successful lookups in cache to reduce API calls