{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/trychannel3-com/json-schema/trychannel3-com-search-request-schema.json",
  "title": "SearchRequest",
  "description": "Search request with pagination support.",
  "x-generated": "2026-11-27",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/trychannel3-com-openapi.json#/components/schemas/SearchRequest",
  "properties": {
    "query": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Query",
      "description": "Search query. At least one of `query`, `image_url`, `base64_image`, or `page_token` must be provided."
    },
    "image_url": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Image Url",
      "description": "Image URL. At least one of `query`, `image_url`, `base64_image`, or `page_token` must be provided."
    },
    "base64_image": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Base64 Image",
      "description": "Base64 encoded image. At least one of `query`, `image_url`, `base64_image`, or `page_token` must be provided."
    },
    "limit": {
      "anyOf": [
        {
          "type": "integer",
          "minimum": 1.0
        },
        {
          "type": "null"
        }
      ],
      "title": "Limit",
      "description": "Optional limit on the number of results. Default is 20, max is 30.",
      "default": 20
    },
    "filters": {
      "$ref": "#/$defs/SearchFilters",
      "description": "Optional filters. Search will only consider products that match all of the filters.",
      "default": {
        "conditions": [
          "new"
        ],
        "availability": [
          "InStock"
        ],
        "requires_sticker": false
      }
    },
    "config": {
      "$ref": "#/$defs/SearchConfig",
      "description": "Optional configuration",
      "default": {
        "mode": "default"
      }
    },
    "page_token": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Page Token",
      "description": "Opaque token from a previous search response to fetch the next page of results."
    }
  },
  "additionalProperties": false,
  "type": "object",
  "$defs": {
    "Age": {
      "type": "string",
      "enum": [
        "newborn",
        "infant",
        "toddler",
        "kids",
        "adult"
      ],
      "title": "Age"
    },
    "AngleUnit": {
      "type": "string",
      "enum": [
        "°"
      ],
      "title": "AngleUnit"
    },
    "ColorMatch": {
      "type": "string",
      "enum": [
        "strict",
        "standard",
        "loose"
      ],
      "title": "ColorMatch",
      "description": "How tightly a product's colors must match the requested palette."
    },
    "Condition": {
      "type": "string",
      "enum": [
        "new",
        "used"
      ],
      "title": "Condition",
      "description": "Offer condition. 'refurbished' is deprecated: rejected as a filter value,\ncoerced to None on responses."
    },
    "CountUnit": {
      "type": "string",
      "enum": [
        "count"
      ],
      "title": "CountUnit"
    },
    "CountryCode": {
      "type": "string",
      "enum": [
        "US",
        "GB",
        "EU",
        "AU",
        "CA",
        "IE",
        "DE",
        "AT",
        "FR",
        "BE",
        "IT",
        "ES",
        "NL",
        "SE",
        "FI",
        "PT",
        "CZ",
        "GR",
        "RO",
        "CH",
        "PL"
      ],
      "title": "CountryCode",
      "description": "ISO 3166-1 alpha-2 country code (plus the pan-region ``EU``)."
    },
    "CurrencyCode": {
      "type": "string",
      "enum": [
        "USD",
        "CAD",
        "AUD",
        "GBP",
        "EUR",
        "SEK",
        "CZK",
        "RON",
        "CHF",
        "PLN"
      ],
      "title": "CurrencyCode",
      "description": "ISO 4217 currency code."
    },
    "DataRateUnit": {
      "type": "string",
      "enum": [
        "Mbps",
        "Gbps",
        "MB/s",
        "GB/s"
      ],
      "title": "DataRateUnit"
    },
    "FrequencyUnit": {
      "type": "string",
      "enum": [
        "Hz",
        "kHz",
        "MHz",
        "GHz",
        "fps"
      ],
      "title": "FrequencyUnit"
    },
    "Gender": {
      "type": "string",
      "enum": [
        "male",
        "female"
      ],
      "title": "Gender",
      "description": "Product gender. 'unisex' is deprecated: coerced to None on input, never emitted."
    },
    "LanguageCode": {
      "type": "string",
      "enum": [
        "en",
        "de",
        "fr",
        "it",
        "es",
        "nl",
        "sv",
        "fi",
        "pt",
        "cs",
        "el",
        "ro",
        "pl"
      ],
      "title": "LanguageCode",
      "description": "ISO 639-1 language code."
    },
    "LengthUnit": {
      "type": "string",
      "enum": [
        "mm",
        "cm",
        "m",
        "in",
        "ft"
      ],
      "title": "LengthUnit"
    },
    "LuminousFluxUnit": {
      "type": "string",
      "enum": [
        "lm"
      ],
      "title": "LuminousFluxUnit"
    },
    "OfferAvailabilityStatus": {
      "type": "string",
      "enum": [
        "InStock",
        "OutOfStock"
      ],
      "title": "OfferAvailabilityStatus",
      "description": "The two availability values the public API emits on offers.\n\nInternal ``AvailabilityStatus`` values are collapsed to these via\n``AvailabilityStatus.to_api()``."
    },
    "PowerUnit": {
      "type": "string",
      "enum": [
        "W",
        "kW"
      ],
      "title": "PowerUnit"
    },
    "Sale": {
      "type": "string",
      "enum": [
        "on_sale"
      ],
      "title": "Sale"
    },
    "SearchColorsFilter": {
      "properties": {
        "palette": {
          "items": {
            "$ref": "#/$defs/SearchFilterColor"
          },
          "type": "array",
          "title": "Palette",
          "description": "Colors required in matching products. Treated as an AND condition."
        },
        "match": {
          "$ref": "#/$defs/ColorMatch",
          "description": "How tightly colors must match: 'strict', 'standard', or 'loose'.",
          "default": "standard"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "palette"
      ],
      "title": "SearchColorsFilter",
      "description": "[Beta] Color filter wrapper. Holds required colors and optional match mode."
    },
    "SearchConfig": {
      "properties": {
        "language": {
          "anyOf": [
            {
              "$ref": "#/$defs/LanguageCode"
            },
            {
              "type": "null"
            }
          ],
          "description": "ISO 639-1 language code. When unset, inferred from ``country`` (preferred) then ``currency``, defaulting to ``en``."
        },
        "country": {
          "anyOf": [
            {
              "$ref": "#/$defs/CountryCode"
            },
            {
              "type": "null"
            }
          ],
          "description": "ISO 3166-1 alpha-2 country code. When unset with ``currency`` also unset, inferred from ``language`` (e.g. ``fr`` → ``FR``), defaulting to ``US``. May stay unset for pan-region storefronts (e.g. ``currency=EUR`` with no specific country)."
        },
        "currency": {
          "anyOf": [
            {
              "$ref": "#/$defs/CurrencyCode"
            },
            {
              "type": "null"
            }
          ],
          "description": "ISO 4217 currency code. When unset, inferred from ``country`` (e.g. ``GB`` → ``GBP``), defaulting to ``USD``."
        },
        "length_unit": {
          "anyOf": [
            {
              "$ref": "#/$defs/LengthUnit"
            },
            {
              "type": "null"
            }
          ],
          "description": "Preferred unit for length dimensions (length/width/height) in responses. A request dimension filter's unit for the field takes precedence; when neither is set, the merchant's stated unit is returned."
        },
        "weight_unit": {
          "anyOf": [
            {
              "$ref": "#/$defs/WeightUnit"
            },
            {
              "type": "null"
            }
          ],
          "description": "Preferred unit for weight dimensions in responses. A request dimension filter's weight unit takes precedence; when neither is set, the merchant's stated unit is returned."
        },
        "collection_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Collection Id",
          "description": "Optional saved collection to scope this request. Clauses are ORed. Within a clause, brand/website/category lists are ORed inside each list and ANDed across lists. Request filters further narrow results but cannot widen the collection scope."
        },
        "offer_refresh_timeout_ms": {
          "anyOf": [
            {
              "type": "integer",
              "maximum": 10000.0,
              "minimum": 2000.0
            },
            {
              "type": "null"
            }
          ],
          "title": "Offer Refresh Timeout Ms",
          "description": "Check each returned offer against the merchant's live site, waiting up to this many milliseconds (2000-10000). Offers whose page or variant is gone are dropped and offers found out of stock are returned as out of stock. Adds up to this much latency. Restricted: requests from accounts without access are rejected with 403.",
          "x-hidden": true
        },
        "mode": {
          "$ref": "#/$defs/SearchMode",
          "description": "Search strategy. `default` (recommended) combines lexical + semantic search and is right for most use cases. `keyword` is lexical only — use it for real-time, low-latency needs like ad targeting. `agentic` uses an LLM to plan multiple structured sub-searches for complex queries, with higher latency than the other modes.",
          "default": "default"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "title": "SearchConfig",
      "description": "Search request config: ``BaseConfig`` plus ``mode``."
    },
    "SearchFilterColor": {
      "properties": {
        "hex": {
          "type": "string",
          "title": "Hex",
          "description": "sRGB hex string, e.g. '#a1b2c3'"
        },
        "percentage": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Percentage",
          "description": "Percentage of color, where 1.0 is 100%"
        }
      },
      "type": "object",
      "required": [
        "hex"
      ],
      "title": "SearchFilterColor",
      "description": "A single color requirement for the color filter."
    },
    "SearchFilterDimensions": {
      "properties": {
        "length": {
          "anyOf": [
            {
              "$ref": "#/$defs/SearchFilterLengthDimension"
            },
            {
              "type": "null"
            }
          ]
        },
        "width": {
          "anyOf": [
            {
              "$ref": "#/$defs/SearchFilterLengthDimension"
            },
            {
              "type": "null"
            }
          ]
        },
        "height": {
          "anyOf": [
            {
              "$ref": "#/$defs/SearchFilterLengthDimension"
            },
            {
              "type": "null"
            }
          ]
        },
        "weight": {
          "anyOf": [
            {
              "$ref": "#/$defs/SearchFilterWeightDimension"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "additionalProperties": false,
      "type": "object",
      "title": "SearchFilterDimensions",
      "description": "Physical-dimension range filters, matched against the same offer.\n\nMatching products have at least one offer satisfying every provided\nrange (alongside any locale/price/availability filters). Values are\ncompared with a small relative tolerance. An offer with no dimension data\nfor a filtered field does not match; note that when a single merchant on a\nproduct reports a dimension it is shared across that product's offers, so a\nmatching offer may not itself surface that dimension in the response."
    },
    "SearchFilterLengthDimension": {
      "properties": {
        "min": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Min",
          "description": "Minimum value, in `unit`. Inclusive."
        },
        "max": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Max",
          "description": "Maximum value, in `unit`. Inclusive."
        },
        "unit": {
          "$ref": "#/$defs/LengthUnit",
          "description": "Unit that min/max are expressed in"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "unit"
      ],
      "title": "SearchFilterLengthDimension"
    },
    "SearchFilterNumericAttribute": {
      "properties": {
        "min": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Min",
          "description": "Minimum value, in `unit`. Inclusive."
        },
        "max": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Max",
          "description": "Maximum value, in `unit`. Inclusive."
        },
        "unit": {
          "anyOf": [
            {
              "$ref": "#/$defs/LengthUnit"
            },
            {
              "$ref": "#/$defs/VolumeUnit"
            },
            {
              "$ref": "#/$defs/WeightUnit"
            },
            {
              "$ref": "#/$defs/CountUnit"
            },
            {
              "$ref": "#/$defs/TemperatureUnit"
            },
            {
              "$ref": "#/$defs/PowerUnit"
            },
            {
              "$ref": "#/$defs/LuminousFluxUnit"
            },
            {
              "$ref": "#/$defs/TimeUnit"
            },
            {
              "$ref": "#/$defs/DataRateUnit"
            },
            {
              "$ref": "#/$defs/FrequencyUnit"
            },
            {
              "$ref": "#/$defs/AngleUnit"
            },
            {
              "$ref": "#/$defs/SoundLevelUnit"
            },
            {
              "type": "null"
            }
          ],
          "title": "Unit",
          "description": "Unit that min/max are expressed in: one of the attribute's Category Detail `units`. Omit for a unitless attribute (one whose `units` is empty)."
        }
      },
      "additionalProperties": false,
      "type": "object",
      "title": "SearchFilterNumericAttribute",
      "description": "Inclusive range on a numeric attribute, matched against one offer."
    },
    "SearchFilterPrice": {
      "properties": {
        "min_price": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Min Price",
          "description": "Minimum price, in dollars and cents"
        },
        "max_price": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Max Price",
          "description": "Maximum price, in dollars and cents"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "title": "SearchFilterPrice",
      "description": "Price filter for search. Values are inclusive."
    },
    "SearchFilterWeightDimension": {
      "properties": {
        "min": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Min",
          "description": "Minimum value, in `unit`. Inclusive."
        },
        "max": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Max",
          "description": "Maximum value, in `unit`. Inclusive."
        },
        "unit": {
          "$ref": "#/$defs/WeightUnit",
          "description": "Unit that min/max are expressed in"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "unit"
      ],
      "title": "SearchFilterWeightDimension"
    },
    "SearchFilters": {
      "properties": {
        "brand_ids": {
          "anyOf": [
            {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "title": "Brand Ids",
          "description": "If provided, only products from these brands will be returned"
        },
        "gender": {
          "anyOf": [
            {
              "$ref": "#/$defs/Gender"
            },
            {
              "type": "null"
            }
          ]
        },
        "conditions": {
          "items": {
            "$ref": "#/$defs/Condition"
          },
          "type": "array",
          "minItems": 1,
          "title": "Conditions",
          "description": "Offer conditions to match (OR). Defaults to ['new'], which also matches offers whose condition is unknown. Pass every value to disable condition filtering."
        },
        "age": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/Age"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "title": "Age",
          "description": "Filter by age group. Age-agnostic products are treated as adult products."
        },
        "price": {
          "anyOf": [
            {
              "$ref": "#/$defs/SearchFilterPrice"
            },
            {
              "type": "null"
            }
          ],
          "description": "If provided, only products within this price range will be returned"
        },
        "availability": {
          "items": {
            "$ref": "#/$defs/OfferAvailabilityStatus"
          },
          "type": "array",
          "minItems": 1,
          "title": "Availability",
          "description": "Offer availability statuses to match (OR). Defaults to ['InStock']. An offer with no availability data counts as 'InStock'. Pass every value to disable availability filtering."
        },
        "sale": {
          "anyOf": [
            {
              "$ref": "#/$defs/Sale"
            },
            {
              "type": "null"
            }
          ],
          "description": "If 'on_sale', only products with at least one on-sale offer (priced below its compare-at price) for the requested locale are returned. If omitted, no filter."
        },
        "website_ids": {
          "anyOf": [
            {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "title": "Website Ids",
          "description": "If provided, only products from these websites will be returned. Accepts website IDs or domains (e.g. \"nike.com\")."
        },
        "category_ids": {
          "anyOf": [
            {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "title": "Category Ids",
          "description": "If provided, only products from these categories will be returned. Accepts category slugs. Categories that do not exist, or that are not available for search, are rejected with a 422."
        },
        "exclude_brand_ids": {
          "anyOf": [
            {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "title": "Exclude Brand Ids",
          "description": "If provided, products from these brands will be excluded from the results"
        },
        "exclude_website_ids": {
          "anyOf": [
            {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "title": "Exclude Website Ids",
          "description": "If provided, products from these websites will be excluded from the results. Accepts website IDs or domains (e.g. \"nike.com\")."
        },
        "exclude_category_ids": {
          "anyOf": [
            {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "title": "Exclude Category Ids",
          "description": "If provided, products in these categories (or their descendants) will be excluded from the results. Accepts category slugs. Categories that do not exist are rejected with a 422."
        },
        "colors": {
          "anyOf": [
            {
              "$ref": "#/$defs/SearchColorsFilter"
            },
            {
              "type": "null"
            }
          ],
          "description": "[Beta: filter is experimental and may be changed] If provided, find products containing all of these colors."
        },
        "attributes": {
          "anyOf": [
            {
              "additionalProperties": {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "title": "Attributes",
          "description": "If provided, only products matching these key/value constraints will be returned. Keys are attribute handles (e.g. 'color', 'material') and values are lists of allowed values (OR within a key, AND across keys). When a category filter is also supplied, all keys must be valid attributes of at least one of the requested categories. See `Category.attributes` for the valid keys and values per category."
        },
        "dimensions": {
          "anyOf": [
            {
              "$ref": "#/$defs/SearchFilterDimensions"
            },
            {
              "type": "null"
            }
          ],
          "description": "If provided, only products with at least one offer whose physical dimensions satisfy every given range will be returned. Offer dimensions in responses are converted to the units used here."
        },
        "numeric_attributes": {
          "anyOf": [
            {
              "additionalProperties": {
                "$ref": "#/$defs/SearchFilterNumericAttribute"
              },
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "title": "Numeric Attributes",
          "description": "If provided, only products with at least one offer within every given range will be returned, and only those offers are included. Keys are numeric attribute handles (Category Detail attributes of type 'numeric'). Values are an inclusive min/max in `unit`, e.g. {\"screen-size\": {\"max\": 15, \"unit\": \"in\"}}. When a category filter is also supplied, every key must be an attribute of at least one of the requested categories."
        },
        "requires_sticker": {
          "type": "boolean",
          "title": "Requires Sticker",
          "description": "If true, only products with a sticker image (a non-null `sticker_url`) will be returned.",
          "default": false
        }
      },
      "additionalProperties": false,
      "type": "object",
      "title": "SearchFilters",
      "description": "Search filters for the search API."
    },
    "SearchMode": {
      "type": "string",
      "enum": [
        "keyword",
        "default",
        "agentic"
      ],
      "title": "SearchMode",
      "description": "Search strategy.\n\n``default`` (recommended) combines lexical and semantic search and is the\nright choice for most use cases. ``keyword`` runs lexical search only — use\nit for real-time, low-latency needs such as ad targeting. ``agentic`` uses\nan LLM to plan multiple structured sub-searches for complex queries, with\nhigher latency than the other modes."
    },
    "SoundLevelUnit": {
      "type": "string",
      "enum": [
        "dB"
      ],
      "title": "SoundLevelUnit"
    },
    "TemperatureUnit": {
      "type": "string",
      "enum": [
        "°F",
        "°C",
        "K"
      ],
      "title": "TemperatureUnit"
    },
    "TimeUnit": {
      "type": "string",
      "enum": [
        "min",
        "h",
        "day",
        "year"
      ],
      "title": "TimeUnit"
    },
    "VolumeUnit": {
      "type": "string",
      "enum": [
        "ml",
        "l",
        "fl oz",
        "qt",
        "gal",
        "cu ft"
      ],
      "title": "VolumeUnit"
    },
    "WeightUnit": {
      "type": "string",
      "enum": [
        "mg",
        "g",
        "kg",
        "oz",
        "lb"
      ],
      "title": "WeightUnit"
    }
  }
}