{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/jenriks-com/json-schema/jenriks-com-nlweb-answer-schema.json",
  "title": "NlwebAnswer",
  "description": "NLWeb 0.55 non-streaming response: an answer with results, or a failure (HTTP 200) with an error object.",
  "x-generated": "2026-11-13",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/jenriks-com-openapi.json#/components/schemas/NlwebAnswer",
  "type": "object",
  "required": [
    "_meta"
  ],
  "properties": {
    "_meta": {
      "type": "object",
      "required": [
        "response_type",
        "version"
      ],
      "properties": {
        "response_type": {
          "type": "string",
          "enum": [
            "answer",
            "failure"
          ]
        },
        "version": {
          "type": "string",
          "const": "0.55"
        },
        "response_format": {
          "type": "string",
          "enum": [
            "conversational_search"
          ]
        },
        "site": {
          "type": "string"
        },
        "mode": {
          "type": "string"
        },
        "processing_time_ms": {
          "type": "integer",
          "minimum": 0
        }
      }
    },
    "query_id": {
      "type": "string"
    },
    "results": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "@type",
          "name",
          "url"
        ],
        "properties": {
          "@type": {
            "type": "string",
            "const": "Photograph"
          },
          "@context": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "description": {
            "type": "string"
          },
          "image": {
            "type": "string",
            "format": "uri"
          },
          "thumbnailUrl": {
            "type": "string",
            "format": "uri"
          },
          "datePublished": {
            "type": "string",
            "format": "date"
          },
          "creator": {
            "type": "object",
            "properties": {
              "@type": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            }
          },
          "contentLocation": {
            "type": "object",
            "properties": {
              "@type": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            }
          },
          "keywords": {
            "type": "string"
          },
          "site": {
            "type": "string"
          },
          "score": {
            "description": "100 for the best match, descending by rank",
            "type": "integer",
            "minimum": 1,
            "maximum": 100
          },
          "schema_object": {
            "type": "object"
          }
        }
      }
    },
    "error": {
      "type": "object",
      "required": [
        "code",
        "message"
      ],
      "description": "Present when _meta.response_type is failure",
      "properties": {
        "code": {
          "type": "string",
          "enum": [
            "NO_RESULTS",
            "INVALID_QUERY",
            "INTERNAL_ERROR"
          ]
        },
        "message": {
          "type": "string"
        }
      }
    }
  }
}