# Product rating get

Fetch the aggregate Trustpilot product rating, review count, and GTIN for a business unit's SKU.

- Platform: [Trustpilot](https://docs.upscrape.com/docs/platforms/trustpilot)
- Capability ID: `trustpilot.product.rating.get`
- Cost: 1 credit per request
- Maximum runtime: 30 seconds
- Execute endpoint: `POST https://data.upscrape.com/execute`

## Request

Use the exact public capability ID in the shared execute envelope.

```bash
curl --request POST \
  --url https://data.upscrape.com/execute \
  --header "Authorization: Bearer $UPSCRAPE_API_KEY" \
  --header "Content-Type: application/json" \
  --header "Prefer: wait=30" \
  --data '{
  "input": {
    "business_unit_id": "605071d79427c2000147bff9",
    "language": "fr",
    "product_name": "Irrésistible Givenchy",
    "sku": "41013C42",
    "url": "https://www.my-origines.com/fr/irresistible-givenchy-41013C42.html"
  },
  "capability": "trustpilot.product.rating.get"
}'
```

## Input


| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `business_unit_id` | `string` | Yes | Business unit identifier. |
| `language` | `string` | No | Language for returned content. Default: `en`. |
| `product_name` | `string` | No |  |
| `sku` | `string` | Yes |  |
| `template_id` | `string` | No | Template identifier. Default: `5717796816f630043868e2e8`. |
| `url` | `string` | No | Public URL of the page to fetch. |

### Example input

```json
{
  "business_unit_id": "605071d79427c2000147bff9",
  "language": "fr",
  "product_name": "Irrésistible Givenchy",
  "sku": "41013C42",
  "url": "https://www.my-origines.com/fr/irresistible-givenchy-41013C42.html"
}
```

## Response

Successful output is returned in `results[0].data`.

Raw platform output is intentionally open-ended and may evolve with the upstream source.

### Illustrative sample output

This example shows one response. Values and optional fields vary with the data available.

```json
{
  "gtin": "3274872512634",
  "has_rating": true,
  "name": "Irrésistible Givenchy",
  "rating_count": 2,
  "rating_stars": 4.5,
  "raw": {
    "@context": "http://schema.org",
    "@type": "Product",
    "aggregateRating": {
      "@type": "AggregateRating",
      "ratingValue": "4.5",
      "reviewCount": "2"
    },
    "brand": "Givenchy",
    "gtin13": "3274872512634",
    "image": "https://www.my-origines.com/dw/image/v2/BJRD_PRD/on/demandware.static/-/Sites-size-master/default/dw21f18e17/images/41013C42_P.jpg?sw=1500&sh=1500&sm=fit",
    "mpn": "Givenchy",
    "name": "Irrésistible Givenchy",
    "offers": {
      "@type": "Offer",
      "price": "108.80",
      "priceCurrency": "EUR",
      "url": "https://www.my-origines.com/fr/irresistible-givenchy-41013C42.html"
    },
    "sku": "41013C42",
    "url": "https://www.my-origines.com/fr/irresistible-givenchy-41013C42.html"
  },
  "sku": "41013C42"
}
```
### Illustrative output fields

Derived from the sample above for orientation only. These fields are not a fixed response schema.

| Path | Observed type | Example |
| --- | --- | --- |
| `gtin` | `string` | 3274872512634 |
| `has_rating` | `boolean` | true |
| `name` | `string` | Irrésistible Givenchy |
| `rating_count` | `integer` | 2 |
| `rating_stars` | `number` | 4.5 |
| `raw` | `object` | 11 fields |
| `raw.@context` | `string` | http://schema.org |
| `raw.@type` | `string` | Product |
| `raw.aggregateRating` | `object` | 3 fields |
| `raw.brand` | `string` | Givenchy |
| `raw.gtin13` | `string` | 3274872512634 |
| `raw.image` | `string` | https://www.my-origines.com/dw/image/v2/BJRD_PRD/on/demandware.static/-… |
| `raw.mpn` | `string` | Givenchy |
| `raw.name` | `string` | Irrésistible Givenchy |
| `raw.offers` | `object` | 4 fields |
| `raw.sku` | `string` | 41013C42 |
| `raw.url` | `string` | https://www.my-origines.com/fr/irresistible-givenchy-41013C42.html |
| `sku` | `string` | 41013C42 |

## Execution behavior

A `200` response completed inline. A `202` response was queued; poll `GET /jobs/{id}` until the job reaches `completed` or `failed`. Use an `Idempotency-Key` when retrying must not create a duplicate logical job.

## Related documentation

- [Authentication](https://docs.upscrape.com/docs/api/authentication)
- [Jobs and results](https://docs.upscrape.com/docs/api/jobs)
- [Errors and retries](https://docs.upscrape.com/docs/api/errors)
- [Idempotency](https://docs.upscrape.com/docs/api/idempotency)
