Blogs » Developer Blog » Developer Blog » StumbleUpon Developers Blog – And Su.pr API!

Hi everybody!

Su.pr Click Tracking

Welcome to the new StumbleUpon Developer Blog where we will be frequently posting about the latest StumbleUpon development and technology related news as well as giving all of you a bit of insight into the day to day of the engineering team here at SU. A brief introduction of myself: My name is Edmund Salvacion, a software engineer working with the web applications team at StumbleUpon. My role consists of maintining anything web facing, such as http://www.stumbleupon.com and http://su.pr as well as developing new features for both products. The latest of these features is the topic of today’s blog entry: the Su.pr API.

For those of you who are unfamiliar with Su.pr, it is our brand new short url service designed to drive more traffic to your site. Su.pr provides real time analytics for all of your generated links as well as the ability to post your Su.pr links to other social media services such as twitter and facebook. Another unique feature of Su.pr is the ability to schedule posts in the near future, and being the recommendation gurus we are, we will even suggest the best time for you to post based on past activity. All of this, and more to come, are available from the Su.pr homepage. The new Su.pr API will now allow you to leverage the power of Su.pr from within your own applications.

With the first revision of the Su.pr API, we are granted 4 of the main Su.pr pieces of functionality: shorten, expand, post, and schedule. The API uses the simple to use REST request format with responses in JSON and, if you really want to, XML.

Example:

http://su.pr/api/shorten?longUrl=http://www.stumbleupon.com

As you can see, a simple constructed URL passing paramters through GET is all you need to get going with Su.pr. While this will be handy for generating short URLS,  the true power of Su.pr is shown when you are posting using your Su.pr user credentials. Authentication is simply done by passing login and apiKey paramters along with your request.

Example:

http://su.pr/api/shorten?longUrl=http://www.stumbleupon.com&login=edmundsalvacion&apiKey=fake3c71368f049b699f9ac843c9bkey

Adding my login and API key will associate the Su.pr links to my account where I will have access to the awesome analytics. Authentication is also required for you to use the post and schedule APIs. To get an API key, log into Su.pr, and head to your settings page: http://su.pr/settings/. Remember, this is your private API key, so it’s best to use it internally within your applications. However, if you still need to, you are able to generate a new key at any given time.

The full documentation is available at http://www.stumbleupon.com/help/su-pr-api/. It should have all you need to get running so you can shorten and post from your applications in no time.  Good luck and happy coding!

Cheers,

Edmund Salvacion

/StumbleUpon Team profile picture