{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/nessflow-com/json-schema/nessflow-com-positions-schema.json",
  "title": "Positions",
  "x-generated": "2026-11-19",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/nessflow-com-openapi.json#/components/schemas/Positions",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "project_id",
    "status",
    "tracker",
    "markets",
    "market",
    "period",
    "summary",
    "keywords",
    "quota"
  ],
  "properties": {
    "project_id": {
      "type": "string",
      "format": "uuid"
    },
    "status": {
      "type": "string",
      "enum": [
        "unconfigured",
        "pending",
        "ready"
      ]
    },
    "tracker": {
      "type": [
        "object",
        "null"
      ],
      "additionalProperties": false,
      "required": [
        "location",
        "country",
        "language",
        "device",
        "active",
        "last_tracked_on"
      ],
      "properties": {
        "location": {
          "type": "string"
        },
        "country": {
          "type": [
            "string",
            "null"
          ]
        },
        "language": {
          "type": "string"
        },
        "device": {
          "type": "string"
        },
        "active": {
          "type": "boolean"
        },
        "last_tracked_on": {
          "type": [
            "string",
            "null"
          ],
          "format": "date"
        }
      }
    },
    "markets": {
      "type": "array",
      "description": "Markets followed by the project (country, language, device), the primary one first. `tracker` describes the primary market.",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "key",
          "location",
          "country",
          "language",
          "device",
          "primary"
        ],
        "properties": {
          "key": {
            "type": "string",
            "description": "Stable key of the market, usable as the `market` filter."
          },
          "location": {
            "type": "string"
          },
          "country": {
            "type": [
              "string",
              "null"
            ]
          },
          "language": {
            "type": "string"
          },
          "device": {
            "type": "string"
          },
          "primary": {
            "type": "boolean"
          }
        }
      }
    },
    "market": {
      "type": [
        "string",
        "null"
      ],
      "description": "The market this response describes; `null` = every market of the project."
    },
    "period": {
      "type": [
        "object",
        "null"
      ],
      "additionalProperties": false,
      "required": [
        "preset",
        "from",
        "to"
      ],
      "properties": {
        "preset": {
          "type": "string"
        },
        "from": {
          "type": "string",
          "format": "date"
        },
        "to": {
          "type": "string",
          "format": "date"
        }
      }
    },
    "summary": {
      "type": [
        "object",
        "null"
      ],
      "additionalProperties": false,
      "required": [
        "average_position",
        "ranking_keywords",
        "measured_keywords",
        "tracked_keywords",
        "top3",
        "top10",
        "visibility_percent",
        "improved",
        "declined",
        "entered",
        "exited"
      ],
      "properties": {
        "average_position": {
          "type": [
            "number",
            "null"
          ],
          "description": "Over keywords ranked in the top 100 only."
        },
        "ranking_keywords": {
          "type": "integer"
        },
        "measured_keywords": {
          "type": "integer",
          "description": "Denominator of `visibility_percent`."
        },
        "tracked_keywords": {
          "type": "integer"
        },
        "top3": {
          "type": "integer"
        },
        "top10": {
          "type": "integer"
        },
        "visibility_percent": {
          "type": [
            "number",
            "null"
          ]
        },
        "improved": {
          "type": "integer"
        },
        "declined": {
          "type": "integer"
        },
        "entered": {
          "type": "integer"
        },
        "exited": {
          "type": "integer"
        }
      }
    },
    "keywords": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "keyword",
          "active",
          "market",
          "measured",
          "position",
          "url",
          "delta_1d",
          "delta_7d",
          "delta_30d",
          "search_volume",
          "keyword_difficulty",
          "search_intent",
          "serp_features"
        ],
        "properties": {
          "keyword": {
            "type": "string"
          },
          "market": {
            "type": [
              "string",
              "null"
            ],
            "description": "Key of the keyword's market."
          },
          "active": {
            "type": "boolean"
          },
          "measured": {
            "type": "boolean"
          },
          "position": {
            "type": [
              "integer",
              "null"
            ],
            "description": "`null` with `measured: true` means out of the top 100."
          },
          "url": {
            "type": [
              "string",
              "null"
            ]
          },
          "delta_1d": {
            "type": [
              "integer",
              "null"
            ]
          },
          "delta_7d": {
            "type": [
              "integer",
              "null"
            ]
          },
          "delta_30d": {
            "type": [
              "integer",
              "null"
            ]
          },
          "search_volume": {
            "type": [
              "integer",
              "null"
            ]
          },
          "keyword_difficulty": {
            "type": [
              "integer",
              "null"
            ]
          },
          "search_intent": {
            "type": [
              "string",
              "null"
            ]
          },
          "serp_features": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      }
    },
    "quota": {
      "$ref": "#/$defs/QuotaGauge"
    }
  },
  "$defs": {
    "QuotaGauge": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "used",
        "limit",
        "remaining"
      ],
      "properties": {
        "used": {
          "type": "integer"
        },
        "limit": {
          "type": [
            "integer",
            "null"
          ],
          "description": "`null` means unlimited, `0` means not included in the plan."
        },
        "remaining": {
          "type": [
            "integer",
            "null"
          ]
        }
      }
    }
  }
}