{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/blacksky/json-schema/blacksky-search-payload-schema.json",
  "title": "SearchPayload",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/blacksky-data-management-api-openapi.yml#/components/schemas/SearchPayload",
  "type": "object",
  "not": {
    "required": [
      "bbox",
      "intersects"
    ],
    "type": "object"
  },
  "properties": {
    "collections": {
      "title": "Collections",
      "type": "array",
      "description": "Search for STAC items in the specified STAC collections.",
      "items": {
        "type": "string",
        "format": "uuid4"
      }
    },
    "ids": {
      "title": "IDs",
      "type": "array",
      "description": "Search for specific STAC items by their IDs.",
      "items": {
        "type": "string",
        "format": "uuid4"
      }
    },
    "datetime": {
      "title": "Datetime",
      "type": "string",
      "description": "Search for data that has a temporal property that intersects the datetime value in the RFC 3339 format. You can search for a specific date and time, or for a closed or an open date interval. Express open intervals using double-dots.\n- An example of a timestamp: `\"2025-02-12T23:20:50Z\"`.\n- An example of a closed interval: `\"2025-02-12T00:00:00Z/2018-03-18T12:31:12Z\"`.\n- Examples of open intervals: `\"2025-02-12T00:00:00Z/..\"` or `\"../2025-03-18T12:31:12Z\"`.'\n"
    },
    "sortby": {
      "title": "Response sorting",
      "type": "array",
      "description": "A results sorting method that arranges elements in ascending or descending order based on a chosen field.",
      "items": {
        "$ref": "#/$defs/ItemSortClause"
      }
    },
    "limit": {
      "title": "Response record limit",
      "maximum": 10000,
      "minimum": 1,
      "type": "integer",
      "description": "The maximum number of data items on a results page.\n",
      "default": 10
    },
    "page": {
      "title": "page",
      "type": "integer",
      "description": "The number of the page to return. To get the first page, set the parameter to `0`."
    },
    "filter": {
      "title": "CQL2-json filter",
      "type": "object",
      "description": "A [CQL2 filter](https://docs.up42.com/developers/api-stac#detailed-search) that consists of arguments (`filter.args`) and operators (`filter.op`).\n"
    },
    "filter-lang": {
      "title": "Filter language",
      "type": "string",
      "description": "The CQL filter that encodes the value used in `filter`. The only supported value is `cql2-json`.",
      "default": "cql2-json",
      "enum": [
        "cql2-json"
      ]
    },
    "bbox": {
      "title": "Intersecting bbox",
      "maxItems": 4,
      "minItems": 4,
      "type": "array",
      "description": "Search for data that intersects a bounding box in the `[min longitude, min latitude, max longitude, max latitude]` format. Use only if `intersects` isn't specified.\n",
      "items": {
        "type": "number",
        "format": "double"
      }
    },
    "intersects": {
      "title": "Intersecting geometry",
      "description": "Search for data that intersects the provided geometry. Use only if `bbox` isn't specified.\n",
      "anyOf": [
        {
          "$ref": "#/$defs/Point"
        },
        {
          "$ref": "#/$defs/MultiPoint"
        },
        {
          "$ref": "#/$defs/LineString"
        },
        {
          "$ref": "#/$defs/MultiLineString"
        },
        {
          "$ref": "#/$defs/STACPolygon"
        },
        {
          "$ref": "#/$defs/MultiPolygon"
        }
      ]
    }
  },
  "$defs": {
    "ItemSortClause": {
      "title": "SortUnit",
      "required": [
        "field"
      ],
      "type": "object",
      "properties": {
        "field": {
          "title": "Field",
          "type": "string",
          "description": "A field to use for sorting.",
          "enum": [
            "asset_id",
            "collection",
            "collection_name",
            "constellation",
            "created",
            "data_product_id",
            "datetime",
            "eo:cloud_cover",
            "gsd",
            "id",
            "job_id",
            "order_id",
            "source",
            "tags",
            "title",
            "workspace_id"
          ]
        },
        "direction": {
          "title": "Direction",
          "type": "string",
          "description": "An order of sorting.",
          "default": "asc",
          "enum": [
            "asc",
            "desc"
          ]
        }
      }
    },
    "LineString": {
      "title": "LineString",
      "required": [
        "coordinates"
      ],
      "type": "object",
      "properties": {
        "type": {
          "title": "Type",
          "type": "string",
          "default": "LineString"
        },
        "coordinates": {
          "title": "Coordinates",
          "minItems": 2,
          "type": "array",
          "items": {
            "anyOf": [
              {
                "maxItems": 2,
                "minItems": 2,
                "type": "array",
                "items": {
                  "type": "number"
                }
              },
              {
                "maxItems": 3,
                "minItems": 3,
                "type": "array",
                "items": {
                  "type": "number"
                }
              }
            ]
          }
        }
      },
      "description": "LineString Model"
    },
    "MultiLineString": {
      "title": "MultiLineString",
      "required": [
        "coordinates"
      ],
      "type": "object",
      "properties": {
        "type": {
          "title": "Type",
          "type": "string",
          "default": "MultiLineString"
        },
        "coordinates": {
          "title": "Coordinates",
          "minItems": 1,
          "type": "array",
          "items": {
            "minItems": 2,
            "type": "array",
            "items": {
              "anyOf": [
                {
                  "maxItems": 2,
                  "minItems": 2,
                  "type": "array",
                  "items": {
                    "type": "number"
                  }
                },
                {
                  "maxItems": 3,
                  "minItems": 3,
                  "type": "array",
                  "items": {
                    "type": "number"
                  }
                }
              ]
            }
          }
        }
      },
      "description": "MultiLineString Model"
    },
    "MultiPoint": {
      "title": "MultiPoint",
      "required": [
        "coordinates"
      ],
      "type": "object",
      "properties": {
        "type": {
          "title": "Type",
          "type": "string",
          "default": "MultiPoint"
        },
        "coordinates": {
          "title": "Coordinates",
          "minItems": 1,
          "type": "array",
          "items": {
            "anyOf": [
              {
                "maxItems": 2,
                "minItems": 2,
                "type": "array",
                "items": {
                  "type": "number"
                }
              },
              {
                "maxItems": 3,
                "minItems": 3,
                "type": "array",
                "items": {
                  "type": "number"
                }
              }
            ]
          }
        }
      },
      "description": "MultiPoint Model"
    },
    "MultiPolygon": {
      "title": "MultiPolygon",
      "required": [
        "coordinates"
      ],
      "type": "object",
      "properties": {
        "type": {
          "title": "Type",
          "type": "string",
          "default": "MultiPolygon"
        },
        "coordinates": {
          "title": "Coordinates",
          "minItems": 1,
          "type": "array",
          "items": {
            "minItems": 1,
            "type": "array",
            "items": {
              "minItems": 4,
              "type": "array",
              "items": {
                "anyOf": [
                  {
                    "maxItems": 2,
                    "minItems": 2,
                    "type": "array",
                    "items": {
                      "type": "number"
                    }
                  },
                  {
                    "maxItems": 3,
                    "minItems": 3,
                    "type": "array",
                    "items": {
                      "type": "number"
                    }
                  }
                ]
              }
            }
          }
        }
      },
      "description": "MultiPolygon Model"
    },
    "Point": {
      "title": "Point",
      "required": [
        "coordinates"
      ],
      "type": "object",
      "properties": {
        "type": {
          "title": "Type",
          "type": "string",
          "default": "Point"
        },
        "coordinates": {
          "title": "Coordinates",
          "anyOf": [
            {
              "maxItems": 2,
              "minItems": 2,
              "type": "array",
              "items": {
                "type": "number"
              }
            },
            {
              "maxItems": 3,
              "minItems": 3,
              "type": "array",
              "items": {
                "type": "number"
              }
            }
          ]
        }
      },
      "description": "Point Model"
    },
    "STACPolygon": {
      "title": "Polygon",
      "required": [
        "coordinates"
      ],
      "type": "object",
      "properties": {
        "type": {
          "title": "Type",
          "type": "string",
          "default": "Polygon"
        },
        "coordinates": {
          "title": "Coordinates",
          "minItems": 1,
          "type": "array",
          "items": {
            "minItems": 4,
            "type": "array",
            "items": {
              "anyOf": [
                {
                  "maxItems": 2,
                  "minItems": 2,
                  "type": "array",
                  "items": {
                    "type": "number"
                  }
                },
                {
                  "maxItems": 3,
                  "minItems": 3,
                  "type": "array",
                  "items": {
                    "type": "number"
                  }
                }
              ]
            }
          }
        }
      },
      "description": "Polygon Model"
    }
  }
}