{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/hydrafetch-com/json-schema/hydrafetch-com-search-request-dto-schema.json",
  "title": "SearchRequestDto",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/hydrafetch-com-search-api-openapi.yml#/components/schemas/SearchRequestDto",
  "type": "object",
  "properties": {
    "query": {
      "type": "string",
      "maxLength": 500,
      "description": "What to search the web for."
    },
    "limit": {
      "type": "number",
      "minimum": 1,
      "maximum": 15,
      "description": "How many ranked results to return. Omit for the default."
    },
    "scrapeResults": {
      "type": "boolean",
      "description": "When true, each result also comes back with its page fetched and returned as clean data, at 1 additional credit per page scraped. Defaults to false, which returns just the ranked title, url and snippet for the flat search credit."
    },
    "scrapeOptions": {
      "$ref": "#/$defs/ScrapeOptionsDto"
    },
    "timeRange": {
      "type": "string",
      "enum": [
        "day",
        "week",
        "month",
        "year"
      ],
      "description": "Restrict results to a recency window relative to now."
    },
    "country": {
      "type": "string",
      "description": "ISO 3166 alpha-2 country code to bias results toward a region."
    },
    "includeDomains": {
      "maxItems": 15,
      "description": "Only return results from these domains.",
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "excludeDomains": {
      "maxItems": 15,
      "description": "Drop results from these domains.",
      "type": "array",
      "items": {
        "type": "string"
      }
    }
  },
  "required": [
    "query"
  ],
  "$defs": {
    "OptLocationDto": {
      "type": "object",
      "properties": {
        "country": {
          "type": "string",
          "description": "ISO 3166 alpha-2 country to fetch as if from."
        },
        "languages": {
          "description": "Preferred content languages, most-preferred first.",
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "ScrapeOptionsDto": {
      "type": "object",
      "properties": {
        "formats": {
          "type": "array",
          "description": "What to return per page. Omit for Markdown only.",
          "items": {
            "type": "string",
            "enum": [
              "markdown",
              "html",
              "rawHtml",
              "links",
              "structured"
            ]
          }
        },
        "onlyMainContent": {
          "type": "boolean",
          "description": "Return only the main content, dropping boilerplate. Default true."
        },
        "includeTags": {
          "maxItems": 50,
          "description": "CSS selectors to keep.",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "excludeTags": {
          "maxItems": 50,
          "description": "CSS selectors to strip before extraction.",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "removeBase64Images": {
          "type": "boolean",
          "description": "Strip inline base64 images. Default true."
        },
        "blockAds": {
          "type": "boolean",
          "description": "Remove common ad and tracking elements. Default true."
        },
        "includeLinks": {
          "type": "boolean",
          "description": "Keep inline links in the markdown. By default links are kept wherever the page text carries them. Set true to keep them on every page, or false for the densest prose."
        },
        "waitFor": {
          "type": "number",
          "minimum": 0,
          "maximum": 30000,
          "description": "Extra milliseconds to let the page settle before capture."
        },
        "timeout": {
          "type": "number",
          "minimum": 1000,
          "maximum": 100000,
          "description": "Per-page time budget, in milliseconds."
        },
        "location": {
          "$ref": "#/$defs/OptLocationDto"
        },
        "headers": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "Extra request headers to send when fetching each page."
        },
        "preferStructure": {
          "type": "boolean",
          "description": "Preserve document structure over prose density. Default off."
        },
        "maxAge": {
          "type": "number",
          "minimum": 0,
          "maximum": 604800000,
          "description": "Serve a page from cache if younger than this many milliseconds."
        }
      }
    }
  }
}