There are a large number of API’s that validates the address for you. So you would need to create the webservice to use such an API. There are even already some appstore components you could check. For the Netherlands there are multiple but I think this one works global: https://marketplace.mendix.com/link/component/2912
It is old though and needs rework. But you could try to download it and see how it works. Do note that most of these address services are not free and are commercial products.