Google announced availability of their Goo.gl URL shortening service on their blog.
With this API, developers are able to programmatically access all of the fast, sleek goo.gl goodness that Google currently provide via the web interface. You can shorten and expand URLs using the API, as well as fetch your history and analytics. You could use these features for a wide variety of applications, enabling behaviors ranging from auto-shortening within Twitter or Google Buzz clients to running regular jobs that monitor your usage statistics and traffic patterns. You can check out the Google APIs console to get started.
The documentation can be found on the Google Code site, with example code in the Getting Started section.
JP Hellemons made a nice example code for ASP.Net C#