{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/agentseo-dev/json-schema/agentseo-dev-opportunities-find-response-schema.json",
  "title": "OpportunitiesFindResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/agentseo-dev-opportunities-api-openapi.yml#/components/schemas/OpportunitiesFindResponse",
  "type": "object",
  "properties": {
    "target": {
      "type": "string"
    },
    "opportunities": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/SeoOpportunity"
      }
    },
    "competitors": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": true
      }
    },
    "agent_workflow": {
      "$ref": "#/$defs/AgentWorkflow"
    },
    "markdown_summary": {
      "type": "string"
    }
  },
  "$defs": {
    "AgentWorkflow": {
      "type": "object",
      "properties": {
        "summary": {
          "type": "string"
        },
        "decision": {
          "type": "string",
          "enum": [
            "ready",
            "act_now",
            "monitor",
            "blocker"
          ]
        },
        "confidence": {
          "type": "number",
          "minimum": 0,
          "maximum": 1
        },
        "recommended_actions": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/AgentWorkflowAction"
          }
        },
        "evidence": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/AgentWorkflowEvidence"
          }
        },
        "limitations": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "next_calls": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/AgentWorkflowNextCall"
          }
        }
      }
    },
    "AgentWorkflowAction": {
      "type": "object",
      "properties": {
        "priority": {
          "type": "string",
          "enum": [
            "critical",
            "high",
            "medium",
            "low"
          ]
        },
        "action": {
          "type": "string"
        },
        "why": {
          "type": "string"
        }
      }
    },
    "AgentWorkflowEvidence": {
      "type": "object",
      "properties": {
        "finding": {
          "type": "string"
        },
        "detail": {
          "type": "string"
        },
        "severity": {
          "type": "string",
          "enum": [
            "critical",
            "high",
            "medium",
            "low"
          ]
        }
      }
    },
    "AgentWorkflowNextCall": {
      "type": "object",
      "properties": {
        "endpoint": {
          "type": "string"
        },
        "reason": {
          "type": "string"
        }
      }
    },
    "SeoOpportunity": {
      "type": "object",
      "properties": {
        "keyword": {
          "type": "string"
        },
        "type": {
          "type": "string",
          "enum": [
            "quick_win",
            "content_refresh",
            "ai_overview_opportunity",
            "featured_snippet_opportunity",
            "commercial_intent_opportunity",
            "lost_keyword_recovery",
            "competitor_gap"
          ]
        },
        "priority": {
          "type": "string",
          "enum": [
            "high",
            "medium",
            "low"
          ]
        },
        "score": {
          "type": "integer"
        },
        "current_rank": {
          "type": [
            "integer",
            "null"
          ]
        },
        "target_url": {
          "type": [
            "string",
            "null"
          ]
        },
        "reason": {
          "type": "string"
        },
        "evidence": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/AgentWorkflowEvidence"
          }
        },
        "recommended_actions": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "next_calls": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/AgentWorkflowNextCall"
          }
        }
      }
    }
  }
}