{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/tooltrace-io/json-schema/tooltrace-io-extract-response-schema.json",
  "title": "ExtractResponse",
  "x-generated": "2026-11-27",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/tooltrace-io-openapi.json#/components/schemas/ExtractResponse",
  "properties": {
    "fetch": {
      "$ref": "#/$defs/FetchInfo"
    },
    "mode": {
      "type": "string",
      "enum": [
        "structured",
        "raw",
        "both"
      ],
      "title": "Mode"
    },
    "markdown": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Markdown"
    },
    "text": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Text"
    },
    "metadata": {
      "anyOf": [
        {
          "$ref": "#/$defs/Metadata"
        },
        {
          "type": "null"
        }
      ]
    },
    "links": {
      "anyOf": [
        {
          "items": {
            "$ref": "#/$defs/Link"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Links"
    },
    "schema": {
      "anyOf": [
        {
          "items": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "items": {},
                "type": "array"
              },
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ]
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Schema"
    },
    "sections": {
      "anyOf": [
        {
          "items": {
            "$ref": "#/$defs/ContentSection"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Sections"
    },
    "raw_html": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Raw Html"
    },
    "word_count": {
      "type": "integer",
      "title": "Word Count"
    },
    "content_hash": {
      "type": "string",
      "title": "Content Hash"
    }
  },
  "type": "object",
  "required": [
    "fetch",
    "mode",
    "word_count",
    "content_hash"
  ],
  "$defs": {
    "ContentSection": {
      "properties": {
        "id": {
          "type": "string",
          "title": "Id"
        },
        "heading": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Heading"
        },
        "level": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Level"
        },
        "text": {
          "type": "string",
          "title": "Text"
        }
      },
      "type": "object",
      "required": [
        "id",
        "text"
      ],
      "title": "ContentSection"
    },
    "FetchInfo": {
      "properties": {
        "requested_url": {
          "type": "string",
          "title": "Requested Url"
        },
        "final_url": {
          "type": "string",
          "title": "Final Url"
        },
        "status_code": {
          "type": "integer",
          "title": "Status Code"
        },
        "content_type": {
          "type": "string",
          "title": "Content Type"
        },
        "bytes_downloaded": {
          "type": "integer",
          "title": "Bytes Downloaded"
        },
        "elapsed_ms": {
          "type": "integer",
          "title": "Elapsed Ms"
        },
        "redirects": {
          "type": "integer",
          "title": "Redirects"
        },
        "cached": {
          "type": "boolean",
          "title": "Cached",
          "default": false
        },
        "render_method": {
          "type": "string",
          "enum": [
            "static",
            "browser",
            "static_fallback"
          ],
          "title": "Render Method",
          "default": "static"
        },
        "render_reason": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Render Reason"
        },
        "credits_used": {
          "type": "integer",
          "minimum": 0.0,
          "title": "Credits Used",
          "default": 1
        },
        "render_metrics": {
          "anyOf": [
            {
              "$ref": "#/$defs/RenderMetrics"
            },
            {
              "type": "null"
            }
          ]
        },
        "warnings": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Warnings"
        },
        "access_status": {
          "type": "string",
          "enum": [
            "normal",
            "blocked",
            "login_required",
            "rate_limited"
          ],
          "title": "Access Status",
          "default": "normal"
        },
        "block_reason": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Block Reason"
        },
        "challenge_provider": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Challenge Provider"
        }
      },
      "type": "object",
      "required": [
        "requested_url",
        "final_url",
        "status_code",
        "content_type",
        "bytes_downloaded",
        "elapsed_ms",
        "redirects"
      ],
      "title": "FetchInfo"
    },
    "Link": {
      "properties": {
        "url": {
          "type": "string",
          "title": "Url"
        },
        "text": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Text"
        },
        "kind": {
          "type": "string",
          "enum": [
            "internal",
            "external"
          ],
          "title": "Kind"
        },
        "rel": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Rel"
        },
        "nofollow": {
          "type": "boolean",
          "title": "Nofollow",
          "default": false
        },
        "sponsored": {
          "type": "boolean",
          "title": "Sponsored",
          "default": false
        },
        "ugc": {
          "type": "boolean",
          "title": "Ugc",
          "default": false
        }
      },
      "type": "object",
      "required": [
        "url",
        "kind"
      ],
      "title": "Link"
    },
    "Metadata": {
      "properties": {
        "title": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Title"
        },
        "description": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Description"
        },
        "canonical_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Canonical Url"
        },
        "language": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Language"
        },
        "author": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Author"
        },
        "published_at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Published At"
        },
        "favicon_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Favicon Url"
        },
        "open_graph": {
          "additionalProperties": {
            "type": "string"
          },
          "type": "object",
          "title": "Open Graph"
        },
        "twitter": {
          "additionalProperties": {
            "type": "string"
          },
          "type": "object",
          "title": "Twitter"
        }
      },
      "type": "object",
      "title": "Metadata"
    },
    "RenderMetrics": {
      "properties": {
        "stable": {
          "type": "boolean",
          "title": "Stable"
        },
        "stability_wait_ms": {
          "type": "integer",
          "minimum": 0.0,
          "title": "Stability Wait Ms"
        },
        "stability_checks": {
          "type": "integer",
          "minimum": 0.0,
          "title": "Stability Checks"
        },
        "visible_words": {
          "type": "integer",
          "minimum": 0.0,
          "title": "Visible Words"
        },
        "dom_nodes": {
          "type": "integer",
          "minimum": 0.0,
          "title": "Dom Nodes"
        },
        "network_requests": {
          "type": "integer",
          "minimum": 0.0,
          "title": "Network Requests"
        },
        "network_bytes": {
          "type": "integer",
          "minimum": 0.0,
          "title": "Network Bytes"
        },
        "blocked_requests": {
          "type": "integer",
          "minimum": 0.0,
          "title": "Blocked Requests"
        },
        "js_heap_used_mb": {
          "anyOf": [
            {
              "type": "number",
              "minimum": 0.0
            },
            {
              "type": "null"
            }
          ],
          "title": "Js Heap Used Mb"
        }
      },
      "type": "object",
      "required": [
        "stable",
        "stability_wait_ms",
        "stability_checks",
        "visible_words",
        "dom_nodes",
        "network_requests",
        "network_bytes",
        "blocked_requests"
      ],
      "title": "RenderMetrics"
    }
  }
}