1

I would like to improve my forms and remove city and state fields so that there are 2 less fields to fill out. I have an input field for city and select drop-down for state. Instead of asking visitors to fill them out, I can do a look up via JavaScript or backend like php to populate the city and state before saving the record in my database. I'm leaning towards a web service versus an offline zip db that I would have to keep up to date.

Are there any free or cheap tools I can use to populate city and state based on zip code provided?

5
  • 3
    Maybe you can find a database on [opendata](opendata.stackexchange.com) depending on the regions you need e.g. Is there a tool to match zip codes to cities? Trying to link ZIP code to core-based statistical area Any help on getting the city or zip codes that make up metropolitan statistical areas?
    – bummi
    Commented May 12, 2019 at 18:31
  • 1
    What kind of fields you're talking about? What your website is using (Wordpress/Drupal/Wix)? Is it for back-end or front-end? Are you looking for JavaScript or PHP/Python library, a web service (like Google Places API) or just the plain off-line database?
    – kenorb
    Commented May 12, 2019 at 19:57
  • 1
    I have an input field for city and select drop-down for state..Instead of asking visitors to fill them out, I can do a look up via JavaScript or backend like php to populate the city and state before saving the record in my database. I'm leaning towards a web service versus an offline zip db that I would have to keep up to date.
    – Julian
    Commented May 12, 2019 at 20:49
  • 1
    Welcome to Software Recommendations! We will need much more information to give good recommendations here. Please take a look at What is required for a question to contain "enough information"? Then please edit your question and see if you can incorporate some of these improvements. Details from your comment e.g. should be part of the question body.
    – Izzy
    Commented May 12, 2019 at 22:04
  • Can you define "cheap"? See, for instance, my comment to @Jane's asnwer
    – Mawg
    Commented Feb 7, 2020 at 12:24

1 Answer 1

2

You can look into zip apis that allow you to receive city and state based on provided zip code. One that is free to use is zipapi.us and they provide what you are needing to accomplish with your form.

1
  • Free for 10 requests per hour, 240 per day; thereafter, the pricing plan is here
    – Mawg
    Commented Feb 7, 2020 at 12:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.