It's called geocoding. There are several free services who provide API. Here are two of them from the first page of my search results:
https://geoservices.tamu.edu/Services/Geocode/WebService/
http://developer.mapquest.com/web/products/dev-services/geoc...