PHP code example of artstorm / monkeylearn-api

1. Go to this page and download the library: Download artstorm/monkeylearn-api library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

artstorm / monkeylearn-api example snippets

 php
$token = 'monkeylearn-api-token';
$client = new Artstorm\MonkeyLearn\Client($token);

$textToClassify = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.';
$module = 'module_id';
$response = $client->classification->classify($textToClassify, $module);

print_r($response->result());
 php
$response = $client->sandbox()->classification->classify($text, $module);
$response = $client->debug()->classification->classify($text, $module);
$response = $client->sandbox()->debug()->classification->classify($text, $module);
 php
$response = $client->classification->classify($text, $module);

$limits = $response->limits();