softopia / trustpilot-unofficial-api
Unofficial Trustpilot Api to fetch reviews and trust score.
0.1.0
2022-05-17 15:48 UTC
Requires
- php: >=7.1
- fabpot/goutte: ^4.0
Requires (Dev)
- phpunit/phpunit: ^9.5.20
README
Unofficial Trustpilot Api to fetch reviews and trust score.
Installation
You can install the package via composer:
composer require softopia/trustpilot-unofficial-api
Usage
//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
Response Format
[ { "reviewId": "xxxxxxxxxxx", "reviewUrl": "https://www.trustpilot.com/reviews/xxxxxxxxxxxx", "rating": 5, "reviewTitle": "Nice work", "reviewBody": "Nice work!!!!", "customer": { "id": "xxcxcxcxc", "name": "Nice name", "image": "https://user-images.trustpilot.com/xxxxxxxxx/73x73.png" } } ]
Testing
//TODO
Credits
License
The MIT License (MIT). Please see License File for more information.
PHP Package Boilerplate
This package was generated using the PHP Package Boilerplate.