Cusstionary API

v.1.0

Introduction

Cusstionary API provides a RESTful access to cuss phrases in any language.

API

Content Negotiation

Cusstionary API will respond to the following 'Accept:' values with appropriate content

  • text/plain - Content will be returned as a plain string.
  • application/json - Content will be returned as a JSON object
  • application/xml - Content will be returned as a XML document

Operations

Every call to Cusstionary API requires a valid token. To get a token one needs to authenticate using get-token method. All further API calls should have the returned token supplied as POST value.
API always returns status (0 for failure, 1 for success) and descr - result description fields in addition to method specific values.

get-token

Method takes the supplied login and password and returns a new token if the authentication is successfull. If there existing token was still valid it is returned. Calls to this method do not decrease available API call count.
Arguments:

  • login
  • password
Returns:
  • token
Sample curl request:
curl -H "Content-Type: application/x-www-form-urlencoded" -H "Accept: application/json" -d "login=sample-user&password=sample-password" http://cusstionary.com/api/get-token

{"descr":"Authorisation successful, access token generated","status":1,"token":"7606f7015de7dc77350a831075c6aa29201433d44ebb55092b3d0fc5c744bdc99585c9b18d2e2fa34b37285e66ca0ebf23983451011bac098ca33c2e808c8e3e"}

check-token

Method returns information about the supplied token. Calls to this method do not decrease available API call count.
Arguments:

  • token
Returns:
  • calls-left - number of calls left in the current period
  • token-valid - token validity (0 - invalid or 1 - valid)
  • valid-until - token expiration time
Sample curl request:
curl -H "Content-Type: application/x-www-form-urlencoded" -H "Accept: application/json" -d "token=7606f7015de7dc77350a831075c6aa29201433d44ebb55092b3d0fc5c744bdc99585c9b18d2e2fa34b37285e66ca0ebf23983451011bac098ca33c2e808c8e3e" http://cusstionary.com/api/check-token

{"descr":"","status":1,"token":"7606f7015de7dc77350a831075c6aa29201433d44ebb55092b3d0fc5c744bdc99585c9b18d2e2fa34b37285e66ca0ebf23983451011bac098ca33c2e808c8e3e","token-valid":1,"calls-left":3,"valid-until":"2018-06-10 12:11:33"}

destroy-token

The supplied token is invalidated. Calls to this method do not decrease available API call count.
Arguments:

  • token
Returns:
  • (no method specific result)
Sample curl request:
curl -H "Content-Type: application/x-www-form-urlencoded" -H "Accept: application/json" -d "token=7606f7015de7dc77350a831075c6aa29201433d44ebb55092b3d0fc5c744bdc99585c9b18d2e2fa34b37285e66ca0ebf23983451011bac098ca33c2e808c8e3e" http://cusstionary.com/api/destroy-token

{"descr":"Token destroyed","status":1,"token":"7606f7015de7dc77350a831075c6aa29201433d44ebb55092b3d0fc5c744bdc99585c9b18d2e2fa34b37285e66ca0ebf23983451011bac098ca33c2e808c8e3e"}

check/:cussword

The supplied :cussword is looked up in Cusstionary database.
Arguments:

  • token
Returns:
  • cuss-word-status - yes/no
  • cuss-word-phrases - array of top cuss phrases containing the given :cussword in all languages
  • cuss-word-meaning - array of meanings of the :cussword with their probability
Sample curl request (check phrase "culo"):
curl -H "Content-Type: application/x-www-form-urlencoded" -H "Accept: application/json" -d "token=ea9ec6581286fad4520a962d080763e993d703271e64343850f2994894aeebe0a6de88d8e5e22da9a2e9aa65090a3e6bd96db977ba9de309a67dbaa9e0150b66" http://cusstionary.com/api/check/culo

{"descr":"Check success","status":1,"cuss-word-status":"yes","cuss-word-phrases":{"Argentine":["broken anal sphincter"],"Calabrese":["go fuck yourself"],"Costa rican":["Go and wash your ass"],"Dominican":["Smelly ass","Ass Sucker"],"Italian":["Kiss my ass","Assface","Up your mother's ass","lick my ass","forget it (\"I run into your ass\")","Go fuck yourself"],"Maracuchan":["suck my ass"],"Mexican":["ass","May you get it in the ass"],"Neapolitan":["take it up the ass"],"Nicaragua":["loose ass","butterface bitch","dirty ass"],"Puerto rican":["Butt face"],"Spanish":["Kiss my ass","kiss my ass","ass face","Eat my fucking ass","Ass","big ass panda","Go wash your ass","I love your ass","Stick it up your ass","Fuckin idiot ass bastared fuck you ","put it in your ass","i suck your ass (MEX)"],"Spanish (puerto rico)":["give me ass"],"Spanish (spain)":["Fuck off","kiss my ass","From bad to worse","ass kisser"],"Spanish (uruguay)":["Broken ass (bad person)","Ass sucker"],"Spanish(spain)":["Get your ass fucked"],"Venezuelan":["one who was born from an ass"],"Venician italian":["Retarded born from the ass"]},"cuss-word-meaning":{"ass":0.23,"your":0.06,"my":0.05,"it":0.04,"fuck":0.03,"go":0.03,"kiss":0.03,"the":0.02,"up":0.02,"from":0.02,"get":0.01,"face":0.01,"broken":0.01,"suck":0.01,"you":0.01,"sucker":0.01,"i":0.01,"yourself":0.01,"born":0.01,"in":0.01,"wash":0.01,"off":0.01,"me":0.01,"bastared":0.01,"idiot":0.01,"fuckin":0.01,"":0.01,"put":0.01,"(mex)":0.01,"give":0.01,"kisser":0.01,"who":0.01,"one":0.01,"was":0.01,"an":0.01,"retarded":0.01,"fucked":0.01,"person)":0.01,"to":0.01,"worse":0.01,"stick":0.01,"(bad":0.01,"bad":0.01,"bitch":0.01,"lick":0.01,"forget":0.01,"(\"i":0.01,"run":0.01,"mother's":0.01,"assface":0.01,"anal":0.01,"sphincter":0.01,"and":0.01,"smelly":0.01,"into":0.01,"ass\")":0.01,"eat":0.01,"fucking":0.01,"big":0.01,"panda":0.01,"butt":0.01,"dirty":0.01,"may":0.01,"take":0.01,"loose":0.01,"butterface":0.01,"love":0.01},"cuss-word":"culo"}

check/:languages/:cussword

The supplied :cussword is looked up in Cusstionary database in given :languages only
Arguments:

  • token
  • :languages - comma separated list of languages to be checked, eg. Spanish,German
Returns:
  • cuss-word-status - yes/no (in given :languages only)
  • checked-languages - list of languages matched against :languages
  • cuss-word-phrases - array of cuss phrases containing the given :cussword in :languages and their translations
Sample curl request (check phrase "culo"):
curl -H "Content-Type: application/x-www-form-urlencoded" -H "Accept: application/json" -d "token=ea9ec6581286fad4520a962d080763e993d703271e64343850f2994894aeebe0a6de88d8e5e22da9a2e9aa65090a3e6bd96db977ba9de309a67dbaa9e0150b66" http://cusstionary.com/api/check/Spanish,German/culo

{"descr":"Check success","status":1,"checked-languages":["Argentina spanish","Colombian spanish","Spanish","Spanish (central america)","Spanish (chile)","Spanish (cuban)","Spanish (ecuador)","Spanish (guatemala)","Spanish (honduras)","Spanish (mexico)","Spanish (peru)","Spanish (puerto rico)","Spanish (spain)","Spanish (uruguay)","Spanish (venezuela)","Spanish - all","Spanish el salvador","German","German swiss - bern dialect","Pennsylvanian german","Swiss german"],"cuss-word-status":"yes","cuss-word-phrases":{"Spanish":[{"cuss-phrase":"Besame el culo","translation":"Kiss my ass"},{"cuss-phrase":"beso mi culo","translation":"kiss my ass"},{"cuss-phrase":"cara de culo","translation":"ass face"},{"cuss-phrase":"Comeme el puto culo","translation":"Eat my fucking ass"},{"cuss-phrase":"Culo","translation":"Ass"},{"cuss-phrase":"grande culo de panda","translation":"big ass panda"},{"cuss-phrase":"Lavate ese culo","translation":"Go wash your ass"},{"cuss-phrase":"Me encanta tu culo","translation":"I love your ass"},{"cuss-phrase":"M\u00e9tetelo por el culo","translation":"Stick it up your ass"},{"cuss-phrase":"Pinche iriota culo bastardo chinga tu","translation":"Fuckin idiot ass bastared fuck you "},{"cuss-phrase":"pon lo en tu culo ","translation":"put it in your ass"},{"cuss-phrase":"te mamo el culo","translation":"i suck your ass (MEX)"}],"Spanish (puerto rico)":[{"cuss-phrase":"dame culo","translation":"give me ass"}],"Spanish (spain)":[{"cuss-phrase":"besa me culo","translation":"kiss my ass"},{"cuss-phrase":"De culo contra el viento","translation":"From bad to worse"},{"cuss-phrase":"lambe culo","translation":"ass kisser"},{"cuss-phrase":"Vete a tomar por culo","translation":"Fuck off"}],"Spanish (uruguay)":[{"cuss-phrase":"Culo roto","translation":"Broken ass (bad person)"},{"cuss-phrase":"Lame culo","translation":"Ass sucker"}]},"cuss-word":"culo"}

API authentication

To get API login/password please contact: ....