{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/shortsmonkey-com/json-schema/shortsmonkey-com-dual-data-response-schema.json",
  "title": "DualDataResponse",
  "x-generated": "2026-11-24",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/shortsmonkey-com-openapi.json#/components/schemas/DualDataResponse",
  "type": "object",
  "required": [
    "data",
    "meta",
    "credits"
  ],
  "properties": {
    "daily_usage": {
      "$ref": "#/$defs/DailyUsage"
    },
    "data": {
      "$ref": "#/$defs/DualData"
    },
    "meta": {
      "type": "object",
      "required": [
        "request_id"
      ],
      "properties": {
        "request_id": {
          "type": "string"
        },
        "snapshot_id": {
          "type": "string"
        },
        "snapshot_at": {
          "type": "string",
          "format": "date-time"
        },
        "data_status": {
          "type": "string"
        },
        "methodology_version": {
          "type": "string"
        }
      }
    },
    "credits": {
      "type": "object",
      "required": [
        "cost",
        "remaining",
        "period_ends_at",
        "unlimited"
      ],
      "properties": {
        "cost": {
          "type": "integer"
        },
        "remaining": {
          "type": [
            "integer",
            "null"
          ]
        },
        "unlimited": {
          "type": "boolean",
          "description": "True when there is no commercial credit balance. REST daily usage limits are reported separately."
        },
        "period_ends_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        }
      }
    }
  },
  "$defs": {
    "DailyUsage": {
      "type": "object",
      "required": [
        "unlimited",
        "limit",
        "remaining",
        "used",
        "resets_at",
        "timezone"
      ],
      "properties": {
        "unlimited": {
          "type": "boolean"
        },
        "limit": {
          "type": [
            "integer",
            "null"
          ]
        },
        "remaining": {
          "type": [
            "integer",
            "null"
          ]
        },
        "used": {
          "type": "integer"
        },
        "resets_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "timezone": {
          "type": "string",
          "const": "Asia/Shanghai"
        }
      },
      "description": "REST business requests have an account-wide daily limit of 10. Trusted MCP calls have unlimited=true. Failed requests and idempotent retries do not consume an additional call."
    },
    "DataPage": {
      "type": "object",
      "required": [
        "items",
        "next_cursor"
      ],
      "properties": {
        "items": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/VideoItem"
          }
        },
        "next_cursor": {
          "type": [
            "string",
            "null"
          ],
          "description": "Use this value as the matching all_cursor or filter_cursor to fetch the next page."
        }
      }
    },
    "DualData": {
      "type": "object",
      "required": [
        "all_data",
        "filter_data"
      ],
      "properties": {
        "all_data": {
          "$ref": "#/$defs/DataPage",
          "description": "Unfiltered items from the stable dataset snapshot."
        },
        "filter_data": {
          "$ref": "#/$defs/DataPage",
          "description": "Items from the same snapshot after request filters and endpoint defaults are applied."
        }
      }
    },
    "VideoItem": {
      "type": "object",
      "required": [
        "video_id",
        "title",
        "video_url",
        "channel",
        "views",
        "duration_seconds",
        "published_at"
      ],
      "properties": {
        "video_id": {
          "type": "string"
        },
        "title": {
          "type": "string"
        },
        "video_url": {
          "type": "string",
          "format": "uri"
        },
        "channel": {
          "type": "object",
          "properties": {
            "id": {
              "type": [
                "string",
                "null"
              ]
            },
            "title": {
              "type": "string"
            },
            "subscribers": {
              "type": [
                "integer",
                "null"
              ]
            },
            "subscriber_count_hidden": {
              "type": "boolean"
            }
          }
        },
        "views": {
          "type": "integer"
        },
        "views_to_subscribers_ratio": {
          "type": [
            "number",
            "null"
          ]
        },
        "duration_seconds": {
          "type": "integer"
        },
        "published_at": {
          "type": "string",
          "format": "date-time"
        },
        "niche": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    }
  }
}