PHP Example

In this example, we use a PHP function rawurlencode to encode the [text_string] according to RFC 3986. For more info, see examples.

How to Access API

  1. Call the API url: https://api.kenzyai.com/?key=[api_key]&text=[text_string]
  2. $key = "a366ab4cew1a819737ddb3f3c012efc6a35e90e4";   
    $text = "It is very helpful. Thank you for that.";
    $url = "https://api.kenzyai.com/?key=" . $key . "&text=" . rawurlencode($text);
    
  3. This will give you the following JSON response:
  4. { "sentiment":"positive", "positivity":"100", "negativity":"0" }
    
  5. The API can support thousands of characters within a single API call. Our free API imposes a rate limit of 1,000 calls per day.

Results Explanation

  1. Sentiment:  Overall sentiment of the analyzed text
  2. Positivity:    Percentage of positive sentiment
  3. Negativity:  Percentage of negative sentiment