How to Normalize a Street Address in Node.JS

Cloudmersive
2 min readNov 23, 2020

When retrieving user information such as street addresses, the formatting may be different from what is accepted standard for computer programs. This is particularly relevant when pulling information from text strings in emails or other correspondence. This API will normalize and validate input street addresses; if the address is valid, it will also return the latitude and longitude of the location.

To use this API, run this command to install the SDK:

npm install cloudmersive-validate-api-client --save

You can also add this snippet to your package.json:

"dependencies": {
"cloudmersive-validate-api-client": "^1.2.4"
}

Then, you can call the function:

var CloudmersiveValidateApiClient = require('cloudmersive-validate-api-client');
var defaultClient = CloudmersiveValidateApiClient.ApiClient.instance;
// Configure API key authorization: Apikey
var Apikey = defaultClient.authentications['Apikey'];
Apikey.apiKey = 'YOUR API KEY';
var apiInstance = new CloudmersiveValidateApiClient.AddressApi();var input = new CloudmersiveValidateApiClient.ValidateAddressRequest(); // ValidateAddressRequest | Input parse requestvar callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.addressNormalizeAddress(input, callback);

Now, you can ensure that your systems can read and accept all valid street addresses.

You can retrieve the API Key from the Cloudmersive website at no cost and with no commitment. This will provide you with 800 monthly calls across our library of APIs.

--

--

Cloudmersive

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