{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/xeorank-com/json-schema/xeorank-com-keyword-ranking-performance-response-schema.json",
  "title": "KeywordRankingPerformanceResponse",
  "x-generated": "2026-11-29",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/xeorank-com-openapi.json#/components/schemas/KeywordRankingPerformanceResponse",
  "properties": {
    "start_date": {
      "type": "string",
      "format": "date",
      "title": "Start Date"
    },
    "end_date": {
      "type": "string",
      "format": "date",
      "title": "End Date"
    },
    "history_starts_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "History Starts At"
    },
    "history_available_from": {
      "anyOf": [
        {
          "type": "string",
          "format": "date"
        },
        {
          "type": "null"
        }
      ],
      "title": "History Available From"
    },
    "location_code": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Location Code"
    },
    "location_name": {
      "type": "string",
      "title": "Location Name"
    },
    "location_type": {
      "type": "string",
      "title": "Location Type"
    },
    "language_code": {
      "type": "string",
      "title": "Language Code"
    },
    "device": {
      "type": "string",
      "title": "Device"
    },
    "total_keywords": {
      "type": "integer",
      "title": "Total Keywords",
      "default": 0
    },
    "average_position": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Average Position"
    },
    "improved": {
      "type": "integer",
      "title": "Improved",
      "default": 0
    },
    "declined": {
      "type": "integer",
      "title": "Declined",
      "default": 0
    },
    "unchanged": {
      "type": "integer",
      "title": "Unchanged",
      "default": 0
    },
    "buckets": {
      "items": {
        "$ref": "#/$defs/KeywordRankingBucket"
      },
      "type": "array",
      "title": "Buckets"
    },
    "trend": {
      "items": {
        "$ref": "#/$defs/KeywordRankingTrendPoint"
      },
      "type": "array",
      "title": "Trend"
    },
    "keywords": {
      "items": {
        "$ref": "#/$defs/KeywordRankingPerformanceItem"
      },
      "type": "array",
      "title": "Keywords"
    }
  },
  "type": "object",
  "required": [
    "start_date",
    "end_date",
    "location_name",
    "location_type",
    "language_code",
    "device"
  ],
  "$defs": {
    "KeywordRankingBucket": {
      "properties": {
        "label": {
          "type": "string",
          "title": "Label"
        },
        "max_position": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Max Position"
        },
        "count": {
          "type": "integer",
          "title": "Count",
          "default": 0
        }
      },
      "type": "object",
      "required": [
        "label"
      ],
      "title": "KeywordRankingBucket"
    },
    "KeywordRankingPerformanceItem": {
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "title": "Id"
        },
        "keyword": {
          "type": "string",
          "title": "Keyword"
        },
        "position": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Position"
        },
        "ranking_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Ranking Url"
        },
        "checked_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ],
          "title": "Checked At"
        },
        "search_volume": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Search Volume"
        },
        "keyword_difficulty": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Keyword Difficulty"
        },
        "cpc": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Cpc"
        },
        "intent": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Intent"
        },
        "serp_features": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "title": "Serp Features"
        },
        "previous_position": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Previous Position"
        },
        "position_change": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Position Change"
        },
        "average_position": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Average Position"
        },
        "best_position": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Best Position"
        },
        "worst_position": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Worst Position"
        },
        "status": {
          "type": "string",
          "title": "Status",
          "default": "not_checked"
        },
        "history": {
          "items": {
            "additionalProperties": true,
            "type": "object"
          },
          "type": "array",
          "title": "History"
        }
      },
      "type": "object",
      "required": [
        "id",
        "keyword"
      ],
      "title": "KeywordRankingPerformanceItem"
    },
    "KeywordRankingTrendPoint": {
      "properties": {
        "date": {
          "type": "string",
          "title": "Date"
        },
        "average_position": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Average Position"
        },
        "top_3": {
          "type": "integer",
          "title": "Top 3",
          "default": 0
        },
        "top_10": {
          "type": "integer",
          "title": "Top 10",
          "default": 0
        },
        "top_25": {
          "type": "integer",
          "title": "Top 25",
          "default": 0
        },
        "top_50": {
          "type": "integer",
          "title": "Top 50",
          "default": 0
        },
        "top_100": {
          "type": "integer",
          "title": "Top 100",
          "default": 0
        }
      },
      "type": "object",
      "required": [
        "date"
      ],
      "title": "KeywordRankingTrendPoint"
    }
  }
}