{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/postzen-dev/json-schema/postzen-dev-daily-metrics-response-schema.json",
  "title": "DailyMetricsResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/postzen-dev-analytics-api-openapi.yml#/components/schemas/DailyMetricsResponse",
  "type": "object",
  "required": [
    "dailyData",
    "platformBreakdown"
  ],
  "properties": {
    "dailyData": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "date",
          "postCount",
          "platforms",
          "metrics"
        ],
        "properties": {
          "date": {
            "type": "string",
            "format": "date"
          },
          "postCount": {
            "type": "number"
          },
          "platforms": {
            "type": "object",
            "additionalProperties": {
              "type": "number"
            }
          },
          "metrics": {
            "$ref": "#/$defs/AnalyticsMetricTotals"
          }
        }
      }
    },
    "platformBreakdown": {
      "type": "array",
      "items": {
        "allOf": [
          {
            "$ref": "#/$defs/AnalyticsMetricTotals"
          },
          {
            "type": "object",
            "required": [
              "platform",
              "postCount"
            ],
            "properties": {
              "platform": {
                "$ref": "#/$defs/AnalyticsPlatform"
              },
              "postCount": {
                "type": "number"
              }
            }
          }
        ]
      }
    }
  },
  "$defs": {
    "AnalyticsMetricTotals": {
      "type": "object",
      "description": "The eight normalized metrics returned for every platform. A platform that reports a single view count returns it in both `views` and `impressions`. A metric the platform does not report is returned as `0`, so check the per-platform coverage in the API reference before reading a zero as no activity. `reach` is currently reported for Instagram only.",
      "required": [
        "impressions",
        "reach",
        "likes",
        "comments",
        "shares",
        "saves",
        "clicks",
        "views"
      ],
      "properties": {
        "impressions": {
          "type": "number"
        },
        "reach": {
          "type": "number"
        },
        "likes": {
          "type": "number"
        },
        "comments": {
          "type": "number"
        },
        "shares": {
          "type": "number"
        },
        "saves": {
          "type": "number"
        },
        "clicks": {
          "type": "number"
        },
        "views": {
          "type": "number"
        }
      }
    },
    "AnalyticsPlatform": {
      "type": "string",
      "enum": [
        "x",
        "instagram",
        "tiktok",
        "linkedin",
        "facebook",
        "youtube",
        "threads",
        "pinterest",
        "bluesky",
        "telegram"
      ]
    }
  }
}