{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/kunkafa-com/json-schema/kunkafa-com-integration-outlooks-request-schema.json",
  "title": "IntegrationOutlooksRequest",
  "description": "One market and at least one duration selector (durations, or minDuration and/or maxDuration). One call returns at most 6 durations and 72 forecasts after filters; a broader request returns request_too_broad.",
  "x-generated": "2026-11-14",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/kunkafa-com-openapi.json#/components/schemas/IntegrationOutlooksRequest",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "market"
  ],
  "properties": {
    "market": {
      "$ref": "#/$defs/IntegrationMarketSlug"
    },
    "durations": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 2,
        "maxLength": 24,
        "pattern": "^\\d{1,5}\\s*[A-Za-z]{1,8}$"
      },
      "minItems": 1,
      "maxItems": 6,
      "description": "Exact duration labels from the market list, for example [\"1 hour\", \"6 hours\"]. Use either durations or a range."
    },
    "minDuration": {
      "type": "string",
      "minLength": 2,
      "maxLength": 24,
      "pattern": "^\\d{1,5}\\s*[A-Za-z]{1,8}$",
      "description": "Shortest duration to include, for example \"1 hour\"."
    },
    "maxDuration": {
      "type": "string",
      "minLength": 2,
      "maxLength": 24,
      "pattern": "^\\d{1,5}\\s*[A-Za-z]{1,8}$",
      "description": "Longest duration to include, for example \"1 day\"."
    },
    "maxDurationExclusive": {
      "type": "boolean",
      "description": "true for \"less than maxDuration\"; by default maxDuration is included."
    },
    "direction": {
      "enum": [
        "up",
        "down",
        "both"
      ],
      "default": "both"
    },
    "minProbabilityPercent": {
      "type": "number",
      "minimum": 0,
      "maximum": 100,
      "description": "Only forecasts whose probability (Kunkafa's confidence) is at least this."
    },
    "maxProbabilityPercent": {
      "type": "number",
      "minimum": 0,
      "maximum": 100
    },
    "minTargetPercent": {
      "type": "number",
      "minimum": 0,
      "maximum": 10000,
      "description": "Only targets at least this far from the reference price, in percent, either direction."
    },
    "maxTargetPercent": {
      "type": "number",
      "minimum": 0,
      "maximum": 10000
    }
  },
  "$defs": {
    "IntegrationMarketSlug": {
      "type": "string",
      "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
      "description": "Published English-name market slug returned by authorized discovery."
    }
  }
}