{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/semantic-visions-s-r-o/json-schema/semantic-visions-s-r-o-search-event-request-schema.json",
  "title": "SearchEventRequest",
  "description": "Request model for the search event endpoint.",
  "x-generated": "2026-11-30",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/semantic-visions-s-r-o-openapi.yml#/components/schemas/SearchEventRequest",
  "properties": {
    "date_from": {
      "type": "string",
      "format": "date",
      "title": "Date From",
      "description": "Start date for the search range (YYYY-MM-DD)"
    },
    "date_to": {
      "type": "string",
      "format": "date",
      "title": "Date To",
      "description": "End date for the search range (YYYY-MM-DD). Must be after date_from."
    },
    "languages": {
      "anyOf": [
        {
          "items": {
            "type": "string",
            "enum": [
              "ar",
              "cs",
              "en",
              "fr",
              "de",
              "zh",
              "it",
              "ja",
              "ko",
              "pt",
              "ru",
              "es"
            ]
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Languages",
      "description": "List of language codes to filter by."
    },
    "entity_type": {
      "anyOf": [
        {
          "items": {
            "type": "string",
            "enum": [
              "commodity",
              "company",
              "industry",
              "legal_entity",
              "location"
            ]
          },
          "type": "array"
        },
        {
          "type": "string",
          "enum": [
            "commodity",
            "company",
            "industry",
            "legal_entity",
            "location"
          ]
        },
        {
          "type": "null"
        }
      ],
      "title": "Entity Type",
      "description": "Type of entity to search."
    },
    "count": {
      "type": "integer",
      "maximum": 10000.0,
      "minimum": 1.0,
      "title": "Count",
      "description": "Number of results to return",
      "default": 100
    },
    "sort_by": {
      "anyOf": [
        {
          "items": {
            "type": "string",
            "enum": [
              "intensity",
              "-intensity",
              "timestamp",
              "-timestamp",
              "impact_type_name",
              "-impact_type_name",
              "event_category_name",
              "-event_category_name",
              "event_type_name",
              "-event_type_name",
              "articles_count",
              "-articles_count",
              "representative_article_domain",
              "-representative_article_domain",
              "representative_article_title",
              "-representative_article_title",
              "representative_article_score",
              "-representative_article_score",
              "representative_article_title_en",
              "key",
              "-key"
            ]
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Sort By",
      "description": "List of fields to sort by. Prefix with \"-\" for descending order.",
      "default": [
        "timestamp",
        "-intensity"
      ]
    },
    "cursor": {
      "anyOf": [
        {
          "items": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "string"
              }
            ]
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Cursor",
      "description": "Pagination cursor for the next page. Pass the cursor from a previous response unchanged, with the same sort_by. The returned cursor includes a UUID tie-breaker, so it is one element longer than sort_by."
    },
    "intensity_min": {
      "type": "integer",
      "maximum": 1000.0,
      "minimum": 1.0,
      "title": "Intensity Min",
      "description": "Minimum intensity filter. Must be <= intensity_max.",
      "default": 1
    },
    "intensity_max": {
      "type": "integer",
      "maximum": 1000.0,
      "minimum": 1.0,
      "title": "Intensity Max",
      "description": "Maximum intensity filter. Must be >= intensity_min.",
      "default": 1000
    },
    "entity_ids": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Entity Ids",
      "description": "Filter by specific entity IDs. Can be a single string or list of strings. Valid entity IDs can be retrieved from the corresponding entity endpoints."
    },
    "impact_types": {
      "anyOf": [
        {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Impact Types",
      "description": "Filter by SvEye taxonomy elements IDs (Impact Types)."
    },
    "event_categories": {
      "anyOf": [
        {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Event Categories",
      "description": "Filter by SvEye taxonomy elements IDs (Event Categories)."
    },
    "event_types": {
      "anyOf": [
        {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Event Types",
      "description": "Filter by SvEye taxonomy elements IDs (Event Types)."
    }
  },
  "additionalProperties": false,
  "type": "object",
  "required": [
    "date_from",
    "date_to"
  ]
}