Normalize a Street Address in Python

When inputting addresses into a program or spreadsheet, it can be tedious to pull out each piece by hand. The following API will parse, normalize, and validate a street address instantly. If the address is valid, it will also return the latitude and longitude for the location.

Image for post
Image for post

You can use this API by running this command to install the SDK:

pip install cloudmersive-validate-api-client

Then, you can call the function:

from __future__ import print_function
import time
import cloudmersive_validate_api_client
from import ApiException
from pprint import pprint

This will return objects containing the building type, street number, street, city, state or province, postal code, country name and code, and the latitude and longitude. 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.

Written by

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