softopia/trustpilot-unofficial-api

非官方Trustpilot Api,用于获取评论和信任评分。

0.1.0 2022-05-17 15:48 UTC

This package is auto-updated.

Last update: 2024-09-05 15:42:00 UTC


README

随机检查了一下,它仍然有效。

PHP的非官方Trustpilot Api

非官方Trustpilot Api,用于获取评论和信任评分。

安装

您可以通过composer安装此包

composer require softopia/trustpilot-unofficial-api

使用

//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

响应格式

[
  {
    "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"
    }
  }
]

测试

//TODO

致谢

许可证

MIT许可证(MIT)。更多信息请参阅许可证文件

PHP包模板

此包是使用PHP包模板生成的。