PHP code example of truthscan / image-detector-client

1. Go to this page and download the library: Download truthscan/image-detector-client 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/ */

    

truthscan / image-detector-client example snippets




ruthscan\ImageDetection\ImageDetectionClient;

$apiKey = getenv('TRUTHSCAN_API_KEY') ?: 'your_api_key_here';
$client = new ImageDetectionClient($apiKey);

$result = $client->detect('/path/to/image.jpg');

echo "Status: {$result->status}\n";
echo "Score: " . ($result->result ?? 'N/A') . "\n";
echo "Final: " . ($result->result_details->final_result ?? '') . "\n";