UrbanScraper implements a simple API for accessing Urban Dictionary. Nick Charlton built this to get definitions through Alfred.
Note: This was built because Urban Dictionary don't have their own API. To make it work, this relies on screen scraping. If you don't get a result when you should, something has probably changed. Shout at me.
The possible methods are below. Currently you can only get the first definition of a word.
GET /define/term.json
{
"timestamp":1319831727,
"example":"\"zOMG! you r teh winz!!one!!eleven!\"",
"word":"zomg",
"url":"http://www.urbandictionary.com/define.php?term=zomg",
"definition":"zOMG is a varient of the all-too-popular acronym \"OMG\"",
"status":200
}
Returns the definition of a given term. Returns a status code of 404 if the term is invalid. The order of the JSON isn't guaranteed. The timestamp represents when it was last fetched.
The code is up on GitHub. It's MIT licensed. And, it's hosted on Heroku
The content is owned by those who submitted it to Urban Dictionary. Using this (presumably) puts you under the Urban Dictionary Terms of Service.
A little bit of caching is done on my side to keep the hits to Urrban Dictionary down, but even then, please don't abuse it. They probably wouldn't like it.