{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/rewio-ru/json-schema/rewio-ru-timeseries-response-v3-schema.json",
  "title": "TimeseriesResponseV3",
  "description": "Динамика отзывов по интервалам.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/rewio-ru-analytics-api-openapi.yml#/components/schemas/TimeseriesResponseV3",
  "properties": {
    "meta": {
      "$ref": "#/$defs/TimeseriesMetaV3"
    },
    "series": {
      "items": {
        "$ref": "#/$defs/TimeseriesSeriesV3"
      },
      "type": "array",
      "title": "Series"
    },
    "access": {
      "anyOf": [
        {
          "$ref": "#/$defs/AccessInfoV3"
        },
        {
          "type": "null"
        }
      ],
      "description": "Ограничение выдачи, если показали не всё."
    }
  },
  "type": "object",
  "required": [
    "meta",
    "series"
  ],
  "$defs": {
    "AccessInfoV3": {
      "properties": {
        "reason": {
          "type": "string",
          "title": "Reason",
          "description": "Почему выдача ограничена. `trial` – пробный доступ, `manual` – ограничение, согласованное по вашему договору."
        },
        "limit_per_link": {
          "type": "integer",
          "title": "Limit Per Link",
          "description": "Сколько последних отзывов показывается по каждой ссылке (площадке объекта)."
        },
        "hidden_total": {
          "type": "integer",
          "title": "Hidden Total",
          "description": "Сколько отзывов уже собрано сверх показанных. Считается по всему архиву и не зависит от фильтров запроса."
        },
        "message": {
          "type": "string",
          "title": "Message",
          "description": "Готовая формулировка для показа человеку."
        }
      },
      "type": "object",
      "required": [
        "reason",
        "limit_per_link",
        "hidden_total",
        "message"
      ],
      "title": "AccessInfoV3",
      "description": "Выдача ограничена тарифом – показано не всё."
    },
    "TimeseriesMetaV3": {
      "properties": {
        "object_id": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Object Id",
          "description": "Объект, по которому считали. `null` в папочном режиме."
        },
        "folder_id": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Folder Id",
          "description": "Папка, по которой считали. `null` в объектном режиме."
        },
        "object_ids": {
          "items": {
            "type": "integer"
          },
          "type": "array",
          "title": "Object Ids",
          "description": "Объекты, вошедшие в расчёт. В объектном режиме – один."
        },
        "published_from": {
          "type": "string",
          "format": "date",
          "title": "Published From",
          "description": "Фактически применённое начало периода по дате публикации, включительно."
        },
        "published_to": {
          "type": "string",
          "format": "date",
          "title": "Published To",
          "description": "Фактически применённый конец периода, включительно."
        },
        "source_ids": {
          "items": {
            "type": "integer"
          },
          "type": "array",
          "title": "Source Ids",
          "description": "Фактически применённый фильтр по площадкам. Пусто – все площадки объекта."
        },
        "generated_at": {
          "type": "string",
          "format": "date-time",
          "title": "Generated At",
          "description": "Момент расчёта данных (UTC, ISO 8601)."
        },
        "granularity": {
          "type": "string",
          "title": "Granularity",
          "description": "Применённый размер интервала ряда: `day`, `week` или `month`."
        }
      },
      "type": "object",
      "required": [
        "object_ids",
        "published_from",
        "published_to",
        "source_ids",
        "generated_at",
        "granularity"
      ],
      "title": "TimeseriesMetaV3",
      "description": "Применённые адресат и фильтры (как в `AnalyticsMetaV3`) и размер интервала."
    },
    "TimeseriesPointV3": {
      "properties": {
        "period": {
          "type": "string",
          "title": "Period",
          "description": "Начало интервала: `YYYY-MM-DD` для дня и недели, `YYYY-MM` для месяца."
        },
        "review_count": {
          "type": "integer",
          "title": "Review Count",
          "description": "Число отзывов в этом интервале."
        },
        "average_rating": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Average Rating",
          "description": "Средняя оценка в интервале, шкала 1–5."
        },
        "reply_count": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Reply Count",
          "description": "Число ответов организации в интервале."
        },
        "reviews_with_text": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Reviews With Text",
          "description": "Сколько отзывов интервала с текстом."
        },
        "reviews_with_images": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Reviews With Images",
          "description": "Сколько отзывов интервала с изображениями."
        },
        "rating_distribution": {
          "anyOf": [
            {
              "additionalProperties": {
                "type": "integer"
              },
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "title": "Rating Distribution",
          "description": "Распределение отзывов интервала по оценкам."
        },
        "reply_distribution": {
          "anyOf": [
            {
              "additionalProperties": {
                "type": "integer"
              },
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "title": "Reply Distribution",
          "description": "Распределение ответов интервала по оценкам."
        }
      },
      "type": "object",
      "required": [
        "period",
        "review_count"
      ],
      "title": "TimeseriesPointV3",
      "description": "Одна точка ряда."
    },
    "TimeseriesSeriesV3": {
      "properties": {
        "source_id": {
          "type": "integer",
          "title": "Source Id",
          "description": "Идентификатор площадки ряда; `0` – агрегированный ряд по всем площадкам."
        },
        "source_name": {
          "type": "string",
          "title": "Source Name",
          "description": "Название площадки; для `source_id = 0` – «Все источники»."
        },
        "points": {
          "items": {
            "$ref": "#/$defs/TimeseriesPointV3"
          },
          "type": "array",
          "title": "Points",
          "description": "Точки ряда в хронологическом порядке."
        }
      },
      "type": "object",
      "required": [
        "source_id",
        "source_name",
        "points"
      ],
      "title": "TimeseriesSeriesV3",
      "description": "Ряд одной площадки."
    }
  }
}