PHP code example of softopia / trustpilot-unofficial-api

1. Go to this page and download the library: Download softopia/trustpilot-unofficial-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/ */

    

softopia / trustpilot-unofficial-api example snippets

 php
//use namespace
use Softopia\TrustApi\TrustApi;

//create an instance
$trust = new TrustApi('example.com');

//get average rating
$trust->getRating();

//get reviews count
$trust->getReviewsCount();

//get All reviews (max 600 reviews or you can say 30 pages)
$trust->getAllReviews($wantJson = true); //false if you want array back