Use the PIN lookup endpoint
Request the six-digit PIN and inspect the returned post-office records. Collect state and district values from the records rather than assuming a single row always represents the whole PIN.
GET https://api.pincodeapi.in/api/v1/pincode/110001Do not treat district as city
The postal dataset used by this site has state and district fields but no reliable city field. If your application needs a city, collect it separately or use another verified location source.
Handle more than one district
Some PIN codes in the source are associated with records from more than one district. Your data model should allow more than one distinct district instead of silently selecting the first result.