---
title: "Daily ratings"
description: "Track customer satisfaction over time with get_daily_ratings, a GraphQL function that returns the ratings aggregated per day."
---

# Daily ratings

> Track customer satisfaction over time with get_daily_ratings, a GraphQL function that returns the ratings aggregated per day.

## Overview

The `get_daily_ratings` function provides daily aggregated ratings data. This endpoint helps track customer satisfaction trends over time. Use this endpoint to:

- Track daily customer satisfaction trends
- Identify rating patterns over time
- Generate satisfaction trend reports

## Quick start

```graphql
query GetDailyRatings(
  $deskIds: _uuid
  $brainIds: _uuid
  $channels: _text
  $startDate: timestamp
  $endDate: timestamp
  $isTest: Boolean
) {
  rows: get_daily_ratings(
    args: {
      desk_ids: $deskIds
      brain_ids: $brainIds
      channels: $channels
      start_time: $startDate
      end_time: $endDate
      is_test: $isTest
    }
  ) {
    date
    ratings_count
    avg_rating
    median_rating
    ratings_count_more_than_3
  }
}
```

**Variables:**

```json
{
  "deskIds": "{d2be0283-9b53-4d7b-b77d-2650f3a1a99c}",
  "startDate": "2024-01-08",
  "endDate": "2024-01-17"
}
```

## Parameters

| Parameter        | Type        | Description                       |
| ---------------- | ----------- | --------------------------------- |
| `deskIds`        | `_uuid`     | Filter by desk IDs                |
| `brainIds`       | `_uuid`     | Filter by AI agent version IDs    |
| `channels`       | `_text`     | Filter by channels                |
| `startDate`      | `timestamp` | Start date (format: `yyyy-mm-dd`) |
| `endDate`        | `timestamp` | End date (format: `yyyy-mm-dd`)   |
| `isTest`         | `Boolean`   | Exclude test sessions             |

## Response fields

| Field                       | Type        | Description                      |
| --------------------------- | ----------- | -------------------------------- |
| `date`                      | `timestamp` | Date of the aggregation          |
| `ratings_count`             | `Int`       | Total ratings received           |
| `avg_rating`                | `Float`     | Average rating for the day       |
| `median_rating`             | `Int`       | Median rating for the day        |
| `ratings_count_more_than_3` | `Int`       | Number of ratings greater than 3 |

## Common use cases

## Try it

<GraphiQLPlayground
  query={`query GetDailyRatings(
  \$deskIds: _uuid
  \$brainIds: _uuid
  \$channels: _text
  \$startDate: timestamp
  \$endDate: timestamp
  \$isTest: Boolean
) {
  rows: get_daily_ratings(
    args: {
      desk_ids: \$deskIds
      brain_ids: \$brainIds
      channels: \$channels
      start_time: \$startDate
      end_time: \$endDate
      is_test: \$isTest
    }
  ) {
    date
    ratings_count
    avg_rating
    median_rating
    ratings_count_more_than_3
  }
}`}
  variables={`{
  "deskIds": "{d2be0283-9b53-4d7b-b77d-2650f3a1a99c}",
  "startDate": "2024-01-08",
  "endDate": "2024-01-17"
}`}
  endpoint="https://logs.moveo.ai/v1/graphql"
/>

**Daily trend**

Get daily ratings trend:

```json
{
  "deskIds": "{d2be0283-9b53-4d7b-b77d-2650f3a1a99c}",
  "startDate": "2024-01-08",
  "endDate": "2024-01-17"
}
```

**AI agent ratings**

Get daily ratings for specific AI agents:

```json
{
  "brainIds": "{a2wv9283-9b53-4d7b-b77d-2650f3a1a99c}",
  "startDate": "2024-01-08",
  "endDate": "2024-01-17"
}
```

**Production only**

Exclude test sessions:

```json
{
  "deskIds": "{d2be0283-9b53-4d7b-b77d-2650f3a1a99c}",
  "isTest": false,
  "startDate": "2024-01-08",
  "endDate": "2024-01-17"
}
```

## Example response

```json
{
  "data": {
    "rows": [
      {
        "date": "2024-01-08T00:00:00",
        "ratings_count": 45,
        "avg_rating": 4.2,
        "median_rating": 4,
        "ratings_count_more_than_3": 35
      },
      {
        "date": "2024-01-09T00:00:00",
        "ratings_count": 52,
        "avg_rating": 4.4,
        "median_rating": 5,
        "ratings_count_more_than_3": 45
      }
    ]
  }
}
```
