Back to LanguageTool Homepage - Privacy - Imprint

Not getting response from Server

I’m sending my textarea text to server request but getting strange error. However I’ve also purchased the LT premium version. Have API key, don’t know where to use it.

Here’s my file code:

<!DOCTYPE html>
<html lang="en">
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Checking LT API</title>
    <form action="" method="post">
      <p id="checktextpara" style=" border: 1px solid #262626; width: 50%;">
          <textarea id="checktext" name="text" style="width: 100%;"
            rows="6" >We are checkin the Languag Tool API</textarea>
          <select name="lang" id="lang">
              <option value="en-US">English</option>
              <option value="de-DE">German</option>
              <option value="it">Italian</option>
          <input type="submit" name="submit"
              value="Check Text">

if(isset($_POST['submit'])) {
  $var1 = $_POST['text'];
  $var2 = $_POST['lang'];

  $url = ''.$Var1.

  $opts = array('http' =>
      'method' => 'POST',
      'header' => 'Content-type: application/json'

  $context = stream_context_create($opts);

  $result = file_get_contents($url, false, $context);

    echo "<script>console.log('Results: " . $result . "' );</script>";
    echo "<script>console.log('JSON: " . $context . "' );</script>";


This is my console & result: