Validating an Address in Java

Collecting user information is a common process for most online businesses, and while it seems like a minor piece of the puzzle in comparison to your company goals, it can throw a wrench into the flow very quickly when it’s inaccurate. By leveraging the following API, you will be able to automate the validation of a user address behind the scenes with minimal effort.

Image for post
Image for post

To utilize this Cloudmersive API in Java, we will first install the with Maven by adding a reference to the repository in pom.xml:


Next, we will add a reference to the dependency:


After this, we are going to place our imports in the controller, create an instance of the API, and call the function:

// Import classes:
//import com.cloudmersive.client.invoker.ApiClient;
//import com.cloudmersive.client.invoker.ApiException;
//import com.cloudmersive.client.invoker.Configuration;
//import com.cloudmersive.client.invoker.auth.*;
//import com.cloudmersive.client.AddressApi;

The returned result will instantly indicate if the input address is valid or invalid. To ensure the accuracy of your result, don’t forget to copy your API key from the Cloudmersive website! If you are new to the service, you can register for a free account to receive your personal API key and gain access to 800 monthly calls across our library of APIs.

There’s an API for that. Cloudmersive is a leader in Highly Scalable Cloud APIs.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store