MOT history API

A new version of the MOT history API is available. You can register to use the new API now (opens in new tab).

The old API will be turned off later this year. We’ll contact users before this happens. If you are using the old API, you’ll need to register to use the new MOT history API (opens in new tab).

Overview

The MOT history API gives authorised third-party organisations a way to access MOT test history information for vehicles.

The information includes:

  • MOT test date
  • MOT expiry date
  • test result
  • mileage reading
  • MOT test number
  • reasons for failure and advisory notices
  • first MOT due date for new vehicles
  • vehicle ID
  • vehicle registration date
  • vehicle manufacturing date
  • cylinder capacity of the engine

API endpoints

You can use the API from 4 different endpoints:

  1. MOT test history for a single vehicle using a registration number

    Search for the MOT history using just the registration number of the vehicle. Use this method if you want the MOT history for a limited number of vehicles or want to check the latest information for a vehicle.

  2. MOT test history for all vehicles

    Use this method if you are interested in a large number of vehicles and want to keep an offline copy.

  3. MOT test history for all vehicles tested on a certain date

    Use this method to find out which vehicles have been tested on a particular date. You can also use this method to maintain the data that you have extracted using either of the other two methods above.

  4. MOT test history using a vehicle's unique identifier

    Search for the MOT history using the vehicle's unique identifier. Use this method if you want the MOT history of a vehicle that has changed its registration number.

Amount of use

Depending on how much data you want to access, we recommend the following ways of using the API.

  1. Fewer than 150,000 requests a day

    Use endpoint 1 to get MOT test history data for individual vehicles when necessary.

  2. More than 150,000 requests a day and interested in up to 10 million vehicles

    Use endpoint 1 to get all the MOT history data that you want and use endpoint 3 to maintain the data. Store the data and use daily updates to maintain it, filtering out vehicles you are not interested in.

  3. Interested in more than 10 million vehicles and up to all vehicles

    Use endpoint 2 to get the MOT history data for all the vehicles and use endpoint 3 to maintain the data. Store the data and use daily updates to maintain it, filtering out vehicles you are not interested in.

Getting started

All API interfaces are implemented as restful APIs and accessed over https.

To access API you will need an API key that uniquely identifies the source of the request. DVSA will give you an API key if it approves your application.

You should keep your API key secure, as DVSA manages throttling and quotas at an API key level.

Each request must have the following mandatory fields in the header:

  • Accept: application/json+v6
  • x-api-key: <your api key>

Content-type field confirms that the response type is in JSON format, and the x-api-key field serves your API key to identify the source of the request.

Technical resources

Access the API at https://beta.check-mot.service.gov.uk/

This root URL will change when the service moves from beta to live.

These 4 endpoints equate to the 4 methods of using the API:

  1. /trade/vehicles/mot-tests?registration={registration}

    ‘Registration’ is the vehicle registration number.

  2. /trade/vehicles/mot-tests?page={page}

    ‘Page’ starts at 0 and ends when you have more than 50,000 pages and 404 Not Found response is returned.

  3. /trade/vehicles/mot-tests?date={date}&page={page}

    ‘Date’ is the date of MOT tests and ‘page’ is between 1 and 1440 inclusive.

  4. /trade/vehicles/mot-tests?vehicleId={vehicleId}

    'vehicleId' is the unique vehicle ID for vehicles that have had an MOT test.

All pages should be requested daily. Pages without MOT tests will return a 404 Not Found response.

Examples

These examples use the curl command to illustrate how to use the four different methods:

  • curl -H "Accept: application/json+v6" -H "x-api-key: <your_api_key>" \https://beta.check-mot.service.gov.uk/trade/vehicles/mot-tests\?registration=ZZ99ABC

    To request the MOT test history for registration ZZ99ABC

  • curl -H "Accept: application/json+v6" -H "x-api-key: <your_api_key>" \https://beta.check-mot.service.gov.uk/trade/vehicles/mot-tests\?page=[0-58002]

    (as of 13th July 2017)

    To request a full extract of the database. The last page normally increments by 10 each day.

  • curl -H "Accept: application/json+v6" -H "x-api-key: <your_api_key>" \https://beta.check-mot.service.gov.uk/trade/vehicles/mot-tests\?date=20170310\&page=[1-1440]

    To request MOT tests completed on 10 March 2017 from page 1 to 1440.

    Example

    • page 1 shows all tests completed on 10 March 2017 at the 10/03/2017 at 0:01am
    • page 300 shows all tests completed on 10 March 2017 at 5am
    • page 600 shows all tests completed on 10 March 2017 at 10am
  • curl -H "Accept: application/json+v6" -H "x-api-key: <your_api_key>" \https://beta.check-mot.service.gov.uk/trade/vehicles/mot-tests\?vehicleId=4Tq319nVKLz+25IRaUo79w==

    To request the MOT test history for a vehicle with the ID '4Tq319nVKLz+25IRaUo79w=='.

Each request returns a JSON document with a collection of vehicles, and each vehicle contains the basic vehicle details and all its past MOT test results.

Reason for rejection types and dangerous defects

The MOT rules changed on the 20 May 2018 (opens in new tab). This included the way that defects are categorised.

Before 20 May 2018, indicating where a defect was dangerous was an objective and manual process. The ‘dangerous’ property indicates where a defect has been manually marked as dangerous. From 20 May 2018, defect severity is automatically categorised. The RFR property ‘type’ returns the specific defect severity.

Example response

[ { "registration": "ZZ99ABC", "make": "FORD", "model": "FOCUS", "firstUsedDate": "2010.11.13", "fuelType": "Petrol", "primaryColour": "Yellow", "vehicleId": "4Tq319nVKLz+25IRaUo79w==", "registrationDate": "2010.11.13", "manufactureDate": "2010.11.13", "engineSize": "1800", "motTests":[ { "completedDate": "2013.11.03 09:33:08", "testResult": "PASSED", "expiryDate": "2014.11.02", "odometerValue": "47125", "odometerUnit": "mi", "odometerResultType": "READ", "motTestNumber": "914655760009", "rfrAndComments": [] }, { "completedDate": "2013.11.01 11:28:34", "testResult": "FAILED", "odometerValue": "47118", "odometerUnit": "mi", "odometerResultType": "READ", "motTestNumber": "841470560098", "rfrAndComments":[ { "text": "Front brake disc excessively pitted (3.5.1h)", "type": "FAIL", "dangerous": true }, { "text": "Nearside Rear wheel bearing has slight play (2.6.2)", "type": "ADVISORY", "dangerous": false } ] }, { "completedDate": "2018.05.20 11:28:34", "testResult": "FAILED", "odometerValue": "57318", "odometerUnit": "mi", "odometerResultType": "READ", "motTestNumber": "741489560458", "rfrAndComments":[ { "text": "Nearside Parking brake efficiency below requirements (1.4.2 (a) (i))", "type": "MAJOR", "dangerous": false }, { "text": "Front brake disc excessively pitted (3.5.1h)", "type": "DANGEROUS", "dangerous": false }, { "text": "tyres wearing unevenly", "type": "USER ENTERED", "dangerous": true } ] } ] }, { "registration": "YY09DEF", "make": "BMW", "model": "Z4", "firstUsedDate": "2009.01.25", "fuelType": "Petrol", "primaryColour": "Green", "vehicleId": "3Fv916dPLGx=43PRaKa45e++", "registrationDate": "2009.01.25", "manufactureDate": "2009.01.25", "engineSize": "1800", "motTests":[ { "completedDate": "2012.01.10 10:27:56", "testResult": "PASSED", "expiryDate": "2013.01.09", "odometerValue": "12345", "odometerUnit": "mi", "odometerResultType": "READ", "motTestNumber": "345655760009", "rfrAndComments": [] } ] } ]

Response codes

A valid request should return a ‘200 - OK’ or a ‘404 - resource not found’ response code:

Code Scenario
200 - OK Your request was serviced
404 - resource not found Vehicle with the provided parameters was not found or its test records are not valid

Possible errors are:

Code Scenario
400 – bad request Invalid data in the request. Check your URL and parameters
403 – unauthorised The x-api-key is missing or invalid in the header

Possible errors are:

Code Scenario
400 – bad request Invalid data in the request. Check your URL and parameters. Ensure that if you have provided a date that it is less that 5 weeks before today
403 – unauthorised The x-api-key is missing or invalid in the header
415 – unsupported media type The Content-Type is wrong in the header
429 – too many requests You have exceeded your rate or quota
500 – internal server error Please contact support and provide the request ID returned
503 – service unavailable The service is not available
504 – gateway timeout The service did not respond in the time limit

Change log

17 September 2019

Restriction added on using date for api requests. Dates that are over 5 weeks before the current date will produce a 400 error.

22 January 2019

Accept header value changed into application/json+v6.

Added a new endpoint that allows you to search using the 'vehicleId' field.

Vehicle objects also show the 'vehicleId' field in the response for vehicles with an MOT test.

11 December 2018

Accept header value changed into application/json+v5.

Vehicles have three new properties - if they are not available, they will not be included in the response:

Field Description
registrationDate The date the vehicle was registered
manufactureDate The date the vehicle was manufactured
engineSize The cylinder capacity of the engine in cubic centimetres

21 August 2018

Accept header value changed into application/json+v4.

The RFR property ‘type’ will return the specific defect severity ‘DANGEROUS or ‘MAJOR’ instead of generic type ‘FAIL’ for tests completed from the 20th May.

30 January 2018

Accept header value changed into application/json+v3.

Property name ‘motTestExpiryDate’ passed for vehicles without an MOT has been renamed to ‘motTestDueDate’.

14 November 2017

Accept header value changed into application/json+v2.

New property ‘odometerResultType’ added for each MOT item in the response; the value will be one of: ‘READ’, ‘UNREADABLE’ or ‘NO_ODOMETER’.

New property ‘dangerous’ added for each reason for refusal item in the response; the value will be either true or false.

23 March 2017

First published.

Support

If you have any issues using MOT history API, complete the MOT History API request and support form (opens in new tab).

HGV/PSV Operators Annual Test History API Service

Introduction

The HGV/PSV Operators Annual Test History API provides a mechanism for authorised third-party organisations to access Annual Test History information for HGVs, PSVs and Trailers through an API.

Getting started

All Annual Test History API interfaces are implemented as restful APIs and accessed over https. In order to access the API you will require an API Key that uniquely identifies the source of the request. API Keys should be treated as sensitive information as throttling and quotas are managed at an API Key level.

Each request must have two mandatory fields in the header to enable you to access the data:

  • Content-type: application/json
  • x-api-key: <your api key>

The first field ensures that the response type is in json format and the second field provides your API key to identify the source of the request. You will not be able to access the API without providing a valid API Key.

Technical resources

Technical documentation will be sent out with your API key, including instructions for how to use it. The technical documentation will include the following:

  • the endpoint
  • curl command
  • example response

Response codes

A valid request should return a ‘200 - OK’ or a ‘404 - resource not found’ response code:

Code Scenario
200 - OK Your request was serviced
404 - resource not found Vehicle with the provided parameters was not found or its test records are not valid

Possible errors are:

Code Scenario
400 – bad request Invalid data in the request. Check your URL and parameters
403 – unauthorised The x-api-key is missing or invalid in the header
415 – unsupported media type The Content-Type is wrong in the header
429 – too many requests You have exceeded your rate or quota
500 – internal server error Please contact support and provide the request ID returned
503 – service unavailable The service is not available
504 – gateway timeout The service did not respond in the time limit

Support

If you have any issues using MOT history API, complete the MOT History API request and support form (opens in new tab).

The minimum dataset needs to be provided:

  • Name of company
  • Name of individual reporting issue.
  • Contact E-mail, Telephone,
  • Preferred method of contact
  • Description of issue.
  • Detailed description of issue.

This will generate a ticket in the DVSA Toolset. A member of the DVSA /BJSS support team will pick this up and deal with accordingly.

All issues will be logged as a Priority 3 incident.