Access Pastebin’s Code Snippets and Hacker Rants via API

Allen Tipper, August 16th, 2011

Pastebin.comAs 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 Pastebin.com 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.

Both comments and pings are currently closed.

One Response to “Access Pastebin’s Code Snippets and Hacker Rants via API”

August 19th, 2011
at 11:03 am
Comment by: Brice

I believe Pastebin is so popular because it was what we were using a decade ago in IRC chats to share code.

Follow the PW team on Twitter

ProgrammableWeb
APIs, mashups and code. Because the world's your programmable oyster.

John Musser
Founder, ProgrammableWeb

Adam DuVander
Executive Editor, ProgrammableWeb. Author, Map Scripting 101. Lover, APIs.