Access Pastebin's Code Snippets and Hacker Rants via API

As a developer, good ways to store those often-reused snippets of code that correctly solve a common problem is always useful. Now, there are other solutions to this problem, such as the Snipt API, which I covered previously, but is the most often used, perhaps because it has beeb the favored place for notes from hacker group LulzSec. Pastebin has a nice, full-featured API, and is simple and free to use, at least at a basic level.

Pastebin's popularity is due to a number of factors. TheNextWeb wrote a nice story talking about why Pastebin is so popular, especially among hackers. From their story:

As social network use became more widespread, interest in Pastebin began to pick up also. Although the service was originally created to share bits of Source Code and chat logs, members of Twitter – the world’s most popular microblogging service – started to use Pastebin to write messages that were longer than 140 characters, linking to the “pastes” in their Twitter posts.

In just over a year, Vader developed additional features to extend the reach of Pastebin, providing browser extensions, smartphone and tablet apps and desktop applications. With new tools introduced and the release of Pastebin V3, users began creating pastes from their mobiles and other platforms, utilising the service to create quick and easy To-Do lists.

Its API page is only viewable with a free account, obtainable at its sign up page. Once you've made an account, head on over to the API page to look at the Documentation. The service is RESTful, with responses in either plaintext or XML. The code examples on the site, which offer pretty simple implementations, are all done in PHP and CURL.

Pastebin offers both a free service and a paid service. The paid service is remarkably cheap, and makes things a little easier. For more details on that, look here. One could put the API to lots of interesting little uses, perhaps making an app that backed up pastes with the Evernote API.

Be sure to read the next API article: Need Help Shopping? MyBantu Gives it a Go With APIs