Open source web apis?? There are lots of Free services out there though. Did you Google it?? If not then,
let be Google that for you[
^]
Yahoo's API, though not free seems more useful since it doesn't have the map use restriction.
I also spotted
Geonames[
^] but some say, it is not very accurate beyond city level.
This SO question[
^] also lists many references.