{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/mencoro-com/json-schema/mencoro-com-tracked-query-resource-schema.json",
  "title": "TrackedQueryResource",
  "description": "A tracked query and the metrics of its most recent check",
  "x-generated": "2026-11-18",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/mencoro-com-openapi.json#/components/schemas/TrackedQueryResource",
  "required": [
    "id",
    "queryText",
    "engine",
    "country",
    "status",
    "queryClusterIds",
    "checkFrequency",
    "nPasses"
  ],
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "queryText": {
      "description": "The keyword or prompt being tracked",
      "type": "string"
    },
    "engine": {
      "type": "string",
      "enum": [
        "chatgpt",
        "claude",
        "perplexity",
        "google_ai_overview",
        "google_ai_mode",
        "google_serp",
        "google_shopping"
      ]
    },
    "country": {
      "description": "ISO-3166 alpha-2 country code the query is tracked in",
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "active",
        "paused"
      ]
    },
    "queryClusterIds": {
      "description": "Ids of the keyword clusters this query belongs to",
      "type": "array",
      "items": {
        "type": "string",
        "format": "uuid"
      }
    },
    "checkFrequency": {
      "description": "How often the query is checked",
      "type": "string",
      "enum": [
        "daily",
        "weekly",
        "monthly"
      ]
    },
    "nPasses": {
      "description": "How many times the query is asked per check",
      "type": "integer"
    },
    "lastSerpPosition": {
      "description": "Position in traditional search results at the last check. 1-based, LOWER is better. Null when not known yet.",
      "type": [
        "integer",
        "null"
      ]
    },
    "lastMentionPosition": {
      "description": "Position of the brand mention inside the AI answer at the last check. 1-based, LOWER is better. Null when not known yet.",
      "type": [
        "integer",
        "null"
      ]
    },
    "lastLinkPosition": {
      "description": "Position of a cited link to the brand at the last check. 1-based, LOWER is better. Null when not known yet.",
      "type": [
        "integer",
        "null"
      ]
    },
    "lastShoppingPosition": {
      "description": "Position in shopping results at the last check. 1-based, LOWER is better. Null when not known yet.",
      "type": [
        "integer",
        "null"
      ]
    },
    "lastShareOfVoice": {
      "description": "0-100 share of the weighted AI mentions against every tracked brand; HIGHER is better. Null when not known yet, which is not a share of zero.",
      "type": [
        "number",
        "null"
      ],
      "format": "float"
    },
    "lastPositivityIndex": {
      "description": "0-100 sentiment score of the brand mentions; HIGHER is better. Null when there were no mentions to score, which is not a score of zero.",
      "type": [
        "integer",
        "null"
      ]
    },
    "lastPositiveMentionCount": {
      "description": "Positive brand mentions at the last check. Null when not known yet.",
      "type": [
        "integer",
        "null"
      ]
    },
    "lastNeutralMentionCount": {
      "description": "Neutral brand mentions at the last check. Null when not known yet.",
      "type": [
        "integer",
        "null"
      ]
    },
    "lastNegativeMentionCount": {
      "description": "Negative brand mentions at the last check. Null when not known yet.",
      "type": [
        "integer",
        "null"
      ]
    },
    "lastCheckedAt": {
      "description": "When the query was last checked. Null when it never has been.",
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    }
  },
  "type": "object"
}