{
    "openapi": "3.0.3",
    "info": {
        "title": "MOT History API",
        "version": "1.0.0",
        "description": "The complete DVSA MOT record for a UK vehicle \u2014 every test, result, recorded mileage, and the full advisory and failure notes.\n\nUse it to surface a vehicle's condition history, spot mileage anomalies, or show a full service timeline in your app."
    },
    "servers": [
        {
            "url": "https://vehiclematic.com/products/mot-history/api/live",
            "description": "Live"
        }
    ],
    "security": [
        {
            "ApiKeyAuth": []
        }
    ],
    "tags": [
        {
            "name": "Lookups",
            "description": "Look up MOT History data by UK registration."
        }
    ],
    "paths": {
        "/{vrm}": {
            "get": {
                "tags": [
                    "Lookups"
                ],
                "operationId": "lookup",
                "summary": "Look up by registration",
                "description": "Returns MOT History for a single UK registration (VRM). Costs \u00a30.06 per lookup on Tier 1, down to \u00a30.02 on the largest top-up tier.",
                "parameters": [
                    {
                        "name": "vrm",
                        "in": "path",
                        "required": true,
                        "description": "UK vehicle registration mark.",
                        "schema": {
                            "type": "string",
                            "pattern": "^[A-Z0-9]{1,8}$",
                            "example": "AB12CDE"
                        }
                    },
                    {
                        "name": "format",
                        "in": "query",
                        "required": false,
                        "description": "Response format. Defaults to JSON.",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "json",
                                "csv"
                            ],
                            "default": "json"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful lookup.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "vrm": {
                                                    "type": "string"
                                                },
                                                "mot_history": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "test_date": {
                                                                "type": "string"
                                                            },
                                                            "result": {
                                                                "type": "string"
                                                            },
                                                            "odometer": {
                                                                "type": "integer"
                                                            },
                                                            "odometer_unit": {
                                                                "type": "string"
                                                            },
                                                            "expiry_date": {
                                                                "type": "string"
                                                            },
                                                            "advisories": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "string"
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        },
                                        "credit_balance": {
                                            "type": "integer"
                                        }
                                    }
                                },
                                "example": {
                                    "data": {
                                        "vrm": "AB12CDE",
                                        "mot_history": [
                                            {
                                                "test_date": "2025-03-12",
                                                "result": "PASSED",
                                                "odometer": 48210,
                                                "odometer_unit": "mi",
                                                "expiry_date": "2026-03-14",
                                                "advisories": [
                                                    "Nearside front tyre worn close to the legal limit"
                                                ]
                                            },
                                            {
                                                "test_date": "2024-03-05",
                                                "result": "FAILED",
                                                "odometer": 36940,
                                                "odometer_unit": "mi",
                                                "expiry_date": null,
                                                "advisories": [
                                                    "Offside rear brake disc worn"
                                                ]
                                            }
                                        ]
                                    },
                                    "credit_balance": 499
                                }
                            }
                        }
                    },
                    "402": {
                        "description": "Insufficient credits.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "error": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    }
                                },
                                "example": {
                                    "error": true,
                                    "message": "Insufficient credits.",
                                    "credit_balance": 0
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "This API key is not authorised for this product.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "error": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    }
                                },
                                "example": {
                                    "error": true,
                                    "message": "This API key is not authorised for this product."
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Missing or invalid registration.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "error": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    }
                                },
                                "example": {
                                    "error": true,
                                    "message": "A vrm parameter is required."
                                }
                            }
                        }
                    }
                }
            }
        },
        "/lookup": {
            "post": {
                "tags": [
                    "Lookups"
                ],
                "operationId": "bulkLookup",
                "summary": "Bulk lookup",
                "description": "Look up many registrations in one request (up to 50). Each result is charged at your per-lookup tier price. Processing stops when the balance is exhausted.",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "required": [
                                    "vrms"
                                ],
                                "properties": {
                                    "vrms": {
                                        "type": "array",
                                        "items": {
                                            "type": "string",
                                            "example": "AB12CDE"
                                        },
                                        "maxItems": 50,
                                        "description": "Registrations to look up."
                                    }
                                }
                            },
                            "example": {
                                "vrms": [
                                    "AB12CDE",
                                    "XY19ABC"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Results, one per registration, in request order.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "vrm": {
                                                        "type": "string"
                                                    },
                                                    "mot_history": {
                                                        "type": "array",
                                                        "items": {
                                                            "type": "object",
                                                            "properties": {
                                                                "test_date": {
                                                                    "type": "string"
                                                                },
                                                                "result": {
                                                                    "type": "string"
                                                                },
                                                                "odometer": {
                                                                    "type": "integer"
                                                                },
                                                                "odometer_unit": {
                                                                    "type": "string"
                                                                },
                                                                "expiry_date": {
                                                                    "type": "string"
                                                                },
                                                                "advisories": {
                                                                    "type": "array",
                                                                    "items": {
                                                                        "type": "string"
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        },
                                        "requested": {
                                            "type": "integer"
                                        },
                                        "returned": {
                                            "type": "integer"
                                        },
                                        "credit_balance": {
                                            "type": "integer"
                                        }
                                    }
                                },
                                "example": {
                                    "data": [
                                        {
                                            "vrm": "AB12CDE",
                                            "mot_history": [
                                                {
                                                    "test_date": "2025-03-12",
                                                    "result": "PASSED",
                                                    "odometer": 48210,
                                                    "odometer_unit": "mi",
                                                    "expiry_date": "2026-03-14",
                                                    "advisories": [
                                                        "Nearside front tyre worn close to the legal limit"
                                                    ]
                                                },
                                                {
                                                    "test_date": "2024-03-05",
                                                    "result": "FAILED",
                                                    "odometer": 36940,
                                                    "odometer_unit": "mi",
                                                    "expiry_date": null,
                                                    "advisories": [
                                                        "Offside rear brake disc worn"
                                                    ]
                                                }
                                            ]
                                        }
                                    ],
                                    "requested": 1,
                                    "returned": 1,
                                    "credit_balance": 499
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Too many registrations (max 50).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "error": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    }
                                },
                                "example": {
                                    "error": true,
                                    "message": "A maximum of 50 registrations may be looked up per request."
                                }
                            }
                        }
                    }
                }
            }
        }
    },
    "components": {
        "securitySchemes": {
            "ApiKeyAuth": {
                "type": "apiKey",
                "in": "header",
                "name": "X-VEHICLEMATIC-KEY",
                "description": "Your API key. Create one on the API access page in your portal."
            }
        }
    }
}