{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/prismcrawl-com/json-schema/prismcrawl-com-amazon-search-request-schema.json",
  "title": "AmazonSearchRequest",
  "x-generated": "2026-11-21",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/prismcrawl-com-openapi.json#/components/schemas/AmazonSearchRequest",
  "type": "object",
  "required": [
    "query"
  ],
  "allOf": [
    {
      "if": {
        "properties": {
          "webhook_url": {
            "type": "string",
            "format": "uri",
            "maxLength": 2048,
            "description": "Required with Prefer: respond-async. Public HTTPS callback URL on port 443, without credentials or a fragment. Receives the completed response by POST; redirects are not followed. Rejected on synchronous requests."
          },
          "webhook_secret": {
            "type": "string",
            "minLength": 32,
            "maxLength": 256,
            "writeOnly": true,
            "description": "Required with Prefer: respond-async. A shared signing secret of 32–256 printable ASCII characters. Never returned in responses or request history."
          },
          "output": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "json",
              "html",
              "md",
              null
            ],
            "default": "json",
            "description": "Response content format. md returns Markdown in data.content with data.format=md; the JSON success/request envelope remains. Accept: text/markdown also selects Markdown unless output or html=true is explicit. html is an alias for html=true and retains the existing Brotli/Base64 source format."
          },
          "json_restrictor": {
            "type": [
              "string",
              "null"
            ],
            "minLength": 1,
            "maxLength": 4096,
            "description": "Select fields within data.content for JSON or Markdown. Supports comma-separated paths, non-negative array indices, half-open slices [0:3] (either bound may be omitted), [] and .{nested,subqueries}. Up to128 selections and16 levels. Missing fields are omitted; selected declared fields retain their zero defaults. The request envelope and credit headers remain. Include next_page_token when pagination is needed. Incompatible with HTML output. This changes response presentation only; tracing-enabled history retains the complete JSON result."
          },
          "no_cache": {
            "type": [
              "boolean",
              "null"
            ],
            "default": false,
            "description": "Accepted for compatibility. Searches are always fetched without a result cache for either value; normal successful-request billing applies."
          },
          "amazon_domain": {
            "enum": [
              "amazon.com",
              null
            ]
          },
          "delivery_country": {
            "enum": [
              "US",
              null
            ]
          }
        }
      },
      "then": {
        "properties": {
          "currency": {
            "enum": [
              "USD",
              null
            ]
          }
        }
      }
    }
  ],
  "properties": {
    "query": {
      "type": "string",
      "minLength": 1,
      "maxLength": 8192,
      "x-max-utf8-bytes": 8192,
      "description": "The search query. The UTF-8 representation must not exceed 8,192 bytes; non-ASCII characters may use more than one byte."
    },
    "html": {
      "type": [
        "boolean",
        "null"
      ],
      "default": false,
      "description": "Return Brotli-compressed, Base64-encoded source HTML instead of normalized JSON."
    },
    "zero_trace": {
      "type": [
        "boolean",
        "null"
      ],
      "default": false,
      "description": "When true, PrismCrawl does not store the source HTML or parsed JSON. Audit and billing metadata is retained, but all other data is permanently discarded. Individual history lookup exposes only type `ZERO_TRACE`, HTTP status code, and credit charge state. History listing also includes request ID, completion time, duration and success."
    },
    "device": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "desktop",
        "mobile",
        null
      ],
      "default": "desktop",
      "description": "Device profile used for the Amazon request."
    },
    "amazon_domain": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "amazon.com",
        "amazon.ca",
        "amazon.com.mx",
        "amazon.com.br",
        "amazon.co.uk",
        "amazon.ie",
        "amazon.de",
        "amazon.es",
        "amazon.fr",
        "amazon.it",
        "amazon.nl",
        "amazon.se",
        "amazon.pl",
        "amazon.com.be",
        "amazon.com.tr",
        "amazon.ae",
        "amazon.sa",
        "amazon.eg",
        "amazon.in",
        "amazon.co.jp",
        "amazon.com.au",
        "amazon.sg",
        null
      ],
      "default": "amazon.com",
      "description": "Amazon marketplace domain, without a scheme or `www.` prefix."
    },
    "language": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "en_US",
        "es_US",
        "ar_AE",
        "de_US",
        "he_IL",
        "ko_KR",
        "pt_BR",
        "zh_CN",
        "zh_TW",
        "en_CA",
        "fr_CA",
        "es_MX",
        "en_GB",
        "en_IE",
        "de_DE",
        "cs_CZ",
        "nl_NL",
        "pl_PL",
        "tr_TR",
        "da_DK",
        "es_ES",
        "pt_PT",
        "fr_FR",
        "it_IT",
        "sv_SE",
        "nl_BE",
        "fr_BE",
        "en_AE",
        "en_IN",
        "hi_IN",
        "ta_IN",
        "te_IN",
        "kn_IN",
        "ml_IN",
        "bn_IN",
        "mr_IN",
        "ja_JP",
        "en_AU",
        "en_SG",
        null
      ],
      "description": "Amazon locale supported by the selected marketplace. Omit it to use the marketplace default (the first locale shown): amazon.com: en_US, es_US, ar_AE, de_US, he_IL, ko_KR, pt_BR, zh_CN, zh_TW; amazon.ca: en_CA, fr_CA; amazon.com.mx: es_MX; amazon.com.br: pt_BR; amazon.co.uk: en_GB; amazon.ie: en_IE; amazon.de: de_DE, en_GB, cs_CZ, nl_NL, pl_PL, tr_TR, da_DK; amazon.es: es_ES, pt_PT, en_GB; amazon.fr: fr_FR, en_GB; amazon.it: it_IT, en_GB; amazon.nl: nl_NL, en_GB; amazon.se: sv_SE, en_GB; amazon.pl: pl_PL; amazon.com.be: nl_BE, fr_BE, en_GB; amazon.com.tr: tr_TR; amazon.ae: en_AE, ar_AE; amazon.sa: ar_AE, en_AE; amazon.eg: ar_AE, en_AE; amazon.in: en_IN, hi_IN, ta_IN, te_IN, kn_IN, ml_IN, bn_IN, mr_IN; amazon.co.jp: ja_JP, en_US, zh_CN; amazon.com.au: en_AU; amazon.sg: en_SG."
    },
    "delivery_country": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "AD",
        "AE",
        "AF",
        "AG",
        "AI",
        "AL",
        "AM",
        "AO",
        "AR",
        "AS",
        "AT",
        "AU",
        "AW",
        "AX",
        "AZ",
        "BA",
        "BB",
        "BD",
        "BE",
        "BF",
        "BG",
        "BH",
        "BI",
        "BJ",
        "BL",
        "BM",
        "BN",
        "BO",
        "BQ",
        "BR",
        "BS",
        "BT",
        "BV",
        "BW",
        "BY",
        "BZ",
        "CA",
        "CC",
        "CD",
        "CF",
        "CG",
        "CH",
        "CI",
        "CK",
        "CL",
        "CM",
        "CN",
        "CO",
        "CR",
        "CV",
        "CW",
        "CX",
        "CY",
        "CZ",
        "DE",
        "DJ",
        "DK",
        "DM",
        "DO",
        "DZ",
        "EC",
        "EE",
        "EG",
        "EH",
        "ER",
        "ES",
        "ET",
        "FI",
        "FJ",
        "FK",
        "FM",
        "FO",
        "FR",
        "GA",
        "GB",
        "GD",
        "GE",
        "GF",
        "GG",
        "GH",
        "GI",
        "GL",
        "GM",
        "GN",
        "GP",
        "GQ",
        "GR",
        "GS",
        "GT",
        "GW",
        "GY",
        "HK",
        "HM",
        "HN",
        "HR",
        "HT",
        "HU",
        "ID",
        "IE",
        "IL",
        "IM",
        "IN",
        "IO",
        "IQ",
        "IS",
        "IT",
        "JE",
        "JM",
        "JO",
        "JP",
        "KE",
        "KG",
        "KH",
        "KI",
        "KM",
        "KN",
        "KR",
        "KW",
        "KY",
        "KZ",
        "LA",
        "LB",
        "LC",
        "LI",
        "LK",
        "LR",
        "LS",
        "LT",
        "LU",
        "LV",
        "LY",
        "MA",
        "MC",
        "MD",
        "ME",
        "MF",
        "MG",
        "MH",
        "MK",
        "ML",
        "MM",
        "MN",
        "MO",
        "MQ",
        "MR",
        "MS",
        "MT",
        "MU",
        "MV",
        "MW",
        "MX",
        "MY",
        "MZ",
        "NA",
        "NC",
        "NE",
        "NF",
        "NG",
        "NI",
        "NL",
        "NO",
        "NP",
        "NR",
        "NU",
        "NZ",
        "OM",
        "PA",
        "PE",
        "PF",
        "PG",
        "PH",
        "PK",
        "PL",
        "PM",
        "PN",
        "PS",
        "PT",
        "PW",
        "PY",
        "QA",
        "RE",
        "RO",
        "RS",
        "RU",
        "RW",
        "SA",
        "SB",
        "SC",
        "SE",
        "SG",
        "SH",
        "SI",
        "SJ",
        "SK",
        "SL",
        "SM",
        "SN",
        "SO",
        "SR",
        "ST",
        "SV",
        "SX",
        "SZ",
        "TC",
        "TD",
        "TF",
        "TG",
        "TH",
        "TJ",
        "TK",
        "TL",
        "TM",
        "TN",
        "TO",
        "TR",
        "TT",
        "TV",
        "TW",
        "TZ",
        "UA",
        "UG",
        "UM",
        "US",
        "UY",
        "UZ",
        "VA",
        "VC",
        "VE",
        "VG",
        "VN",
        "VU",
        "WF",
        "WS",
        "YE",
        "YT",
        "ZA",
        "ZM",
        "ZW",
        null
      ],
      "description": "Amazon delivery destination as an ISO 3166-1 alpha-2 country code. This is independent of marketplace, interface language, and server egress. Omit it to use the selected marketplace's home country. It controls catalog availability, delivery promises, and shipping context."
    },
    "postal_code": {
      "type": [
        "string",
        "null"
      ],
      "minLength": 1,
      "maxLength": 16,
      "description": "Exact delivery postal code. It is accepted only when `delivery_country` is the selected marketplace's home country. Supported marketplace examples: amazon.com: 10001; amazon.ca: M5V 3L9; amazon.com.mx: 06600; amazon.com.br: 01310-100; amazon.co.uk: SW1A 1AA; amazon.ie: D02 X285; amazon.de: 10115; amazon.es: 28001; amazon.fr: 75001; amazon.it: 00100; amazon.se: 111 20; amazon.pl: 00-001; amazon.com.tr: 34000; amazon.in: 110001; amazon.co.jp: 100-0001; amazon.com.au: 2000; amazon.sg: 018956. Amazon-defined city/area marketplaces without reliable postal targeting reject this field."
    },
    "currency": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "AED",
        "AMD",
        "ARS",
        "AUD",
        "AWG",
        "AZN",
        "BBD",
        "BGN",
        "BHD",
        "BMD",
        "BND",
        "BOB",
        "BRL",
        "BSD",
        "BZD",
        "CAD",
        "CHF",
        "CLP",
        "CNY",
        "COP",
        "CRC",
        "CZK",
        "DKK",
        "DOP",
        "EGP",
        "EUR",
        "GBP",
        "GEL",
        "GHS",
        "GTQ",
        "GYD",
        "HKD",
        "HNL",
        "HUF",
        "IDR",
        "ILS",
        "INR",
        "JMD",
        "JPY",
        "KES",
        "KHR",
        "KRW",
        "KWD",
        "KYD",
        "KZT",
        "LBP",
        "LKR",
        "MAD",
        "MNT",
        "MOP",
        "MUR",
        "MVR",
        "MXN",
        "MYR",
        "NAD",
        "NGN",
        "NIO",
        "NOK",
        "NZD",
        "OMR",
        "PAB",
        "PEN",
        "PHP",
        "PKR",
        "PLN",
        "PYG",
        "QAR",
        "RON",
        "RUB",
        "SAR",
        "SEK",
        "SGD",
        "THB",
        "TRY",
        "TTD",
        "TWD",
        "TZS",
        "USD",
        "UYU",
        "UZS",
        "VND",
        "XAF",
        "XCD",
        "XOF",
        "XPF",
        "ZAR",
        null
      ],
      "description": "Three-letter display-currency override. This changes displayed prices only; it does not change delivery eligibility or destination. Omit it for the marketplace's native currency. Most marketplaces accept only their native currency; amazon.com and amazon.ae support additional currencies exposed by Amazon's selector. For amazon.com with US delivery (including an omitted delivery_country), only USD is supported; requesting another currency returns HTTP 400. Select an international delivery country to use another supported currency on amazon.com."
    },
    "page": {
      "type": [
        "integer",
        "null"
      ],
      "minimum": 1,
      "maximum": 1000,
      "default": 1,
      "description": "One-based Amazon results page."
    },
    "category_id": {
      "type": [
        "string",
        "null"
      ],
      "pattern": "^[A-Za-z0-9_-]+$",
      "maxLength": 40,
      "description": "Amazon category or browse-node identifier."
    },
    "sort_by": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "featured",
        "price_low_to_high",
        "price_high_to_low",
        "average_review",
        "most_recent",
        "bestsellers",
        "bestseller_rankings",
        null
      ],
      "description": "Amazon-native result ordering."
    },
    "rh": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 2000,
      "pattern": "^[A-Za-z0-9_-]+:[A-Za-z0-9_-]+(?:,[A-Za-z0-9_-]+:[A-Za-z0-9_-]+)*$",
      "description": "Comma-separated Amazon `key:value` refinements."
    },
    "merchant_id": {
      "type": [
        "string",
        "null"
      ],
      "pattern": "^[A-Za-z0-9_-]+$",
      "maxLength": 64,
      "description": "Restrict results to an Amazon merchant ID."
    },
    "direct_search": {
      "type": [
        "boolean",
        "null"
      ],
      "default": false,
      "description": "Use Amazon's direct category-search mode."
    }
  }
}