Account API  Regular API  Turing API

WordAi Turing API

The WordAi API is designed to be extremely simple and easy to understand. All you have to do is make an HTTP request with POST variables. Our example below is a PHP example that uses cURL (which can usually be copied/pasted into a PHP script and will work out of the box), but you can use whatever programming language you want. Sample code in other languages is coming soon!

Example Code:

function api($text,$quality,$email,$pass)
{
   if(isset($text) && isset($quality) && isset($email) && isset($pass))
   {
      $text = urlencode($text);
      $ch = curl_init('http://wordai.com/users/turing-api.php');
      curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
      curl_setopt ($ch, CURLOPT_POST, 1);
      curl_setopt ($ch, CURLOPT_POSTFIELDS, "s=$text&quality=$quality&email=$email&pass=$pass&output=json");
      $result = curl_exec($ch);
      curl_close ($ch);
      return $result;
   }
   else
   {
      return 'Error: Not All Variables Set!';
   }
}
//The variable quality can currently be 'Regular', 'Readable', or 'Very Readable'
echo api(stripslashes('Here is an example.'),'Regular','email','password');

Example JSON Output:

{
   "uniqueness":100,
   "text":"{Here is|Here's} {an example|a good example|an illustration}.\n",
   "status":"Success"
}

Example Failure Output:

{
   "error":"Error: You cannot process articles longer than 2,000 words with the Turing API",
   "status":"Failure"
}