Ahoy nerds! Some cool pirate related API’S

Happy international speak-like-a-pirate day! As part of my legal-document-writing-procrastinating I began researching pirate translators – thanks to Cyborgs’ genius idea of writing a section 6 in pirate language;*

I stumbled upon the treasure chest that is pirate.monkeyness.com.

pirate.monkeyness.com hosts not one but two glorious API’s, the first of which is a pirate translator and the second of which is a pirate insult generator.

There are so many wonderfully stupid ways to use this API – let your creativity run free! My first project will be an arduino-powered doorbell that shouts pirate insults at any bailiffs, security, police or stressed out landlords that press it. Here’s a compass for it-

Full post coming soon!

Using the API is simple – simply send an HTTP GET request in your favourite language to either https://pirate.monkeyness.com/api/insult, which will return a random insult or to https://pirate.monkeyness.com/api/translate, with the parameter “english” set to the text you would like to translate, URL-encoded – which will return your text, pirate-translated. Here are some examples of how to use it in code:

Command line (linux/macos/windows):

curl --data-urlencode "english=[input]" "https://pirate.monkeyness.com/api/translate"

Python (also works on raspberry pi!):

import urllib3
http = urllib3.PoolManager()
input = "[input]" #text to translate
response = http.request('GET', 'https://pirate.monkeyness.com/api/translate', headers={
	'english': input
})
output = response.data.decode('utf-8')
print(output)

JavaScript:

fetch("https://pirate.monkeyness.com/api/insult").then(function(response) {
  return response.json();
}).then(function(data) {
  console.log(data);
}).catch(function() {
  console.log("Shiver me timbers!! An error!!");
});

Be sure to comment/post any ideas/experiments!


*which, if you’re interested in, is available here:

Published by

Bin Diva

A flash of colour, a whisper of sound and a thin trail of of all things shiny; the only trace given as she scurries out of the dumpster and into the night...

2 thoughts on “Ahoy nerds! Some cool pirate related API’S”

  1. This is so amazing! I’m particularly blown away by the S6 that it made, did you edit anything? The speaking doorbell, well… while I understand it and can see and hear it in my imagination, it’s going to be so awesomly amazing to actually experience it in real life…. I can’t wait!

    1. Nope the section 6 came straight from the translator! I like “thar be at least one scallywag in occupation” a lot- looking forward to insulting some bailiffs as well >:)

Leave a Reply