{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/patternfetch-com/json-schema/patternfetch-com-query-schema.json",
  "title": "Query",
  "x-generated": "2026-10-31",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_original/patternfetch-com-api-openapi.json#/components/schemas/Query",
  "type": "object",
  "required": [
    "ticker",
    "timeframe"
  ],
  "properties": {
    "ticker": {
      "type": "string",
      "description": "Stock, ETF, or crypto ticker (e.g. AAPL, SPY, BTC/USDT). A bare symbol is always the US listing: BTC is a listed ETF, not Bitcoin - use BTC/USDT for the coin. Affected responses carry a notice field."
    },
    "timeframe": {
      "type": "string",
      "enum": [
        "1m",
        "5m",
        "15m",
        "30m",
        "1h",
        "4h",
        "1d",
        "1w"
      ]
    },
    "limit": {
      "type": "integer",
      "minimum": 20,
      "maximum": 1000,
      "description": "Candles to analyze (default 200) NOTE: values above the maximum are CLAMPED, not rejected — limit:5000 returns 200 with 1000 candles. Values below the minimum are a 400."
    },
    "market": {
      "type": "string",
      "enum": [
        "crypto",
        "stock"
      ],
      "description": "Asset-class hint. Omitted = inferred from the symbol, which is exactly where an ambiguous ticker goes wrong: bare \"BTC\" is a real US security, not Bitcoin. Send market:'crypto' with BTC/USDT, or market:'stock' to force the equity leg. Any other value is a 400."
    }
  }
}