its frustrating to fill out your address upto pincode and country which can be fetched automatically, on most website they do fetch city, state, etc from pincode, i am just putting them in string like this one "Dadar, Mumbai-400014, Maharashtra, India" like a classic "Base Address", user will now only have to fill in
- pincode
- room number, building number, their wing and floor
rest is autofilled, in address field or before address field ask user to enter pincode, make address field focuesd and let user choose the base address from mulitple base addresses for their pincode, once selected place cursor in starting position of address field and let user complete their address,
eg: "291/38, 2nd Floor, Gurukrupa Society a-wing, Dadar, Mumbai-400014, Maharashtra, India"
eg:
GET https://pincode-base-address.vercel.app/api/getBaseAddress/400014
response:
{
"baseAddresses": [
"Dadar, Mumbai-400014, Maharashtra, India",
"Dadar Colony, Mumbai-400014, Maharashtra, India",
"Naigaon (Mumbai), Mumbai-400014, Maharashtra, India"
],
"district": "Mumbai",
"state": "Maharashtra",
"areas": [
"Dadar",
"Dadar Colony",
"Naigaon (Mumbai)"
],
"pincode": "400014",
"country": "India"
}
using https://api.postalpincode.in/pincode/ to get pincode data
Top comments (0)