---
title: "Get the aggregated rating for a single item"
url: "https://developer.migros.ch/apis/ratings-8/versions/47f7210f-ae8e-42fc-b41c-393bebe224ae/operations/get-rating"
---

> Full API specification: https://developer.migros.ch/apis/ratings-8/versions/47f7210f-ae8e-42fc-b41c-393bebe224ae.md

# Get the aggregated rating for a single item

`GET` `/migros/products/v8/ratings/{type}/{item_id}`

Operation ID: `get-rating`

Returns the aggregated rating for a single item. An item is composed composed of a type and an ID.

## Path parameters

- `type` (string, required) - Type of the item, e.g. PRODUCT or MIGROS_SERVICE_PRODUCT
- `item_id` (string, required) - ID of the item

## Query parameters

- `lang` (string, optional) - Defines the language (de/fr/it/en) for this request as query parameter. Either use the query param "lang" or header "Accept-Language", not both.

## Header parameters

- `Accept-Language` (string, optional) - Defines the language (de/fr/it/en) for this request as request header. Either use the query param "lang" or header "Accept-Language", not both.

## Responses

- `200` - Returned when successful

## OpenAPI definition

```yaml
openapi: 3.0.0
info:
  title: Ratings
  version: "8"
servers:
  - description: Public Kong Gateway URL
    url: https://api.migros.ch
paths:
  /migros/products/v8/ratings/{type}/{item_id}:
    get:
      description: |-
        Returns the aggregated rating for a single item.

        An item is composed composed of a type and an ID.
      operationId: get-rating
      parameters:
        - description: Type of the item, e.g. PRODUCT or MIGROS_SERVICE_PRODUCT
          in: path
          name: type
          required: true
          schema:
            type: string
        - description: ID of the item
          in: path
          name: item_id
          required: true
          schema:
            pattern: ^(?!items)[^/\.]+$
            type: string
        - $ref: "#/components/parameters/lang"
        - $ref: "#/components/parameters/Accept-Language"
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/RatingSummary"
          description: Returned when successful
      summary: Get the aggregated rating for a single item
      tags:
        - Ratings
security:
  - Kong-Api-Key: []
    basicAuth: []
components:
  parameters:
    lang:
      description: Defines the language (de/fr/it/en) for this request as query
        parameter. Either use the query param "lang" or header
        "Accept-Language", not both.
      in: query
      name: lang
      schema:
        default: de
        enum:
          - de
          - fr
          - it
          - en
        type: string
    Accept-Language:
      description: Defines the language (de/fr/it/en) for this request as request
        header. Either use the query param "lang" or header "Accept-Language",
        not both.
      in: header
      name: Accept-Language
      schema:
        default: de
        enum:
          - de
          - fr
          - it
          - en
        type: string
  schemas:
    RatingSummary:
      description: >-
        Aggregation with count and average of ratings for a given object.


        This model is used to save ratings in the database and to display
        ratings of items (product, etc.) in the API.
      properties:
        average:
          format: float
          type: number
        count:
          type: integer
        item_id:
          type: string
        modified:
          description: Last modified date.
          format: date-time
          type: string
        type:
          description: Average rating on the given item.
          type: string
      required:
        - itemId
        - type
      type: object
  securitySchemes:
    Kong-Api-Key:
      description: Kong key-auth authentication
      in: header
      name: X-Api-Key
      type: apiKey
    basicAuth:
      scheme: basic
      type: http
```
