There are plenty of geolocation APIs out there. If you need lat/long -> geolocation info (such as city, country ...) correspondence you should look at the Yahoo PlaceFinder API which implements an API call returning informations based on a lat/lon pair (http://developer.yahoo.com/geo/placefinder/).
However most of those APIs are free but limited by the number of API call.
What you can also do is using the IP address of a user to locate him, it will work in most cases since users using proxys or VPNs are few. Then you will be able to use a free service such as http://ipinfodb.com/ip_location_api.php or http://www.iplocationtools.com/api.html to make a correspondence between the IP address and the geolocation infos. There are even free databases you can easily find making this correspondence if you don't want to rely on third-party APIs.
Hope this will help you.