{
  "openapi": "3.1.0",
  "jsonSchemaDialect": "https://spec.openapis.org/oas/3.1/dialect/base",
  "info": {
    "title": "CameraRisk public API",
    "version": "1.0.0",
    "summary": "Published vulnerability records for camera and video-security models.",
    "description": "Read-only lookups of the public vulnerability record of camera, recorder and video-software models: which published vulnerabilities name a model, and which of them apply to a firmware version.\n\nEvery check is a public record lookup: CameraRisk compares a model with published vulnerability records and never connects to or tests a device. Each security check carries this note (`check_type_note`) and its limitations. No endpoint accepts a host, address or URL to contact.\n\nNo key is needed. Limits: 60 requests a minute per network; GET answers are cached for 5 minutes and allow cross-origin reads.\n\nSources: the National Vulnerability Database (NIST), the CISA Known Exploited Vulnerabilities catalog and the FIRST Exploit Prediction Scoring System (EPSS). CameraRisk matches their records to camera models and firmware versions. This product uses data from the NVD API but is not endorsed or certified by the NVD.",
    "contact": {
      "url": "https://camerarisk.com/developers/"
    }
  },
  "servers": [
    {
      "url": "https://camerarisk.com/api/v1"
    }
  ],
  "externalDocs": {
    "url": "https://camerarisk.com/developers/",
    "description": "Guide, examples, limits and the MCP server"
  },
  "paths": {
    "/vendors": {
      "get": {
        "operationId": "listVendors",
        "summary": "List the manufacturers in the database",
        "description": "Every manufacturer with at least one model named in a published vulnerability record, with counts of its models and records. Not paginated (under 100 entries).",
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "`public, s-maxage=300`"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VendorList"
                }
              }
            }
          },
          "400": {
            "description": "`invalid_parameter`: A path or query parameter is missing, malformed, repeated or unknown. The message names it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: There is no endpoint at this address.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`: More than 60 requests a minute from one network. Wait for the number of seconds in Retry-After.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "`server_error`: Something failed on our side. Try again in a minute.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "Shell",
            "label": "Every manufacturer",
            "source": "curl 'https://camerarisk.com/api/v1/vendors'"
          }
        ]
      }
    },
    "/models/search": {
      "get": {
        "operationId": "searchModels",
        "summary": "Find camera models by model number or manufacturer",
        "description": "Ranks exact model numbers first, then model numbers that start with the query, then manufacturer and model together, then models containing every word. Case, spaces, dashes and other punctuation are ignored, as on the website search (\"rlc410w\" finds RLC-410W). Give `q`, `vendor` or both.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "Free text: a model number, a manufacturer, or both, e.g. `reolink 410`.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100,
              "pattern": "^[^\\u0000-\\u001f\\u007f]+$"
            }
          },
          {
            "name": "vendor",
            "in": "query",
            "required": false,
            "description": "Manufacturer id, e.g. `hikvision`. Case-insensitive.",
            "schema": {
              "type": "string",
              "pattern": "^[a-z0-9][a-z0-9-]{0,39}$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Results per page (1–50, default 20).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 20
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "The `meta.next_cursor` of the previous page, unchanged.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200,
              "pattern": "^[A-Za-z0-9_-]+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "`public, s-maxage=300`"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ModelList"
                }
              }
            }
          },
          "400": {
            "description": "`invalid_parameter`: A path or query parameter is missing, malformed, repeated or unknown. The message names it. `invalid_cursor`: The cursor is not one this search returned (it is bound to the query that produced it).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: There is no endpoint at this address.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`: More than 60 requests a minute from one network. Wait for the number of seconds in Retry-After.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "`server_error`: Something failed on our side. Try again in a minute.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "Shell",
            "label": "Search by model number",
            "source": "curl 'https://camerarisk.com/api/v1/models/search?q=rlc-410w'"
          },
          {
            "lang": "Shell",
            "label": "One manufacturer’s models, five at a time",
            "source": "curl 'https://camerarisk.com/api/v1/models/search?vendor=hikvision&limit=5'"
          }
        ]
      }
    },
    "/models/{vendor}/{slug}": {
      "get": {
        "operationId": "getModel",
        "summary": "The public record of one model",
        "description": "The model record (schema `camerarisk.model/1`): every published vulnerability that names the model, with the version rules the record states, CVSS, CISA KEV and FIRST EPSS data. The website and its browser checker read the same record.",
        "parameters": [
          {
            "name": "vendor",
            "in": "path",
            "required": true,
            "description": "Manufacturer id, e.g. `hikvision`. Case-insensitive.",
            "schema": {
              "type": "string",
              "pattern": "^[a-z0-9][a-z0-9-]{0,39}$"
            }
          },
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "Model slug, e.g. `rlc-410w`. Case-insensitive.",
            "schema": {
              "type": "string",
              "pattern": "^[a-z0-9][a-z0-9._-]{0,99}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "`public, s-maxage=300`"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ModelRecord"
                }
              }
            }
          },
          "400": {
            "description": "`invalid_parameter`: A path or query parameter is missing, malformed, repeated or unknown. The message names it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`model_not_found`: No model has this id. Search for it with /models/search. `not_found`: There is no endpoint at this address.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`: More than 60 requests a minute from one network. Wait for the number of seconds in Retry-After.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "`server_error`: Something failed on our side. Try again in a minute.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "Shell",
            "label": "The Reolink RLC-410W",
            "source": "curl 'https://camerarisk.com/api/v1/models/reolink/rlc-410w'"
          }
        ]
      }
    },
    "/models/{vendor}/{slug}/vulnerabilities": {
      "get": {
        "operationId": "getModelVulnerabilities",
        "summary": "Which published vulnerabilities apply to a model, for a firmware version",
        "description": "A public record lookup: each recorded vulnerability classified for the firmware version (if given) as affected, no version limit recorded, version not matched, or outside the recorded versions, with the reason, and a verdict for the whole model. It never connects to or tests a device.",
        "parameters": [
          {
            "name": "vendor",
            "in": "path",
            "required": true,
            "description": "Manufacturer id, e.g. `hikvision`. Case-insensitive.",
            "schema": {
              "type": "string",
              "pattern": "^[a-z0-9][a-z0-9-]{0,39}$"
            }
          },
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "Model slug, e.g. `rlc-410w`. Case-insensitive.",
            "schema": {
              "type": "string",
              "pattern": "^[a-z0-9][a-z0-9._-]{0,99}$"
            }
          },
          {
            "name": "firmware",
            "in": "query",
            "required": false,
            "description": "The firmware version as the camera or its label shows it, e.g. `V5.5.0 build 170725`.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "pattern": "^[^\\u0000-\\u001f\\u007f]+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "`public, s-maxage=300`"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SecurityCheck"
                }
              }
            }
          },
          "400": {
            "description": "`invalid_parameter`: A path or query parameter is missing, malformed, repeated or unknown. The message names it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`model_not_found`: No model has this id. Search for it with /models/search. `not_found`: There is no endpoint at this address.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`: More than 60 requests a minute from one network. Wait for the number of seconds in Retry-After.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "`server_error`: Something failed on our side. Try again in a minute.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "Shell",
            "label": "With a firmware version",
            "source": "curl 'https://camerarisk.com/api/v1/models/reolink/rlc-410w/vulnerabilities?firmware=3.0.0.136_20121102'"
          }
        ]
      }
    },
    "/cves/{id}": {
      "get": {
        "operationId": "getCve",
        "summary": "One vulnerability record and the models it names",
        "description": "The record as published by NVD, with CISA KEV and FIRST EPSS data where they exist, its references, and every model in the database it names, with the version rules for each.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "A CVE id, e.g. `CVE-2021-36260`. Case-insensitive.",
            "schema": {
              "type": "string",
              "pattern": "^[Cc][Vv][Ee]-[0-9]{4}-[0-9]{4,7}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "`public, s-maxage=300`"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Cve"
                }
              }
            }
          },
          "400": {
            "description": "`invalid_parameter`: A path or query parameter is missing, malformed, repeated or unknown. The message names it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`cve_not_found`: CameraRisk holds no record for this CVE id: it covers only vulnerabilities that name a video-security product. `not_found`: There is no endpoint at this address.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`: More than 60 requests a minute from one network. Wait for the number of seconds in Retry-After.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "`server_error`: Something failed on our side. Try again in a minute.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "Shell",
            "label": "A record in the CISA KEV catalog",
            "source": "curl 'https://camerarisk.com/api/v1/cves/CVE-2021-36260'"
          }
        ]
      }
    },
    "/security-checks": {
      "post": {
        "operationId": "createSecurityCheck",
        "summary": "Check a model, by id or by name, against the published records",
        "description": "The same lookup as /models/{vendor}/{slug}/vulnerabilities, for callers that hold a name rather than an id. With `query`, a single clear match (an exact model number, or a unique prefix) is checked; otherwise the verdict is `not_recognized` and `candidates` lists the closest models. Nothing is stored. Browsers should use the GET endpoint, which allows cross-origin reads; this one does not.",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SecurityCheckRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SecurityCheck"
                }
              }
            }
          },
          "400": {
            "description": "`invalid_parameter`: A path or query parameter is missing, malformed, repeated or unknown. The message names it. `invalid_body`: The JSON body does not match the documented schema. The message says what to change. `invalid_json`: The body is not valid JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`model_not_found`: No model has this id. Search for it with /models/search. `not_found`: There is no endpoint at this address.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "`body_too_large`: The body is over 2048 bytes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "`unsupported_media_type`: Send the body as application/json.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`: More than 60 requests a minute from one network. Wait for the number of seconds in Retry-After.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "`server_error`: Something failed on our side. Try again in a minute.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "Shell",
            "label": "By model id, with firmware",
            "source": "curl -X POST 'https://camerarisk.com/api/v1/security-checks' -H 'content-type: application/json' -d '{\"model_id\":\"reolink/rlc-410w\",\"firmware_version\":\"3.0.0.136_20121102\"}'"
          },
          {
            "lang": "Shell",
            "label": "By name",
            "source": "curl -X POST 'https://camerarisk.com/api/v1/security-checks' -H 'content-type: application/json' -d '{\"query\":\"reolink rlc-410w\"}'"
          }
        ]
      }
    },
    "/status": {
      "get": {
        "operationId": "getStatus",
        "summary": "How current each data source is",
        "description": "For NVD, CISA KEV and FIRST EPSS: the last successful refresh and whether it is stale (no success for more than 48 hours).",
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "`public, s-maxage=300`"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Status"
                }
              }
            }
          },
          "400": {
            "description": "`invalid_parameter`: A path or query parameter is missing, malformed, repeated or unknown. The message names it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: There is no endpoint at this address.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`: More than 60 requests a minute from one network. Wait for the number of seconds in Retry-After.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "`server_error`: Something failed on our side. Try again in a minute.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "Shell",
            "label": "Source freshness",
            "source": "curl 'https://camerarisk.com/api/v1/status'"
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "description": "Stable, machine-readable.",
                "enum": [
                  "invalid_parameter",
                  "invalid_cursor",
                  "invalid_body",
                  "invalid_json",
                  "model_not_found",
                  "cve_not_found",
                  "not_found",
                  "method_not_allowed",
                  "body_too_large",
                  "unsupported_media_type",
                  "rate_limited",
                  "server_error"
                ]
              },
              "message": {
                "type": "string",
                "description": "A sentence a person can act on."
              }
            },
            "required": [
              "code",
              "message"
            ]
          }
        },
        "required": [
          "error"
        ]
      },
      "Source": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "enum": [
              "nvd",
              "kev",
              "epss"
            ]
          },
          "name": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "updated_at": {
            "type": [
              "string",
              "null"
            ],
            "description": "When CameraRisk last refreshed this source successfully (ISO 8601, UTC)."
          },
          "version": {
            "type": [
              "string",
              "null"
            ],
            "description": "CISA KEV catalog version."
          },
          "as_of": {
            "type": [
              "string",
              "null"
            ],
            "description": "FIRST EPSS score date."
          }
        },
        "required": [
          "id",
          "name",
          "url",
          "updated_at"
        ]
      },
      "Meta": {
        "type": "object",
        "properties": {
          "data_updated_at": {
            "type": [
              "string",
              "null"
            ],
            "description": "The least current of the sources: everything in the answer is at least this fresh."
          },
          "sources": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Source"
            },
            "description": "Where the data comes from, with attribution links."
          },
          "docs": {
            "type": "string",
            "description": "These docs.",
            "format": "uri"
          },
          "total": {
            "type": "integer",
            "minimum": 0,
            "description": "Search only: how many models match."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Search only: pass it as `cursor` for the next page; null on the last page."
          }
        },
        "required": [
          "data_updated_at",
          "sources",
          "docs"
        ]
      },
      "VendorRef": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name"
        ]
      },
      "Vendor": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "models": {
            "type": "integer",
            "minimum": 0,
            "description": "Models named in at least one record."
          },
          "vulnerabilities": {
            "type": "integer",
            "minimum": 0,
            "description": "Distinct published vulnerabilities naming any of its models."
          },
          "kev": {
            "type": "integer",
            "minimum": 0,
            "description": "Of those, how many are in the CISA KEV catalog."
          },
          "url": {
            "type": [
              "string",
              "null"
            ],
            "description": "The manufacturer page on the website. Null for what the hourly update added since the last site build: its page appears at the next build.",
            "format": "uri"
          },
          "models_url": {
            "type": "string",
            "description": "Its models in this API.",
            "format": "uri"
          }
        },
        "required": [
          "id",
          "name",
          "models",
          "vulnerabilities",
          "kev",
          "url",
          "models_url"
        ]
      },
      "VendorList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Vendor"
            }
          },
          "meta": {
            "$ref": "#/components/schemas/Meta"
          }
        },
        "required": [
          "data",
          "meta"
        ]
      },
      "ModelSummary": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "`<vendor>/<slug>`: stable; the path of the model page and of /models/{vendor}/{slug}."
          },
          "label": {
            "type": "string",
            "description": "How the website names the model, e.g. \"Reolink RLC-410W\"."
          },
          "vendor": {
            "$ref": "#/components/schemas/VendorRef"
          },
          "model": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "device_type": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "As the record states it; null when it does not say."
              }
            },
            "required": [
              "name",
              "device_type"
            ]
          },
          "vulnerabilities": {
            "type": "integer",
            "minimum": 0,
            "description": "Published vulnerabilities naming the model."
          },
          "kev": {
            "type": "integer",
            "minimum": 0,
            "description": "Of those, in the CISA KEV catalog."
          },
          "url": {
            "type": [
              "string",
              "null"
            ],
            "description": "The model page on the website. Null for what the hourly update added since the last site build: its page appears at the next build.",
            "format": "uri"
          },
          "api_url": {
            "type": "string",
            "description": "Its record in this API.",
            "format": "uri"
          },
          "match": {
            "type": "string",
            "description": "Why it matched, strongest first.",
            "enum": [
              "exact",
              "model_prefix",
              "prefix",
              "all_words",
              "contains",
              "vendor"
            ]
          }
        },
        "required": [
          "id",
          "label",
          "vendor",
          "model",
          "vulnerabilities",
          "kev",
          "url",
          "api_url",
          "match"
        ]
      },
      "ModelList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ModelSummary"
            }
          },
          "meta": {
            "$ref": "#/components/schemas/Meta"
          }
        },
        "required": [
          "data",
          "meta"
        ]
      },
      "Rule": {
        "type": "object",
        "description": "A version rule as the record states it: `any`, an `exact` version, or bounds (si ≥, se >, ei ≤, ee <). `via` names the firmware product the versions were recorded under, when it is not the model itself.",
        "properties": {
          "any": {
            "type": "boolean"
          },
          "exact": {
            "type": "string"
          },
          "si": {
            "type": "string"
          },
          "se": {
            "type": "string"
          },
          "ei": {
            "type": "string"
          },
          "ee": {
            "type": "string"
          },
          "via": {
            "type": "string"
          }
        }
      },
      "Cvss": {
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "score": {
            "type": [
              "number",
              "null"
            ]
          },
          "severity": {
            "type": [
              "string",
              "null"
            ]
          },
          "version": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "score",
          "severity",
          "version"
        ]
      },
      "Kev": {
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "date_added": {
            "type": [
              "string",
              "null"
            ]
          },
          "due_date": {
            "type": [
              "string",
              "null"
            ]
          },
          "ransomware": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "date_added",
          "due_date",
          "ransomware"
        ],
        "description": "CISA KEV: exploitation seen somewhere in the world, not on your device."
      },
      "Epss": {
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "score": {
            "type": [
              "number",
              "null"
            ]
          },
          "percentile": {
            "type": [
              "number",
              "null"
            ]
          },
          "date": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "score",
          "percentile",
          "date"
        ],
        "description": "FIRST EPSS: a probability of exploitation attempts across the internet in the next 30 days."
      },
      "ModelRecord": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "schema": {
                "type": "string",
                "const": "camerarisk.model/1"
              },
              "id": {
                "type": "string"
              },
              "product_id": {
                "type": "string",
                "description": "The key the version rules use (`<vendor>/<CPE product>`)."
              },
              "url": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "The model page on the website. Null for what the hourly update added since the last site build: its page appears at the next build.",
                "format": "uri"
              },
              "vendor": {
                "$ref": "#/components/schemas/VendorRef"
              },
              "model": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "device_type": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "required": [
                  "name",
                  "device_type"
                ]
              },
              "vulnerabilities": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "cve_id": {
                      "type": "string"
                    },
                    "published": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Date published (YYYY-MM-DD)."
                    },
                    "summary": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "The first sentence of the NVD description."
                    },
                    "role": {
                      "type": "string",
                      "description": "`platform`: the model is named as the device an affected component runs on.",
                      "enum": [
                        "vulnerable",
                        "platform"
                      ]
                    },
                    "rules": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Rule"
                      }
                    },
                    "cvss": {
                      "$ref": "#/components/schemas/Cvss"
                    },
                    "kev": {
                      "$ref": "#/components/schemas/Kev"
                    },
                    "epss": {
                      "$ref": "#/components/schemas/Epss"
                    },
                    "url": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "The record’s page on the website. Null for what the hourly update added since the last site build: its page appears at the next build.",
                      "format": "uri"
                    },
                    "advisory_url": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "The vendor’s advisory or fix for this record: the first reference NVD classes as the vendor’s, else the first patch; null when it lists neither.",
                      "format": "uri"
                    }
                  },
                  "required": [
                    "cve_id",
                    "published",
                    "summary",
                    "role",
                    "rules",
                    "cvss",
                    "kev",
                    "epss",
                    "url",
                    "advisory_url"
                  ]
                },
                "description": "Newest first."
              },
              "data_updated_at": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "sources": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Source"
                }
              }
            },
            "required": [
              "schema",
              "id",
              "product_id",
              "url",
              "vendor",
              "model",
              "vulnerabilities",
              "data_updated_at",
              "sources"
            ]
          },
          "meta": {
            "$ref": "#/components/schemas/Meta"
          }
        },
        "required": [
          "data",
          "meta"
        ]
      },
      "Limitation": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "enum": [
              "not_a_device_test",
              "public_records_only",
              "naming_varies",
              "version_data_incomplete",
              "epss_is_probability",
              "kev_is_global"
            ]
          },
          "text": {
            "type": "string"
          }
        },
        "required": [
          "code",
          "text"
        ]
      },
      "CheckedVulnerability": {
        "type": "object",
        "properties": {
          "cve_id": {
            "type": "string"
          },
          "state": {
            "type": "string",
            "description": "affected: the record lists your version or a range containing it · all_versions: no version limit recorded · unknown: your version could not be compared · outside_recorded: your version is outside every recorded version (records can be incomplete).",
            "enum": [
              "affected",
              "all_versions",
              "unknown",
              "outside_recorded"
            ]
          },
          "state_label": {
            "type": "string"
          },
          "state_explanation": {
            "type": "string"
          },
          "reason": {
            "type": "string",
            "description": "Why the state is what it is.",
            "enum": [
              "exact_match",
              "in_range",
              "unbounded",
              "outside_all",
              "not_comparable",
              "no_firmware",
              "unreadable_firmware",
              "no_version_data"
            ]
          },
          "reason_text": {
            "type": "string"
          },
          "role": {
            "type": "string",
            "enum": [
              "vulnerable",
              "platform"
            ]
          },
          "role_note": {
            "type": [
              "string",
              "null"
            ]
          },
          "recorded": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Rule"
            },
            "description": "The version rules the record states."
          },
          "recorded_text": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The same rules as text, e.g. \"≤ 1.0.227\"."
          },
          "published": {
            "type": [
              "string",
              "null"
            ]
          },
          "summary": {
            "type": [
              "string",
              "null"
            ]
          },
          "cvss": {
            "$ref": "#/components/schemas/Cvss"
          },
          "kev": {
            "$ref": "#/components/schemas/Kev"
          },
          "epss": {
            "$ref": "#/components/schemas/Epss"
          },
          "url": {
            "type": [
              "string",
              "null"
            ],
            "description": "The record’s page on the website. Null for what the hourly update added since the last site build: its page appears at the next build.",
            "format": "uri"
          },
          "nvd_url": {
            "type": "string",
            "format": "uri"
          },
          "advisory_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "The vendor’s advisory or fix for this record: the first reference NVD classes as the vendor’s, else the first patch; null when it lists neither.",
            "format": "uri"
          }
        },
        "required": [
          "cve_id",
          "state",
          "state_label",
          "state_explanation",
          "reason",
          "reason_text",
          "role",
          "role_note",
          "recorded",
          "recorded_text",
          "published",
          "summary",
          "cvss",
          "kev",
          "epss",
          "url",
          "nvd_url",
          "advisory_url"
        ]
      },
      "SecurityCheck": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "check_type": {
                "type": "string",
                "const": "public_record_lookup"
              },
              "check_type_note": {
                "type": "string",
                "const": "We compared this model with published vulnerability records. We did not connect to or test your camera."
              },
              "model": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/CheckedModel"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "verdict": {
                "type": "string",
                "description": "Never a safe/unsafe call: the strongest statement the public records support.",
                "enum": [
                  "known_affecting",
                  "known_unconfirmed",
                  "none_recorded",
                  "not_recognized"
                ]
              },
              "verdict_text": {
                "type": "object",
                "properties": {
                  "title": {
                    "type": "string"
                  },
                  "summary": {
                    "type": "string"
                  },
                  "next_steps": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "required": [
                  "title",
                  "summary",
                  "next_steps"
                ]
              },
              "firmware": {
                "type": "object",
                "properties": {
                  "provided": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "As given, trimmed."
                  },
                  "normalized": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "The version the comparison used; null when none could be read."
                  }
                },
                "required": [
                  "provided",
                  "normalized"
                ]
              },
              "counts": {
                "type": "object",
                "properties": {
                  "affected": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "all_versions": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "outside_recorded": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "unknown": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "kev": {
                    "type": "integer",
                    "minimum": 0
                  }
                },
                "required": [
                  "affected",
                  "all_versions",
                  "outside_recorded",
                  "unknown",
                  "kev"
                ]
              },
              "vulnerabilities": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/CheckedVulnerability"
                },
                "description": "Most actionable first: state, then CISA KEV, then severity."
              },
              "limitations": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Limitation"
                },
                "description": "Show these with the result."
              },
              "data_updated_at": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "candidates": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ModelSummary"
                },
                "description": "Only when a `query` did not identify one model: the closest models, to check by id."
              }
            },
            "required": [
              "check_type",
              "check_type_note",
              "model",
              "verdict",
              "verdict_text",
              "firmware",
              "counts",
              "vulnerabilities",
              "limitations",
              "data_updated_at"
            ]
          },
          "meta": {
            "$ref": "#/components/schemas/Meta"
          }
        },
        "required": [
          "data",
          "meta"
        ]
      },
      "CheckedModel": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "vendor": {
            "$ref": "#/components/schemas/VendorRef"
          },
          "model": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "device_type": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "name",
              "device_type"
            ]
          },
          "url": {
            "type": [
              "string",
              "null"
            ],
            "description": "The model page on the website. Null for what the hourly update added since the last site build: its page appears at the next build.",
            "format": "uri"
          }
        },
        "required": [
          "id",
          "label",
          "vendor",
          "model",
          "url"
        ]
      },
      "SecurityCheckRequest": {
        "type": "object",
        "description": "Exactly one of `model_id` and `query`.",
        "properties": {
          "model_id": {
            "type": "string",
            "pattern": "^[a-z0-9][a-z0-9-]{0,39}/[a-z0-9][a-z0-9._-]{0,99}$",
            "description": "Model id, `<vendor>/<slug>` (the path of the model page), e.g. `reolink/rlc-410w`. Case-insensitive."
          },
          "query": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "pattern": "^[^\\u0000-\\u001f\\u007f]+$",
            "description": "Free text: a model number, a manufacturer, or both, e.g. `reolink 410`."
          },
          "firmware_version": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "pattern": "^[^\\u0000-\\u001f\\u007f]+$",
            "description": "The firmware version as the camera or its label shows it, e.g. `V5.5.0 build 170725`."
          }
        },
        "additionalProperties": false,
        "oneOf": [
          {
            "required": [
              "model_id"
            ]
          },
          {
            "required": [
              "query"
            ]
          }
        ]
      },
      "Cve": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "status": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "NVD status, e.g. Analyzed, Modified, Rejected."
              },
              "published": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "YYYY-MM-DD"
              },
              "last_modified": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "YYYY-MM-DD"
              },
              "summary": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "description": {
                "type": "string"
              },
              "cvss": {
                "type": [
                  "object",
                  "null"
                ],
                "properties": {
                  "score": {
                    "type": [
                      "number",
                      "null"
                    ]
                  },
                  "severity": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "version": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "vector": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "required": [
                  "score",
                  "severity",
                  "version",
                  "vector"
                ]
              },
              "cwes": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "kev": {
                "type": [
                  "object",
                  "null"
                ],
                "properties": {
                  "date_added": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "due_date": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "ransomware": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "required_action": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "CISA’s required action for US federal agencies."
                  }
                },
                "required": [
                  "date_added",
                  "due_date",
                  "ransomware",
                  "required_action"
                ]
              },
              "epss": {
                "$ref": "#/components/schemas/Epss"
              },
              "references": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "url": {
                      "type": "string"
                    },
                    "kind": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "url",
                    "kind"
                  ]
                }
              },
              "models": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "label": {
                      "type": "string"
                    },
                    "vendor": {
                      "$ref": "#/components/schemas/VendorRef"
                    },
                    "name": {
                      "type": "string"
                    },
                    "role": {
                      "type": "string",
                      "enum": [
                        "vulnerable",
                        "platform"
                      ]
                    },
                    "recorded": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Rule"
                      }
                    },
                    "recorded_text": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "url": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "The model page on the website. Null for what the hourly update added since the last site build: its page appears at the next build.",
                      "format": "uri"
                    }
                  },
                  "required": [
                    "id",
                    "label",
                    "vendor",
                    "name",
                    "role",
                    "recorded",
                    "recorded_text",
                    "url"
                  ]
                },
                "description": "Every model in the database the record names."
              },
              "url": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "The record’s page on the website. Null for what the hourly update added since the last site build: its page appears at the next build.",
                "format": "uri"
              },
              "nvd_url": {
                "type": "string",
                "format": "uri"
              },
              "limitations": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Limitation"
                }
              }
            },
            "required": [
              "id",
              "status",
              "published",
              "last_modified",
              "summary",
              "description",
              "cvss",
              "cwes",
              "kev",
              "epss",
              "references",
              "models",
              "url",
              "nvd_url",
              "limitations"
            ]
          },
          "meta": {
            "$ref": "#/components/schemas/Meta"
          }
        },
        "required": [
          "data",
          "meta"
        ]
      },
      "Status": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "sources": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "enum": [
                        "nvd",
                        "kev",
                        "epss"
                      ]
                    },
                    "name": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string",
                      "format": "uri"
                    },
                    "last_success_at": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "stale": {
                      "type": "boolean",
                      "description": "No successful refresh for more than 48 hours."
                    },
                    "last_run": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "properties": {
                        "started_at": {
                          "type": "string"
                        },
                        "finished_at": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "ok": {
                          "type": [
                            "boolean",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "started_at",
                        "finished_at",
                        "ok"
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "name",
                    "url",
                    "last_success_at",
                    "stale",
                    "last_run"
                  ]
                }
              },
              "stale_after_hours": {
                "type": "integer",
                "const": 48
              },
              "data_updated_at": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "sources",
              "stale_after_hours",
              "data_updated_at"
            ]
          },
          "meta": {
            "$ref": "#/components/schemas/Meta"
          }
        },
        "required": [
          "data",
          "meta"
        ]
      }
    }
  }
}
