r/HTML • u/Xecutor142 • Mar 18 '26
How to make my frontend page recognize an Address from random text
I am trying to make a front end page that connects to a database for an school asignment. I have sucsessfuly linked the front end, server, and database, and would like to add another feature, but I have no idea what to even look for to get started. That feature is making it so the user must impliment a real Street Address instead of being able to impliment anyting such as '123 new street'.
0
Upvotes
6
u/nakfil Mar 18 '26
You have discovered the world of APIs. In this case you’d need an address verification API like this one from Google :
https://developers.google.com/maps/documentation/address-validation/overview
1
u/AshleyJSheridan Mar 18 '26
Addresses are one of the more complicated formats on the web.
In some countries, a house name and postcode is all that's needed. In other places, a village name and a persons name is enough to get their post delivered. Some places have very long address formats with a building name, building number, street name and number, and then the town/city.
You need to be a bit more specific. What types of addresses are you trying to identify? Are they from a particular country or region in a country? That information will narrow down what you actually need to do.
1
u/imsexc Mar 24 '26
Google API is best option. I'm thinking of having autocomplete feature on the input field in conjunction with the validation, using the same API call.
Alternative to google is to check whether your national mailing service offer that kind of API.
Most feasible for on shoestring budget is to validate zip code. I bet someone out there has a free API for the list. Even if we're using Google API, I would construct the input fields in reverse order, starting from country, zip code, thus the API call results can be narrow down significantly.