I help to maintain one API called LiveAddress which does this. Much easier to use than Google/Yahoo's APIs, and without the restrictive Terms of Service which prohibit requests en masse, storing the results, or using the data without showing a map or by automation.
Here's a complete example, using this sample wrapper function:
LiveAddress.init(123456789); // your API key here
LiveAddress.geocode("address goes here", function(geo) {
// You can also pass in an array of addresses,
// the ID of a DOM element containing the address,
// or an array of IDs
console.log(geo);
});
Individual coordinates are found in geo.lat
and geo.lon
, with the combined string "lat, lon" format in geo.coords
. You can also obtain the precision of the data with geo.precision
.