{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/postproxy-dev/json-schema/postproxy-dev-post-stats-response-schema.json",
  "title": "PostStatsResponse",
  "description": "Stats snapshots keyed by post id. For thread posts, stats from all posts in the thread (parent + children) are included under the parent post's ID.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/postproxy-dev-posts-api-openapi.yml#/components/schemas/PostStatsResponse",
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "description": "Keyed by post id",
      "additionalProperties": {
        "type": "object",
        "properties": {
          "platforms": {
            "type": "array",
            "description": "Array of platform objects for this post",
            "items": {
              "type": "object",
              "properties": {
                "profile_id": {
                  "type": "string",
                  "description": "Profile id"
                },
                "platform": {
                  "type": "string",
                  "description": "Platform name (instagram, twitter, etc.)"
                },
                "records": {
                  "type": "array",
                  "description": "Snapshots ordered by recorded_at ascending",
                  "items": {
                    "type": "object",
                    "properties": {
                      "stats": {
                        "type": "object",
                        "description": "Normalized metrics — the same key means the same thing across platforms (available keys vary by platform)",
                        "additionalProperties": true
                      },
                      "raw_stats": {
                        "type": [
                          "object",
                          "null"
                        ],
                        "description": "The same metrics as a flat key-value object under their original platform names (e.g. like_count for Twitter, impressionCount for LinkedIn). Null for snapshots recorded before July 20, 2026",
                        "additionalProperties": true
                      },
                      "recorded_at": {
                        "type": "string",
                        "format": "date-time",
                        "description": "ISO 8601 timestamp when the snapshot was captured"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}