{
  "openapi": "3.1.0",
  "info": {
    "title": "BlueLightDB API",
    "version": "1.0.0",
    "summary": "Look up UK police vehicles by number plate.",
    "description": "The community-checked register of UK police vehicles. Every request needs an API key: create a free account at https://bluelightdb.co.uk/profile (Free: 5 requests a day, for trying it out), or choose a paid plan (Starter £5/month: 10,000 requests a month, 60/minute; Pro £20/month: 100,000 requests a month, 300/minute; Business £50/month: 1,000,000 requests a month, 1200/minute). Send the key in the X-API-Key header (or as Authorization: Bearer <key>). Plate readers should use /api/lookup; to keep your own copy of the register up to date, use /api/changes (paid plans). To ask Claude (or another MCP client) about the register with the same key, add the connector at https://bluelightdb.co.uk/mcp (see /api-docs).",
    "contact": {
      "name": "BlueLightDB",
      "url": "https://bluelightdb.co.uk/contact",
      "email": "info@bluelightdb.co.uk"
    },
    "termsOfService": "https://bluelightdb.co.uk/terms"
  },
  "externalDocs": {
    "description": "API page with examples and a Try it box",
    "url": "https://bluelightdb.co.uk/api-docs"
  },
  "servers": [
    {
      "url": "https://bluelightdb.co.uk"
    }
  ],
  "security": [
    {
      "ApiKeyHeader": []
    },
    {
      "BearerKey": []
    }
  ],
  "tags": [
    {
      "name": "Plate lookups"
    },
    {
      "name": "Register"
    },
    {
      "name": "Your account"
    },
    {
      "name": "Status"
    }
  ],
  "paths": {
    "/api/lookup/{vrm}": {
      "get": {
        "tags": [
          "Plate lookups"
        ],
        "operationId": "lookupPlate",
        "summary": "Is this plate a police vehicle?",
        "description": "Exact match on one plate. `emergency` is true when the vehicle is listed and not known to have been sold or written off.",
        "parameters": [
          {
            "name": "vrm",
            "in": "path",
            "required": true,
            "description": "Number plate, with or without spaces (e.g. AB21XYZ or AB21 XYZ).",
            "schema": {
              "type": "string",
              "minLength": 2,
              "maxLength": 12
            },
            "example": "AB21XYZ"
          }
        ],
        "responses": {
          "200": {
            "description": "The answer (found or not).",
            "headers": {
              "X-Quota-Limit": {
                "description": "Requests allowed in this period (\"unlimited\" for admin keys).",
                "schema": {
                  "type": "string"
                }
              },
              "X-Quota-Remaining": {
                "description": "Requests left in this period.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Quota-Reset": {
                "description": "When the allowance resets (ISO 8601, UTC).",
                "schema": {
                  "type": "string",
                  "format": "date-time"
                }
              },
              "X-Quota-Grace-Remaining": {
                "description": "Paid plans: requests still allowed over the monthly allowance (10% of it) before requests are refused.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Quota-Over": {
                "description": "Paid plans: \"grace\" when this request was over the monthly allowance and used the grace allowance.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LookupResult"
                }
              }
            }
          },
          "400": {
            "description": "Not a valid plate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or the key is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "The key's subscription is not active (cancelled, unpaid or suspended).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Daily or monthly allowance used up, or the per-minute burst limit reached. See Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/lookup": {
      "get": {
        "tags": [
          "Plate lookups"
        ],
        "operationId": "lookupPlates",
        "summary": "Look up to 500 plates at once",
        "description": "Each plate counts as one request.",
        "parameters": [
          {
            "name": "plates",
            "in": "query",
            "required": true,
            "description": "Comma-separated plates.",
            "schema": {
              "type": "string"
            },
            "example": "AB21XYZ,BX24FPA"
          }
        ],
        "responses": {
          "200": {
            "description": "One result per plate, in the order sent.",
            "headers": {
              "X-Quota-Limit": {
                "description": "Requests allowed in this period (\"unlimited\" for admin keys).",
                "schema": {
                  "type": "string"
                }
              },
              "X-Quota-Remaining": {
                "description": "Requests left in this period.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Quota-Reset": {
                "description": "When the allowance resets (ISO 8601, UTC).",
                "schema": {
                  "type": "string",
                  "format": "date-time"
                }
              },
              "X-Quota-Grace-Remaining": {
                "description": "Paid plans: requests still allowed over the monthly allowance (10% of it) before requests are refused.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Quota-Over": {
                "description": "Paid plans: \"grace\" when this request was over the monthly allowance and used the grace allowance.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BulkResult"
                }
              }
            }
          },
          "400": {
            "description": "No plates, or more than 500.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or the key is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "The key's subscription is not active (cancelled, unpaid or suspended).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Daily or monthly allowance used up, or the per-minute burst limit reached. See Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Plate lookups"
        ],
        "operationId": "lookupPlatesPost",
        "summary": "Look up to 500 plates at once (long lists)",
        "description": "Each plate counts as one request.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "plates"
                ],
                "properties": {
                  "plates": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "maxItems": 500
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "One result per plate, in the order sent.",
            "headers": {
              "X-Quota-Limit": {
                "description": "Requests allowed in this period (\"unlimited\" for admin keys).",
                "schema": {
                  "type": "string"
                }
              },
              "X-Quota-Remaining": {
                "description": "Requests left in this period.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Quota-Reset": {
                "description": "When the allowance resets (ISO 8601, UTC).",
                "schema": {
                  "type": "string",
                  "format": "date-time"
                }
              },
              "X-Quota-Grace-Remaining": {
                "description": "Paid plans: requests still allowed over the monthly allowance (10% of it) before requests are refused.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Quota-Over": {
                "description": "Paid plans: \"grace\" when this request was over the monthly allowance and used the grace allowance.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BulkResult"
                }
              }
            }
          },
          "400": {
            "description": "No plates, or more than 500.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or the key is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "The key's subscription is not active (cancelled, unpaid or suspended).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Daily or monthly allowance used up, or the per-minute burst limit reached. See Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/changes": {
      "get": {
        "tags": [
          "Register"
        ],
        "operationId": "listChanges",
        "summary": "Changes since your last sync (paid plans)",
        "description": "Everything added, changed or removed since `since`. Start with since=0 (the whole register), keep calling with the `next` you get back until `more` is false, and store that `next` for the next sync. Each vehicle appears once, as it is now. Identify vehicles by `id`: a plate can be corrected, and then arrives as an upsert of the same id. One call counts as one request.",
        "parameters": [
          {
            "name": "since",
            "in": "query",
            "description": "The `next` value from your previous call; 0 for everything.",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Changes per call.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1000,
              "default": 500
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of changes.",
            "headers": {
              "X-Quota-Limit": {
                "description": "Requests allowed in this period (\"unlimited\" for admin keys).",
                "schema": {
                  "type": "string"
                }
              },
              "X-Quota-Remaining": {
                "description": "Requests left in this period.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Quota-Reset": {
                "description": "When the allowance resets (ISO 8601, UTC).",
                "schema": {
                  "type": "string",
                  "format": "date-time"
                }
              },
              "X-Quota-Grace-Remaining": {
                "description": "Paid plans: requests still allowed over the monthly allowance (10% of it) before requests are refused.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Quota-Over": {
                "description": "Paid plans: \"grace\" when this request was over the monthly allowance and used the grace allowance.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Changes"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or the key is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "The key's subscription is not active (cancelled, unpaid or suspended).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The change feed is for paid plans.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Daily or monthly allowance used up, or the per-minute burst limit reached. See Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/vehicles": {
      "get": {
        "tags": [
          "Register"
        ],
        "operationId": "listVehicles",
        "summary": "Search and browse the register",
        "description": "Listed vehicles only. Up to 50 per page on paid plans, 10 on the Free plan.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "description": "Part of a plate, make or model.",
            "schema": {
              "type": "string",
              "maxLength": 60
            }
          },
          {
            "name": "force",
            "in": "query",
            "description": "Exact force name (see /api/filters).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "make",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "type",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "added",
                "viewed",
                "vrm",
                "force"
              ],
              "default": "added"
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 8
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One page of vehicles.",
            "headers": {
              "X-Quota-Limit": {
                "description": "Requests allowed in this period (\"unlimited\" for admin keys).",
                "schema": {
                  "type": "string"
                }
              },
              "X-Quota-Remaining": {
                "description": "Requests left in this period.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Quota-Reset": {
                "description": "When the allowance resets (ISO 8601, UTC).",
                "schema": {
                  "type": "string",
                  "format": "date-time"
                }
              },
              "X-Quota-Grace-Remaining": {
                "description": "Paid plans: requests still allowed over the monthly allowance (10% of it) before requests are refused.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Quota-Over": {
                "description": "Paid plans: \"grace\" when this request was over the monthly allowance and used the grace allowance.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VehicleList"
                }
              }
            }
          },
          "400": {
            "description": "Invalid query.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or the key is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "The key's subscription is not active (cancelled, unpaid or suspended).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Daily or monthly allowance used up, or the per-minute burst limit reached. See Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/vehicles/{id}": {
      "get": {
        "tags": [
          "Register"
        ],
        "operationId": "getVehicle",
        "summary": "One vehicle, with photos, videos and its DVLA/MOT records",
        "description": "Counts as one request, and as an API lookup of the vehicle (not a view).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The vehicle.",
            "headers": {
              "X-Quota-Limit": {
                "description": "Requests allowed in this period (\"unlimited\" for admin keys).",
                "schema": {
                  "type": "string"
                }
              },
              "X-Quota-Remaining": {
                "description": "Requests left in this period.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Quota-Reset": {
                "description": "When the allowance resets (ISO 8601, UTC).",
                "schema": {
                  "type": "string",
                  "format": "date-time"
                }
              },
              "X-Quota-Grace-Remaining": {
                "description": "Paid plans: requests still allowed over the monthly allowance (10% of it) before requests are refused.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Quota-Over": {
                "description": "Paid plans: \"grace\" when this request was over the monthly allowance and used the grace allowance.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VehicleDetail"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or the key is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "The key's subscription is not active (cancelled, unpaid or suspended).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not listed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Daily or monthly allowance used up, or the per-minute burst limit reached. See Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/estimate/{vrm}": {
      "get": {
        "tags": [
          "Plate lookups"
        ],
        "operationId": "estimateExPolice",
        "summary": "Could this unlisted plate have been a police vehicle?",
        "description": "An estimate, not a record: the plate's DVLA and MOT records scored against the vehicles on the register. For plates that aren't listed (a listed plate answers `listed: true`; use /api/lookup for it). Counts as one request, and each key can ask 60 plates an hour.",
        "parameters": [
          {
            "name": "vrm",
            "in": "path",
            "required": true,
            "description": "Number plate, with or without spaces (e.g. AB21XYZ or AB21 XYZ).",
            "schema": {
              "type": "string",
              "minLength": 2,
              "maxLength": 12
            },
            "example": "AB21XYZ"
          }
        ],
        "responses": {
          "200": {
            "description": "The estimate.",
            "headers": {
              "X-Quota-Limit": {
                "description": "Requests allowed in this period (\"unlimited\" for admin keys).",
                "schema": {
                  "type": "string"
                }
              },
              "X-Quota-Remaining": {
                "description": "Requests left in this period.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Quota-Reset": {
                "description": "When the allowance resets (ISO 8601, UTC).",
                "schema": {
                  "type": "string",
                  "format": "date-time"
                }
              },
              "X-Quota-Grace-Remaining": {
                "description": "Paid plans: requests still allowed over the monthly allowance (10% of it) before requests are refused.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Quota-Over": {
                "description": "Paid plans: \"grace\" when this request was over the monthly allowance and used the grace allowance.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Estimate"
                }
              }
            }
          },
          "400": {
            "description": "Not a valid plate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or the key is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "The key's subscription is not active (cancelled, unpaid or suspended).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Daily or monthly allowance used up, or the per-minute burst limit reached. See Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "The DVLA and MOT records couldn't be reached.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/filters/options": {
      "get": {
        "tags": [
          "Register"
        ],
        "operationId": "getFilterOptions",
        "summary": "Forces, makes and types, narrowed by the others (free)",
        "security": [],
        "description": "With force=Kent, only the makes and types Kent has; with make=BMW, only the forces and types that have BMWs. Not counted.",
        "parameters": [
          {
            "name": "force",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 60
            }
          },
          {
            "name": "make",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 60
            }
          },
          {
            "name": "type",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 40
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The matching lists.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "forces": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "makes": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "types": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid query.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/filters": {
      "get": {
        "tags": [
          "Register"
        ],
        "operationId": "getFilters",
        "summary": "Forces, makes and types in use (free, no key needed)",
        "security": [],
        "responses": {
          "200": {
            "description": "Lists for filters and forms.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "forces": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "makes": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "types": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "allForces": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "allTypes": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "allFuels": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "allStatuses": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "total": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/account": {
      "get": {
        "tags": [
          "Your account"
        ],
        "operationId": "getAccount",
        "summary": "Your plan and how much you've used",
        "responses": {
          "200": {
            "description": "Plan, status and usage.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Account"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or the key is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/health": {
      "get": {
        "tags": [
          "Status"
        ],
        "operationId": "health",
        "summary": "Is the service up? (no key needed)",
        "security": [],
        "responses": {
          "200": {
            "description": "Up.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ApiKeyHeader": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key"
      },
      "BearerKey": {
        "type": "http",
        "scheme": "bearer",
        "description": "The same API key, as Authorization: Bearer <key>."
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "string"
          },
          "field": {
            "type": "string"
          }
        }
      },
      "Vehicle": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "vrm": {
            "type": "string",
            "example": "AB21 XYZ"
          },
          "force": {
            "type": "string",
            "example": "Metropolitan Police"
          },
          "make": {
            "type": "string",
            "example": "BMW"
          },
          "model": {
            "type": "string",
            "example": "330d"
          },
          "type": {
            "type": "string",
            "example": "Roads policing"
          },
          "service": {
            "type": "string",
            "enum": [
              "police"
            ]
          },
          "fuel": {
            "type": "string",
            "example": "Diesel"
          },
          "year": {
            "type": [
              "integer",
              "null"
            ],
            "example": 2021
          },
          "engineCc": {
            "type": [
              "integer",
              "null"
            ],
            "example": 2993
          },
          "colour": {
            "type": "string",
            "example": "White",
            "description": "Usually from the DVLA record; empty if not known."
          },
          "engine": {
            "type": [
              "string",
              "null"
            ],
            "example": "3.0L"
          },
          "fleetStatus": {
            "type": "string",
            "enum": [
              "Police",
              "Sold",
              "Written off"
            ],
            "description": "Police unless it's known to have been sold or written off."
          },
          "added": {
            "type": "string",
            "description": "When it was added (UTC, \"YYYY-MM-DD HH:MM:SS\")."
          },
          "updated": {
            "type": "string",
            "description": "When its details last changed (UTC)."
          },
          "motChecked": {
            "type": "boolean",
            "description": "Make, model and year match the DVSA MOT record."
          },
          "photos": {
            "type": "integer",
            "description": "Number of photos (list answers only)."
          }
        }
      },
      "VehicleDetail": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Vehicle"
          },
          {
            "type": "object",
            "properties": {
              "views": {
                "type": "integer"
              },
              "apiLookups": {
                "type": "integer"
              },
              "addedBy": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "photos": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "url": {
                      "type": "string"
                    },
                    "thumb": {
                      "type": "string"
                    },
                    "width": {
                      "type": "integer"
                    },
                    "height": {
                      "type": "integer"
                    },
                    "credit": {
                      "type": "string",
                      "description": "The photographer, when the photo is credited (\"Photo: …\"). Show it with the photo."
                    },
                    "creditUrl": {
                      "type": "string",
                      "description": "Link for the credit (may be empty)."
                    }
                  }
                }
              },
              "videos": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "integer"
                    },
                    "provider": {
                      "type": "string",
                      "enum": [
                        "youtube",
                        "tiktok",
                        "instagram",
                        "facebook"
                      ]
                    },
                    "site": {
                      "type": "string",
                      "example": "YouTube"
                    },
                    "youtubeId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "title": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "thumb": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "start": {
                      "type": "integer",
                      "description": "Seconds in."
                    },
                    "embed": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  }
                }
              },
              "records": {
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/Records"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "What the DVLA and DVSA MOT records say; null if neither is held."
              }
            }
          }
        ]
      },
      "Records": {
        "type": "object",
        "properties": {
          "firstRegistered": {
            "type": [
              "string",
              "null"
            ],
            "example": "2021-03",
            "description": "Year and month."
          },
          "logbookIssued": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "colour": {
            "type": [
              "string",
              "null"
            ]
          },
          "engineCc": {
            "type": [
              "integer",
              "null"
            ]
          },
          "co2": {
            "type": [
              "integer",
              "null"
            ],
            "description": "g/km."
          },
          "euroStatus": {
            "type": [
              "string",
              "null"
            ]
          },
          "taxStatus": {
            "type": [
              "string",
              "null"
            ],
            "example": "Taxed"
          },
          "taxDue": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "motStatus": {
            "type": [
              "string",
              "null"
            ]
          },
          "motExpiry": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "firstMotDue": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "mileage": {
            "type": [
              "integer",
              "null"
            ],
            "description": "At the last MOT."
          },
          "mileageUnit": {
            "type": [
              "string",
              "null"
            ]
          },
          "lastMot": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "date": {
                    "type": "string"
                  },
                  "result": {
                    "type": "string"
                  }
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "markedForExport": {
            "type": "boolean"
          },
          "typeApproval": {
            "type": [
              "string",
              "null"
            ]
          },
          "revenueWeight": {
            "type": [
              "integer",
              "null"
            ]
          },
          "checked": {
            "type": [
              "string",
              "null"
            ],
            "description": "When the records were last fetched (UTC)."
          },
          "sources": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "dvla",
                "mot"
              ]
            }
          }
        }
      },
      "Estimate": {
        "type": "object",
        "properties": {
          "available": {
            "type": "boolean",
            "description": "False when the site can't ask the DVLA or DVSA at the moment."
          },
          "listed": {
            "type": "boolean",
            "description": "The plate is on the register: look it up instead."
          },
          "found": {
            "type": "boolean",
            "description": "A DVLA or MOT record was found."
          },
          "percent": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100
          },
          "band": {
            "type": "string",
            "enum": [
              "Very likely",
              "Likely",
              "Possible",
              "Unlikely"
            ]
          },
          "limited": {
            "type": "boolean",
            "description": "Little to go on: treat the estimate with care."
          },
          "reasons": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string"
                },
                "text": {
                  "type": "string"
                },
                "effect": {
                  "type": "string",
                  "enum": [
                    "for",
                    "against",
                    "neutral"
                  ]
                }
              }
            }
          },
          "vehicle": {
            "type": "object",
            "properties": {
              "make": {
                "type": "string"
              },
              "model": {
                "type": "string"
              },
              "colour": {
                "type": "string"
              },
              "year": {
                "type": [
                  "integer",
                  "null"
                ]
              }
            }
          }
        }
      },
      "VehicleList": {
        "type": "object",
        "properties": {
          "total": {
            "type": "integer"
          },
          "page": {
            "type": "integer"
          },
          "pageSize": {
            "type": "integer"
          },
          "pages": {
            "type": "integer"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Vehicle"
            }
          }
        }
      },
      "LookupResult": {
        "type": "object",
        "required": [
          "vrm",
          "found",
          "emergency"
        ],
        "properties": {
          "vrm": {
            "type": "string"
          },
          "found": {
            "type": "boolean",
            "description": "The plate is on the register."
          },
          "emergency": {
            "type": "boolean",
            "description": "Listed and not known to have been sold or written off."
          },
          "service": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "police",
              null
            ]
          },
          "vehicle": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Vehicle"
              },
              {
                "type": "null"
              }
            ]
          },
          "error": {
            "type": "string",
            "description": "Only in bulk answers, for a plate that isn't valid."
          }
        }
      },
      "BulkResult": {
        "type": "object",
        "properties": {
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LookupResult"
            }
          }
        }
      },
      "Changes": {
        "type": "object",
        "properties": {
          "since": {
            "type": "integer"
          },
          "next": {
            "type": "integer",
            "description": "Pass as `since` next time."
          },
          "more": {
            "type": "boolean",
            "description": "Call again straight away with `next`."
          },
          "latest": {
            "type": "integer"
          },
          "changes": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "seq",
                "change",
                "id",
                "vrm"
              ],
              "properties": {
                "seq": {
                  "type": "integer"
                },
                "change": {
                  "type": "string",
                  "enum": [
                    "upsert",
                    "remove"
                  ]
                },
                "id": {
                  "type": "integer"
                },
                "vrm": {
                  "type": "string"
                },
                "at": {
                  "type": "string",
                  "format": "date-time"
                },
                "vehicle": {
                  "$ref": "#/components/schemas/Vehicle",
                  "description": "Only for upserts."
                }
              }
            }
          }
        }
      },
      "Account": {
        "type": "object",
        "properties": {
          "tier": {
            "type": "string"
          },
          "plan": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "active": {
            "type": "boolean"
          },
          "renews": {
            "type": [
              "string",
              "null"
            ]
          },
          "keyPrefix": {
            "type": "string"
          },
          "perMinute": {
            "type": "integer"
          },
          "usage": {
            "type": "object",
            "properties": {
              "used": {
                "type": "integer"
              },
              "limit": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "per": {
                "type": "string",
                "enum": [
                  "day",
                  "month",
                  "unlimited"
                ]
              },
              "resets": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          }
        }
      }
    }
  }
}