Account 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('');
      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;
      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:

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

Example Failure Output:

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